diff --git a/.github/scripts/README.md b/.github/scripts/README.md
new file mode 100644
index 00000000..53858d7e
--- /dev/null
+++ b/.github/scripts/README.md
@@ -0,0 +1,33 @@
+Watch and Fix automation
+
+This folder contains a small script to watch a workflow's recent runs and automatically create
+a retry-based fix PR if a failing run is detected.
+
+Usage:
+
+```bash
+# PowerShell (temporary env):
+`$env:GITHUB_TOKEN='...'; node .github/scripts/watch_and_fix.cjs --owner OWNER --repo REPO [--minutes 60] [--poll 60]; Remove-Item Env:GITHUB_TOKEN`
+
+# Or set for session then run:
+`$env:GITHUB_TOKEN='...'
+node .github/scripts/watch_and_fix.cjs --owner OWNER --repo REPO [--minutes 60] [--poll 60]
+Remove-Item Env:GITHUB_TOKEN`
+
+# cmd.exe one-liner:
+`set "GITHUB_TOKEN=..." && node .github/scripts/watch_and_fix.cjs --owner OWNER --repo REPO [--minutes 60] [--poll 60]`
+
+# Recommended: use the `gh` CLI wrapper which authenticates securely and runs the watcher without exposing the PAT:
+```powershell
+# Authenticate (interactive)
+gh auth login
+
+# Then run the wrapper (uses gh auth token under the hood)
+powershell -File .github/scripts/run_watcher.ps1 -Owner 73junito -Repo autolearnpro -Minutes 60 -Poll 60
+```
+
+Notes:
+- Script requires Node 18+ (global `fetch`).
+- The script creates a branch and PR that adds a retry loop around `pnpm install` in
+ `.github/workflows/storybook.yml` to mitigate transient install failures.
+ Use the `.cjs` script when the repo has `"type": "module"` in `package.json`.
diff --git a/.github/scripts/run_watcher.ps1 b/.github/scripts/run_watcher.ps1
new file mode 100644
index 00000000..adc70b63
--- /dev/null
+++ b/.github/scripts/run_watcher.ps1
@@ -0,0 +1,36 @@
+# PowerShell wrapper: ensures `gh` auth and runs the watcher securely.
+param(
+ [string]$Owner = '73junito',
+ [string]$Repo = 'autolearnpro',
+ [int]$Minutes = 60,
+ [int]$Poll = 60
+)
+
+# Check gh
+if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
+ Write-Host "gh CLI not found. Install from https://cli.github.com/ or use winget: winget install --id GitHub.cli -e --source winget"
+ exit 1
+}
+
+# Ensure gh is authenticated
+$auth = gh auth status 2>&1
+if ($LASTEXITCODE -ne 0) {
+ Write-Host "Not authenticated. Running 'gh auth login'..."
+ gh auth login
+ if ($LASTEXITCODE -ne 0) { Write-Error "gh auth login failed"; exit 1 }
+}
+
+# Get token from gh
+$token = gh auth token 2>&1
+if ($LASTEXITCODE -ne 0 -or -not $token) {
+ Write-Error "Failed to obtain token from 'gh auth token'"
+ exit 1
+}
+
+# Run watcher with token in env (session only)
+$env:GITHUB_TOKEN = $token
+try {
+ node .github/scripts/watch_and_fix.cjs --owner $Owner --repo $Repo --minutes $Minutes --poll $Poll
+} finally {
+ Remove-Item Env:GITHUB_TOKEN -ErrorAction SilentlyContinue
+}
diff --git a/.github/scripts/watch_and_fix.cjs b/.github/scripts/watch_and_fix.cjs
new file mode 100644
index 00000000..9937e123
--- /dev/null
+++ b/.github/scripts/watch_and_fix.cjs
@@ -0,0 +1,142 @@
+#!/usr/bin/env node
+// CommonJS version of watch_and_fix for repositories with "type": "module".
+const { argv, env } = require('process');
+const fetch = globalThis.fetch;
+if (!fetch) {
+ console.error('Node runtime must support global fetch (Node 18+).');
+ process.exit(1);
+}
+
+function arg(name) {
+ const idx = argv.indexOf(`--${name}`);
+ return idx >= 0 ? argv[idx + 1] : undefined;
+}
+
+const OWNER = arg('owner');
+const REPO = arg('repo');
+const WORKFLOW = arg('workflow') || 'storybook.yml';
+const DURATION_MIN = Number(arg('minutes') || '60');
+const POLL_SEC = Number(arg('poll') || '60');
+let TOKEN = env.GITHUB_TOKEN;
+// If no env var provided, try to use `gh auth token` if available to avoid prompting for PAT
+if (!TOKEN) {
+ try {
+ const { execSync } = require('child_process');
+ const out = execSync('gh auth token', { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
+ if (out) {
+ TOKEN = out;
+ console.log('Using token from `gh auth token`.');
+ }
+ } catch (e) {
+ // ignore - will error later if TOKEN still unset
+ }
+}
+
+if (!OWNER || !REPO) {
+ console.error('Usage: node watch_and_fix.cjs --owner OWNER --repo REPO [--minutes 60] [--poll 60]');
+ process.exit(2);
+}
+
+if (!TOKEN) {
+ console.error('No GitHub token available. Set GITHUB_TOKEN or run `gh auth login` and ensure `gh auth token` returns a token.');
+ process.exit(2);
+}
+
+const API = `https://api.github.com/repos/${OWNER}/${REPO}`;
+
+async function gh(path, opts = {}) {
+ opts.headers = Object.assign({}, opts.headers || {}, {
+ Authorization: `token ${TOKEN}`,
+ 'User-Agent': 'watch-and-fix-script',
+ Accept: 'application/vnd.github+json',
+ });
+ const res = await fetch(`${API}${path}`, opts);
+ if (!res.ok) {
+ const text = await res.text();
+ if (res.status === 401) {
+ throw new Error('Unauthorized (401): GitHub token invalid or missing required scopes.\n' +
+ 'When running locally, create a Personal Access Token with `repo` scope and set it as GITHUB_TOKEN.\n' +
+ 'See: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token');
+ }
+ throw new Error(`${res.status} ${res.statusText} ${text}`);
+ }
+ return res.json();
+}
+
+async function getLatestRun() {
+ const path = `/actions/workflows/${WORKFLOW}/runs?per_page=1`;
+ const data = await gh(path);
+ return data.workflow_runs && data.workflow_runs[0];
+}
+
+async function createRetryFixPR(defaultBranch) {
+ const path = `/contents/.github/workflows/storybook.yml`;
+ const file = await gh(path + `?ref=${defaultBranch}`);
+ const content = Buffer.from(file.content, 'base64').toString('utf8');
+
+ const installBlockRegex = /- name: Install dependencies \(ui\)[\s\S]*?- name:/m;
+ const retryBlock = `- name: Install dependencies (ui)\n working-directory: packages/ui\n run: |\n set -euo pipefail\n echo "Installing dependencies with retries"\n for i in 1 2 3; do\n pnpm install --frozen-lockfile && break || { echo "pnpm install failed (attempt $i)"; sleep $((i * 5)); }\n done\n\n - name:`;
+
+ if (!installBlockRegex.test(content)) {
+ console.error('Could not find install block to replace. Aborting automated fix.');
+ return null;
+ }
+
+ const newContent = content.replace(installBlockRegex, retryBlock);
+
+ // create branch
+ const timestamp = Date.now();
+ const branch = `autofix/storybook-retry-${timestamp}`;
+ const defaultRef = await gh(`/git/ref/heads/${defaultBranch}`);
+ const sha = defaultRef.object.sha;
+ await gh('/git/refs', { method: 'POST', body: JSON.stringify({ ref: `refs/heads/${branch}`, sha }) });
+
+ // update file on new branch
+ const putPath = `/contents/.github/workflows/storybook.yml`;
+ const body = {
+ message: 'chore: retry pnpm install in Storybook workflow (automated)',
+ content: Buffer.from(newContent, 'utf8').toString('base64'),
+ branch,
+ sha: file.sha,
+ };
+ await gh(putPath, { method: 'PUT', body: JSON.stringify(body) });
+
+ // create PR
+ const pr = await gh('/pulls', {
+ method: 'POST',
+ body: JSON.stringify({ title: 'Automated: retry pnpm install for Storybook build', head: branch, base: defaultBranch, body: 'Automated fix: add retries to pnpm install to mitigate transient failures.' }),
+ });
+ return pr.html_url;
+}
+
+async function main() {
+ const repoInfo = await gh('');
+ const defaultBranch = repoInfo.default_branch || 'main';
+
+ const end = Date.now() + DURATION_MIN * 60 * 1000;
+ console.log(`Watching ${OWNER}/${REPO} workflow ${WORKFLOW} for ${DURATION_MIN} minutes (poll ${POLL_SEC}s)`);
+
+ let lastSeenRunId = null;
+ while (Date.now() < end) {
+ try {
+ const run = await getLatestRun();
+ if (run && run.id !== lastSeenRunId) {
+ lastSeenRunId = run.id;
+ console.log(`Latest run #${run.id} - status=${run.status} conclusion=${run.conclusion} url=${run.html_url}`);
+ if (run.conclusion && run.conclusion !== 'success') {
+ console.log('Detected failing run — attempting automated fix');
+ const prUrl = await createRetryFixPR(defaultBranch);
+ if (prUrl) console.log('Created PR:', prUrl);
+ else console.log('Automated fix not applied.');
+ return;
+ }
+ }
+ } catch (err) {
+ console.error('Error while checking runs:', err.message || err);
+ }
+ await new Promise(r => setTimeout(r, POLL_SEC * 1000));
+ }
+ console.log('Watch duration completed with no failing run detected.');
+}
+
+main().catch(err => { console.error(err); process.exit(1); });
diff --git a/.github/scripts/watch_and_fix.js b/.github/scripts/watch_and_fix.js
new file mode 100644
index 00000000..0b8ca8ed
--- /dev/null
+++ b/.github/scripts/watch_and_fix.js
@@ -0,0 +1,118 @@
+#!/usr/bin/env node
+// Watch Storybook workflow runs for failures and create an automated retry-fix PR.
+// Usage: GITHUB_TOKEN=... node .github/scripts/watch_and_fix.js --owner OWNER --repo REPO
+
+const { argv, env } = require('process');
+const fetch = globalThis.fetch;
+if (!fetch) {
+ console.error('Node runtime must support global fetch (Node 18+).');
+ process.exit(1);
+}
+
+function arg(name) {
+ const idx = argv.indexOf(`--${name}`);
+ return idx >= 0 ? argv[idx + 1] : undefined;
+}
+
+const OWNER = arg('owner');
+const REPO = arg('repo');
+const WORKFLOW = arg('workflow') || 'storybook.yml';
+const DURATION_MIN = Number(arg('minutes') || '60');
+const POLL_SEC = Number(arg('poll') || '60');
+const TOKEN = env.GITHUB_TOKEN;
+
+if (!OWNER || !REPO || !TOKEN) {
+ console.error('Usage: GITHUB_TOKEN=... node watch_and_fix.js --owner OWNER --repo REPO [--minutes 60] [--poll 60]');
+ process.exit(2);
+}
+
+const API = `https://api.github.com/repos/${OWNER}/${REPO}`;
+
+async function gh(path, opts = {}) {
+ opts.headers = Object.assign({}, opts.headers || {}, {
+ Authorization: `token ${TOKEN}`,
+ 'User-Agent': 'watch-and-fix-script',
+ Accept: 'application/vnd.github+json',
+ });
+ const res = await fetch(`${API}${path}`, opts);
+ if (!res.ok) throw new Error(`${res.status} ${res.statusText} ${await res.text()}`);
+ return res.json();
+}
+
+async function getLatestRun() {
+ const path = `/actions/workflows/${WORKFLOW}/runs?per_page=1`;
+ const data = await gh(path);
+ return data.workflow_runs && data.workflow_runs[0];
+}
+
+async function createRetryFixPR(defaultBranch) {
+ const path = `/contents/.github/workflows/storybook.yml`;
+ const file = await gh(path + `?ref=${defaultBranch}`);
+ const content = Buffer.from(file.content, 'base64').toString('utf8');
+
+ const installBlockRegex = /- name: Install dependencies \(ui\)[\s\S]*?- name:/m;
+ const retryBlock = `- name: Install dependencies (ui)\n working-directory: packages/ui\n run: |\n set -euo pipefail\n echo "Installing dependencies with retries"\n for i in 1 2 3; do\n pnpm install --frozen-lockfile && break || { echo "pnpm install failed (attempt $i)"; sleep $((i * 5)); }\n done\n\n - name:`;
+
+ if (!installBlockRegex.test(content)) {
+ console.error('Could not find install block to replace. Aborting automated fix.');
+ return null;
+ }
+
+ const newContent = content.replace(installBlockRegex, retryBlock);
+
+ // create branch
+ const timestamp = Date.now();
+ const branch = `autofix/storybook-retry-${timestamp}`;
+ const defaultRef = await gh(`/git/ref/heads/${defaultBranch}`);
+ const sha = defaultRef.object.sha;
+ await gh('/git/refs', { method: 'POST', body: JSON.stringify({ ref: `refs/heads/${branch}`, sha }) });
+
+ // update file on new branch
+ const putPath = `/contents/.github/workflows/storybook.yml`;
+ const body = {
+ message: 'chore: retry pnpm install in Storybook workflow (automated)',
+ content: Buffer.from(newContent, 'utf8').toString('base64'),
+ branch,
+ sha: file.sha,
+ };
+ await gh(putPath, { method: 'PUT', body: JSON.stringify(body) });
+
+ // create PR
+ const pr = await gh('/pulls', {
+ method: 'POST',
+ body: JSON.stringify({ title: 'Automated: retry pnpm install for Storybook build', head: branch, base: defaultBranch, body: 'Automated fix: add retries to pnpm install to mitigate transient failures.' }),
+ });
+ return pr.html_url;
+}
+
+async function main() {
+ const repoInfo = await gh('');
+ const defaultBranch = repoInfo.default_branch || 'main';
+
+ const end = Date.now() + DURATION_MIN * 60 * 1000;
+ console.log(`Watching ${OWNER}/${REPO} workflow ${WORKFLOW} for ${DURATION_MIN} minutes (poll ${POLL_SEC}s)`);
+
+ let lastSeenRunId = null;
+ while (Date.now() < end) {
+ try {
+ const run = await getLatestRun();
+ if (run && run.id !== lastSeenRunId) {
+ lastSeenRunId = run.id;
+ console.log(`Latest run #${run.id} - status=${run.status} conclusion=${run.conclusion} url=${run.html_url}`);
+ if (run.conclusion && run.conclusion !== 'success') {
+ console.log('Detected failing run — attempting automated fix');
+ const prUrl = await createRetryFixPR(defaultBranch);
+ if (prUrl) console.log('Created PR:', prUrl);
+ else console.log('Automated fix not applied.');
+ return;
+ }
+ }
+ } catch (err) {
+ console.error('Error while checking runs:', err.message || err);
+ }
+ await new Promise(r => setTimeout(r, POLL_SEC * 1000));
+ }
+ console.log('Watch duration completed with no failing run detected.');
+}
+
+main().catch(err => { console.error(err); process.exit(1); });
diff --git a/.github/workflows/block-stubs.yml b/.github/workflows/block-stubs.yml
new file mode 100644
index 00000000..0c71f690
--- /dev/null
+++ b/.github/workflows/block-stubs.yml
@@ -0,0 +1,105 @@
+name: Block stub content
+
+# Scan PRs for stub content and block merges until all stubs are humanized.
+# Behavior:
+# - `scan` job looks for stubs and sets an output `has_stubs=true|false`
+# - If stubs are found, the workflow adds label `contains-stubs` and fails an explicit job
+# - If no stubs found, the workflow adds label `ready-for-students`
+
+on:
+ pull_request:
+ branches:
+ - main
+ - 'release/*'
+
+permissions:
+ contents: read
+ issues: write
+ pull-requests: write
+
+jobs:
+ scan:
+ runs-on: ubuntu-latest
+ outputs:
+ has_stubs: ${{ steps.set-output.outputs.has_stubs }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - name: Install dependencies
+ run: python -m pip install --upgrade pip
+
+ - name: Run stub scanner
+ id: run-scan
+ run: |
+ set -euo pipefail
+ # Save output for later annotation
+ if python scripts/validate_no_stubs.py content/ > stub_report.txt 2>&1; then
+ echo "has_stubs=false" > scan_status.txt
+ echo "No stubs found"
+ else
+ echo "has_stubs=true" > scan_status.txt
+ echo "Stubs found; see stub_report.txt"
+ cat stub_report.txt
+ true
+ fi
+
+ - name: Set has_stubs output
+ id: set-output
+ run: |
+ if [ -f scan_status.txt ] && grep -q "has_stubs=true" scan_status.txt; then
+ echo "has_stubs=true" >> $GITHUB_OUTPUT
+ else
+ echo "has_stubs=false" >> $GITHUB_OUTPUT
+ fi
+
+ label_contains_stubs:
+ needs: scan
+ if: needs.scan.outputs.has_stubs == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Add contains-stubs label
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const pr = context.payload.pull_request.number
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: pr,
+ labels: ['contains-stubs']
+ })
+
+ fail_if_stubs:
+ needs: scan
+ if: needs.scan.outputs.has_stubs == 'true'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Fail due to stub content
+ run: |
+ echo "Stub content detected in PR. Blocking merge until contentStatus='humanized'."
+ exit 1
+
+ label_ready:
+ needs: scan
+ if: needs.scan.outputs.has_stubs == 'false'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Add ready-for-students label
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const pr = context.payload.pull_request.number
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: pr,
+ labels: ['ready-for-students']
+ })
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 41441d90..90d89b96 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,7 +35,8 @@ jobs:
- name: Install Python test deps
run: |
python -m pip install --upgrade pip
- pip install pytest requests urllib3 psycopg2-binary
+ pip install pytest requests urllib3 psycopg2-binary httpx aiohttp pytest-httpserver pytest-asyncio pydantic
+ pip install -e lib/ollama-python
- name: Run lint-related tests
run: |
diff --git a/.github/workflows/orchestrate-test.yml b/.github/workflows/orchestrate-test.yml
new file mode 100644
index 00000000..f899a318
--- /dev/null
+++ b/.github/workflows/orchestrate-test.yml
@@ -0,0 +1,24 @@
+name: Orchestrator tests
+
+on:
+ push:
+ branches: [ main ]
+ pull_request:
+ branches: [ main ]
+
+permissions:
+ contents: read
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.11'
+ - name: Install test deps
+ run: python -m pip install --upgrade pip pytest pytest-asyncio aiohttp
+ - name: Run tests
+ run: pytest -q
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
new file mode 100644
index 00000000..bac2c852
--- /dev/null
+++ b/.github/workflows/playwright.yml
@@ -0,0 +1,82 @@
+name: Playwright E2E
+# noop: trigger CI
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+jobs:
+ e2e:
+ permissions:
+ contents: read
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "18"
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Build
+ run: npm run build
+
+ - name: Install Playwright browsers
+ run: npx playwright install --with-deps
+
+ - name: Ensure pnpm available (corepack fallback) (before Playwright tests)
+ run: |
+ if ! command -v pnpm >/dev/null 2>&1; then
+ corepack enable
+ corepack prepare pnpm@9.15.9 --activate
+ fi
+
+ - name: Install JS dependencies with pnpm (before Playwright)
+ run: |
+ pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile || pnpm install
+
+ - name: Install catalog Storybook deps
+ run: |
+ if [ -d catalog-root ]; then
+ cd catalog-root
+ npm ci --legacy-peer-deps
+ else
+ echo "catalog-root directory not found; skipping Storybook dependency installation."
+ fi
+
+ - name: Install wait-on
+ run: npm install --no-save wait-on
+ - name: Start Storybook
+ run: |
+ if [ -d catalog-root ]; then
+ npm --prefix catalog-root run storybook &
+ npx wait-on http://localhost:6006 -t 120000
+ else
+ echo "catalog-root directory not found; skipping Storybook startup."
+ fi
+
+ - name: Run Playwright tests
+ run: npx playwright test --reporter=list
+
+ - name: Upload Playwright HTML report
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: playwright-report
+ path: playwright-report
+
+ - name: Upload Playwright artifacts
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: playwright-artifacts
+ path: |
+ playwright-report/**
+ test-results/**
+ videos/**
+ traces/**
diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml
index 54d95ffa..aa8ddfc1 100644
--- a/.github/workflows/python-ci.yml
+++ b/.github/workflows/python-ci.yml
@@ -2,9 +2,9 @@ name: Python CI
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
- branches: [ main ]
+ branches: [main]
jobs:
test:
@@ -14,11 +14,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
+ with:
+ submodules: "recursive"
+ fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c
with:
- python-version: '3.11'
+ python-version: "3.11"
- name: Cache pip
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
@@ -31,8 +34,18 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install pytest requests urllib3 psycopg2-binary
+ pip install pytest requests urllib3 psycopg2-binary aiohttp httpx pytest-httpserver pytest-asyncio pydantic
+ pip install -e lib/ollama-python
+
+ - name: Verify editable install
+ run: |
+ set -euo pipefail
+ python -c "import sys, importlib; m=importlib.import_module('ollama'); print('ollama:', getattr(m,'__file__',str(m)))"
- name: Run tests
run: |
+ set -euo pipefail
+ export PYTHONPATH="${{ github.workspace }}/lib/ollama-python:${PYTHONPATH:-}"
+ echo "PYTHONPATH=$PYTHONPATH"
+ python -c "import sys; print('python', sys.version)"
pytest -q
diff --git a/.github/workflows/python-lint-test.yml b/.github/workflows/python-lint-test.yml
index cc027171..7b216bf2 100644
--- a/.github/workflows/python-lint-test.yml
+++ b/.github/workflows/python-lint-test.yml
@@ -6,7 +6,7 @@ permissions:
on:
pull_request:
push:
- branches: [ main ]
+ branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
@@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- submodules: 'true'
+ submodules: "true"
- name: Set up Python
uses: actions/setup-python@v4
with:
- python-version: '3.11'
+ python-version: "3.11"
- name: Install ruff
run: python -m pip install ruff
- name: Run ruff
@@ -30,12 +30,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- submodules: 'true'
+ submodules: "true"
- name: Set up Python
uses: actions/setup-python@v4
with:
- python-version: '3.11'
+ python-version: "3.11"
- name: Install test deps
- run: python -m pip install pytest psycopg2-binary
+ run: python -m pip install pytest psycopg2-binary httpx aiohttp pytest-httpserver pytest-asyncio pydantic
+ - name: Install local ollama-python
+ run: python -m pip install -e lib/ollama-python
- name: Run tests
run: pytest -q
diff --git a/.github/workflows/storybook-monitor.yml b/.github/workflows/storybook-monitor.yml
index 4afabf1a..9c472bae 100644
--- a/.github/workflows/storybook-monitor.yml
+++ b/.github/workflows/storybook-monitor.yml
@@ -2,7 +2,8 @@ name: Storybook Monitor
on:
schedule:
- - cron: '*/5 * * * *'
+ # Run every 15 minutes to reduce overlap and API load
+ - cron: '*/15 * * * *'
workflow_dispatch: {}
permissions:
@@ -13,6 +14,9 @@ permissions:
jobs:
monitor:
runs-on: ubuntu-latest
+ concurrency:
+ group: storybook-monitor
+ cancel-in-progress: true
steps:
- name: Check published Storybook site
id: check-site
@@ -29,33 +33,53 @@ jobs:
uses: actions/github-script@v6
with:
script: |
- const siteOk = process.env.SITE_OK === 'true';
- const owner = context.repo.owner;
- const repo = context.repo.repo;
- const workflowFile = 'storybook.yml';
+ try {
+ const siteOk = process.env.SITE_OK === 'true';
+ const owner = context.repo.owner;
+ const repo = context.repo.repo;
+ const workflowFile = 'storybook.yml';
- // Get the latest run for the Storybook workflow
- const runs = await github.rest.actions.listWorkflowRunsForRepo({ owner, repo, workflow_id: workflowFile, per_page: 1 });
- const last = runs.data.workflow_runs && runs.data.workflow_runs[0];
- const runOk = last && last.conclusion === 'success' && (Date.now() - new Date(last.updated_at).getTime() < 1000 * 60 * 60);
+ // Get the latest run for the Storybook workflow
+ const runs = await github.rest.actions.listWorkflowRunsForRepo({ owner, repo, workflow_id: workflowFile, per_page: 1 });
+ const last = runs.data.workflow_runs && runs.data.workflow_runs[0];
+ const runOk = last && last.conclusion === 'success' && (Date.now() - new Date(last.updated_at).getTime() < 1000 * 60 * 60);
- const issueTitle = 'storybook-monitor: failing Storybook';
- if (siteOk && runOk) {
- // If healthy, close any existing monitor issue
- const issues = await github.rest.issues.listForRepo({ owner, repo, state: 'open', per_page: 100 });
- const existing = issues.data.find(i => i.title === issueTitle);
- if (existing) {
- await github.rest.issues.update({ owner, repo, issue_number: existing.number, state: 'closed' });
- }
- console.log('Storybook healthy: site OK and last run successful');
- } else {
- const body = `Storybook monitor detected issues.\n\nsiteOk=${siteOk}\nlastRunOk=${runOk}\nlastRun=${last ? last.html_url : 'none'}\ncheckedAt=${new Date().toISOString()}`;
- const issues = await github.rest.issues.listForRepo({ owner, repo, state: 'open', per_page: 100 });
- const existing = issues.data.find(i => i.title === issueTitle);
- if (existing) {
- await github.rest.issues.createComment({ owner, repo, issue_number: existing.number, body });
- } else {
- await github.rest.issues.create({ owner, repo, title: issueTitle, body, labels: ['automation', 'storybook-monitor'] });
- }
- console.log('Storybook or workflow run failing — issue created/updated');
- }
\ No newline at end of file
+ const issueTitle = 'storybook-monitor: failing Storybook';
+ if (siteOk && runOk) {
+ // If healthy, close any existing monitor issue
+ const issues = await github.rest.issues.listForRepo({ owner, repo, state: 'open', per_page: 100 });
+ const existing = issues.data.find(i => i.title === issueTitle);
+ if (existing) {
+ await github.rest.issues.update({ owner, repo, issue_number: existing.number, state: 'closed' });
+ }
+ console.log('Storybook healthy: site OK and last run successful');
+ } else {
+ const body = `Storybook monitor detected issues.\n\nsiteOk=${siteOk}\nlastRunOk=${runOk}\nlastRun=${last ? last.html_url : 'none'}\ncheckedAt=${new Date().toISOString()}`;
+ const issues = await github.rest.issues.listForRepo({ owner, repo, state: 'open', per_page: 100 });
+ const existing = issues.data.find(i => i.title === issueTitle);
+ if (existing) {
+ await github.rest.issues.createComment({ owner, repo, issue_number: existing.number, body });
+ } else {
+ await github.rest.issues.create({ owner, repo, title: issueTitle, body, labels: ['automation', 'storybook-monitor'] });
+ }
+ console.log('Storybook or workflow run failing — issue created/updated');
+ }
+ } catch (err) {
+ // Never allow the monitor to crash the workflow; report the monitor error as an issue
+ try {
+ const owner = context.repo.owner;
+ const repo = context.repo.repo;
+ const issueTitle = 'storybook-monitor: monitor error';
+ const body = `Storybook monitor script failed with error:\n\n${err && err.stack ? err.stack : String(err)}\ncheckedAt=${new Date().toISOString()}`;
+ const issues = await github.rest.issues.listForRepo({ owner, repo, state: 'open', per_page: 100 });
+ const existing = issues.data.find(i => i.title === issueTitle);
+ if (existing) {
+ await github.rest.issues.createComment({ owner, repo, issue_number: existing.number, body });
+ } else {
+ await github.rest.issues.create({ owner, repo, title: issueTitle, body, labels: ['automation', 'storybook-monitor'] });
+ }
+ console.error('Monitor script error reported to issues:', err);
+ } catch (innerErr) {
+ console.error('Failed to report monitor error:', innerErr, err);
+ }
+ }
\ No newline at end of file
diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml
index 6307f9c7..32d7c693 100644
--- a/.github/workflows/storybook.yml
+++ b/.github/workflows/storybook.yml
@@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- submodules: 'false'
+ submodules: "false"
- name: Ensure pnpm available (corepack fallback)
run: |
@@ -37,12 +37,48 @@ jobs:
node-version: 20
cache: pnpm
+ - name: CI monitor: verify Node and pnpm
+ run: |
+ set -euo pipefail
+ echo "node: $(node -v)"
+ NODE_MAJOR=$(node -v | sed -E 's/^v([0-9]+).*/\1/')
+ if [ "${NODE_MAJOR}" -lt 20 ]; then
+ echo "Unsupported Node major version: ${NODE_MAJOR}. Require Node 20+."
+ exit 1
+ fi
+ if ! command -v pnpm >/dev/null 2>&1; then
+ echo "pnpm not found, attempting corepack fallback"
+ corepack enable || true
+ corepack prepare pnpm@9.15.9 --activate || true
+ fi
+ if ! command -v pnpm >/dev/null 2>&1; then
+ echo "pnpm still not available. Failing CI early."
+ exit 1
+ fi
+ pnpm --version
+
- name: Install dependencies (ui)
working-directory: packages/ui
run: |
+ set -euo pipefail
+ echo "Cleaning previous install and pnpm store"
rm -rf node_modules
- pnpm store prune || true
- pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile || pnpm install
+ pnpm store prune || echo "pnpm store prune failed, continuing..."
+ echo "Installing dependencies with retries (with lockfile fallbacks)"
+ success=0
+ for i in 1 2 3; do
+ if pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile || pnpm install; then
+ success=1
+ break
+ else
+ echo "pnpm install failed (attempt $i)"
+ sleep $((i * 5))
+ fi
+ done
+ if [ "$success" -ne 1 ]; then
+ echo "pnpm install failed after 3 attempts"
+ exit 1
+ fi
- name: Build Storybook (ui)
working-directory: packages/ui
@@ -73,6 +109,20 @@ jobs:
run: |
npx playwright install --with-deps
+ - name: Ensure pnpm available (corepack fallback) (before Playwright tests)
+ working-directory: packages/ui
+ run: |
+ if ! command -v pnpm >/dev/null 2>&1; then
+ corepack enable
+ corepack prepare pnpm@9.15.9 --activate
+ fi
+
+ - name: Install UI deps (pnpm, before Playwright)
+ working-directory: packages/ui
+ run: |
+ set -euo pipefail
+ pnpm install --frozen-lockfile || pnpm install --no-frozen-lockfile || pnpm install
+
- name: Run accessibility tests with Playwright
working-directory: packages/ui
run: |
@@ -119,4 +169,3 @@ jobs:
name: storybook-static
path: packages/ui/storybook-static
retention-days: 30
-
diff --git a/.venv3.10/Lib/_bootsubprocess.py b/.venv3.10/Lib/_bootsubprocess.py
index 014782f6..cf002a0e 100644
--- a/.venv3.10/Lib/_bootsubprocess.py
+++ b/.venv3.10/Lib/_bootsubprocess.py
@@ -40,7 +40,7 @@ def _check_cmd(cmd):
for ch in range(ord(first), ord(last) + 1):
safe_chars.append(chr(ch))
safe_chars.append("./-")
- safe_chars = ''.join(safe_chars)
+ safe_chars = "".join(safe_chars)
if isinstance(cmd, (tuple, list)):
check_strs = cmd
@@ -87,7 +87,7 @@ def check_output(cmd, **kwargs):
with open(tmp_filename, "rb") as fp:
stdout = fp.read()
except FileNotFoundError:
- stdout = b''
+ stdout = b""
finally:
try:
os.unlink(tmp_filename)
diff --git a/.venv3.10/Lib/_collections_abc.py b/.venv3.10/Lib/_collections_abc.py
index 72fd633c..340adf26 100644
--- a/.venv3.10/Lib/_collections_abc.py
+++ b/.venv3.10/Lib/_collections_abc.py
@@ -39,7 +39,7 @@ def _f(): pass
# Note: in other implementations, these types might not be distinct
# and they may have their own implementation specific types that
# are not included on this list.
-bytes_iterator = type(iter(b''))
+bytes_iterator = type(iter(b""))
bytearray_iterator = type(iter(bytearray()))
#callable_iterator = ???
dict_keyiterator = type(iter({}.keys()))
@@ -156,7 +156,7 @@ def close(self):
@classmethod
def __subclasshook__(cls, C):
if cls is Coroutine:
- return _check_methods(C, '__await__', 'send', 'throw', 'close')
+ return _check_methods(C, "__await__", "send", "throw", "close")
return NotImplemented
@@ -242,8 +242,8 @@ async def aclose(self):
@classmethod
def __subclasshook__(cls, C):
if cls is AsyncGenerator:
- return _check_methods(C, '__aiter__', '__anext__',
- 'asend', 'athrow', 'aclose')
+ return _check_methods(C, "__aiter__", "__anext__",
+ "asend", "athrow", "aclose")
return NotImplemented
@@ -274,7 +274,7 @@ class Iterator(Iterable):
@abstractmethod
def __next__(self):
- 'Return the next item from the iterator. When exhausted, raise StopIteration'
+ "Return the next item from the iterator. When exhausted, raise StopIteration"
raise StopIteration
def __iter__(self):
@@ -283,7 +283,7 @@ def __iter__(self):
@classmethod
def __subclasshook__(cls, C):
if cls is Iterator:
- return _check_methods(C, '__iter__', '__next__')
+ return _check_methods(C, "__iter__", "__next__")
return NotImplemented
@@ -362,8 +362,8 @@ def close(self):
@classmethod
def __subclasshook__(cls, C):
if cls is Generator:
- return _check_methods(C, '__iter__', '__next__',
- 'send', 'throw', 'close')
+ return _check_methods(C, "__iter__", "__next__",
+ "send", "throw", "close")
return NotImplemented
@@ -474,7 +474,7 @@ def __getitem__(self, item):
# then X[int, str] == X[[int, str]].
param_len = len(self.__parameters__)
if param_len == 0:
- raise TypeError(f'{self} is not a generic class')
+ raise TypeError(f"{self} is not a generic class")
if not isinstance(item, tuple):
item = (item,)
if (param_len == 1 and _is_param_expr(self.__parameters__[0])
@@ -500,7 +500,7 @@ def __getitem__(self, item):
else:
arg = subst[arg]
# Looks like a GenericAlias
- elif hasattr(arg, '__parameters__') and isinstance(arg.__parameters__, tuple):
+ elif hasattr(arg, "__parameters__") and isinstance(arg.__parameters__, tuple):
subparams = arg.__parameters__
if subparams:
subargs = tuple(subst[x] for x in subparams)
@@ -521,8 +521,8 @@ def __getitem__(self, item):
def _is_typevarlike(arg):
obj = type(arg)
# looks like a TypeVar/ParamSpec
- return (obj.__module__ == 'typing'
- and obj.__name__ in {'ParamSpec', 'TypeVar'})
+ return (obj.__module__ == "typing"
+ and obj.__name__ in {"ParamSpec", "TypeVar"})
def _is_param_expr(obj):
"""Checks if obj matches either a list of types, ``...``, ``ParamSpec`` or
@@ -533,8 +533,8 @@ def _is_param_expr(obj):
if isinstance(obj, list):
return True
obj = type(obj)
- names = ('ParamSpec', '_ConcatenateGenericAlias')
- return obj.__module__ == 'typing' and any(obj.__name__ == name for name in names)
+ names = ("ParamSpec", "_ConcatenateGenericAlias")
+ return obj.__module__ == "typing" and any(obj.__name__ == name for name in names)
def _type_repr(obj):
"""Return the repr() of an object, special-casing types (internal helper).
@@ -545,11 +545,11 @@ def _type_repr(obj):
if isinstance(obj, GenericAlias):
return repr(obj)
if isinstance(obj, type):
- if obj.__module__ == 'builtins':
+ if obj.__module__ == "builtins":
return obj.__qualname__
- return f'{obj.__module__}.{obj.__qualname__}'
+ return f"{obj.__module__}.{obj.__qualname__}"
if obj is Ellipsis:
- return '...'
+ return "..."
if isinstance(obj, FunctionType):
return obj.__name__
return repr(obj)
@@ -625,11 +625,11 @@ def __eq__(self, other):
@classmethod
def _from_iterable(cls, it):
- '''Construct an instance of the class from any iterable input.
+ """Construct an instance of the class from any iterable input.
Must override this method if the class constructor signature
does not accept an iterable for an input.
- '''
+ """
return cls(it)
def __and__(self, other):
@@ -640,7 +640,7 @@ def __and__(self, other):
__rand__ = __and__
def isdisjoint(self, other):
- 'Return True if two sets have a null intersection.'
+ "Return True if two sets have a null intersection."
for value in other:
if value in self:
return False
@@ -819,7 +819,7 @@ def __getitem__(self, key):
raise KeyError
def get(self, key, default=None):
- 'D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.'
+ "D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None."
try:
return self[key]
except KeyError:
@@ -857,7 +857,7 @@ def __eq__(self, other):
class MappingView(Sized):
- __slots__ = '_mapping',
+ __slots__ = "_mapping",
def __init__(self, mapping):
self._mapping = mapping
@@ -866,7 +866,7 @@ def __len__(self):
return len(self._mapping)
def __repr__(self):
- return '{0.__class__.__name__}({0._mapping!r})'.format(self)
+ return "{0.__class__.__name__}({0._mapping!r})".format(self)
__class_getitem__ = classmethod(GenericAlias)
@@ -955,9 +955,9 @@ def __delitem__(self, key):
__marker = object()
def pop(self, key, default=__marker):
- '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
+ """D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
- '''
+ """
try:
value = self[key]
except KeyError:
@@ -969,9 +969,9 @@ def pop(self, key, default=__marker):
return value
def popitem(self):
- '''D.popitem() -> (k, v), remove and return some (key, value) pair
+ """D.popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
- '''
+ """
try:
key = next(iter(self))
except StopIteration:
@@ -981,7 +981,7 @@ def popitem(self):
return key, value
def clear(self):
- 'D.clear() -> None. Remove all items from D.'
+ "D.clear() -> None. Remove all items from D."
try:
while True:
self.popitem()
@@ -989,11 +989,11 @@ def clear(self):
pass
def update(self, other=(), /, **kwds):
- ''' D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
+ """ D.update([E, ]**F) -> None. Update D from mapping/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v
- '''
+ """
if isinstance(other, Mapping):
for key in other:
self[key] = other[key]
@@ -1007,7 +1007,7 @@ def update(self, other=(), /, **kwds):
self[key] = value
def setdefault(self, key, default=None):
- 'D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D'
+ "D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D"
try:
return self[key]
except KeyError:
@@ -1057,12 +1057,12 @@ def __reversed__(self):
yield self[i]
def index(self, value, start=0, stop=None):
- '''S.index(value, [start, [stop]]) -> integer -- return first index of value.
+ """S.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but
recommended.
- '''
+ """
if start is not None and start < 0:
start = max(len(self) + start, 0)
if stop is not None and stop < 0:
@@ -1080,7 +1080,7 @@ def index(self, value, start=0, stop=None):
raise ValueError
def count(self, value):
- 'S.count(value) -> integer -- return number of occurrences of value'
+ "S.count(value) -> integer -- return number of occurrences of value"
return sum(1 for v in self if v is value or v == value)
Sequence.register(tuple)
@@ -1120,15 +1120,15 @@ def __delitem__(self, index):
@abstractmethod
def insert(self, index, value):
- 'S.insert(index, value) -- insert value before index'
+ "S.insert(index, value) -- insert value before index"
raise IndexError
def append(self, value):
- 'S.append(value) -- append value to the end of the sequence'
+ "S.append(value) -- append value to the end of the sequence"
self.insert(len(self), value)
def clear(self):
- 'S.clear() -> None -- remove all items from S'
+ "S.clear() -> None -- remove all items from S"
try:
while True:
self.pop()
@@ -1136,30 +1136,30 @@ def clear(self):
pass
def reverse(self):
- 'S.reverse() -- reverse *IN PLACE*'
+ "S.reverse() -- reverse *IN PLACE*"
n = len(self)
for i in range(n//2):
self[i], self[n-i-1] = self[n-i-1], self[i]
def extend(self, values):
- 'S.extend(iterable) -- extend sequence by appending elements from the iterable'
+ "S.extend(iterable) -- extend sequence by appending elements from the iterable"
if values is self:
values = list(values)
for v in values:
self.append(v)
def pop(self, index=-1):
- '''S.pop([index]) -> item -- remove and return item at index (default last).
+ """S.pop([index]) -> item -- remove and return item at index (default last).
Raise IndexError if list is empty or index is out of range.
- '''
+ """
v = self[index]
del self[index]
return v
def remove(self, value):
- '''S.remove(value) -- remove first occurrence of value.
+ """S.remove(value) -- remove first occurrence of value.
Raise ValueError if the value is not present.
- '''
+ """
del self[self.index(value)]
def __iadd__(self, values):
diff --git a/.venv3.10/Lib/_compat_pickle.py b/.venv3.10/Lib/_compat_pickle.py
index f68496ae..da6b8d1d 100644
--- a/.venv3.10/Lib/_compat_pickle.py
+++ b/.venv3.10/Lib/_compat_pickle.py
@@ -6,48 +6,48 @@
# lib2to3 and use the mapping defined there, because lib2to3 uses pickle.
# Thus, this could cause the module to be imported recursively.
IMPORT_MAPPING = {
- '__builtin__' : 'builtins',
- 'copy_reg': 'copyreg',
- 'Queue': 'queue',
- 'SocketServer': 'socketserver',
- 'ConfigParser': 'configparser',
- 'repr': 'reprlib',
- 'tkFileDialog': 'tkinter.filedialog',
- 'tkSimpleDialog': 'tkinter.simpledialog',
- 'tkColorChooser': 'tkinter.colorchooser',
- 'tkCommonDialog': 'tkinter.commondialog',
- 'Dialog': 'tkinter.dialog',
- 'Tkdnd': 'tkinter.dnd',
- 'tkFont': 'tkinter.font',
- 'tkMessageBox': 'tkinter.messagebox',
- 'ScrolledText': 'tkinter.scrolledtext',
- 'Tkconstants': 'tkinter.constants',
- 'Tix': 'tkinter.tix',
- 'ttk': 'tkinter.ttk',
- 'Tkinter': 'tkinter',
- 'markupbase': '_markupbase',
- '_winreg': 'winreg',
- 'thread': '_thread',
- 'dummy_thread': '_dummy_thread',
- 'dbhash': 'dbm.bsd',
- 'dumbdbm': 'dbm.dumb',
- 'dbm': 'dbm.ndbm',
- 'gdbm': 'dbm.gnu',
- 'xmlrpclib': 'xmlrpc.client',
- 'SimpleXMLRPCServer': 'xmlrpc.server',
- 'httplib': 'http.client',
- 'htmlentitydefs' : 'html.entities',
- 'HTMLParser' : 'html.parser',
- 'Cookie': 'http.cookies',
- 'cookielib': 'http.cookiejar',
- 'BaseHTTPServer': 'http.server',
- 'test.test_support': 'test.support',
- 'commands': 'subprocess',
- 'urlparse' : 'urllib.parse',
- 'robotparser' : 'urllib.robotparser',
- 'urllib2': 'urllib.request',
- 'anydbm': 'dbm',
- '_abcoll' : 'collections.abc',
+ "__builtin__" : "builtins",
+ "copy_reg": "copyreg",
+ "Queue": "queue",
+ "SocketServer": "socketserver",
+ "ConfigParser": "configparser",
+ "repr": "reprlib",
+ "tkFileDialog": "tkinter.filedialog",
+ "tkSimpleDialog": "tkinter.simpledialog",
+ "tkColorChooser": "tkinter.colorchooser",
+ "tkCommonDialog": "tkinter.commondialog",
+ "Dialog": "tkinter.dialog",
+ "Tkdnd": "tkinter.dnd",
+ "tkFont": "tkinter.font",
+ "tkMessageBox": "tkinter.messagebox",
+ "ScrolledText": "tkinter.scrolledtext",
+ "Tkconstants": "tkinter.constants",
+ "Tix": "tkinter.tix",
+ "ttk": "tkinter.ttk",
+ "Tkinter": "tkinter",
+ "markupbase": "_markupbase",
+ "_winreg": "winreg",
+ "thread": "_thread",
+ "dummy_thread": "_dummy_thread",
+ "dbhash": "dbm.bsd",
+ "dumbdbm": "dbm.dumb",
+ "dbm": "dbm.ndbm",
+ "gdbm": "dbm.gnu",
+ "xmlrpclib": "xmlrpc.client",
+ "SimpleXMLRPCServer": "xmlrpc.server",
+ "httplib": "http.client",
+ "htmlentitydefs" : "html.entities",
+ "HTMLParser" : "html.parser",
+ "Cookie": "http.cookies",
+ "cookielib": "http.cookiejar",
+ "BaseHTTPServer": "http.server",
+ "test.test_support": "test.support",
+ "commands": "subprocess",
+ "urlparse" : "urllib.parse",
+ "robotparser" : "urllib.robotparser",
+ "urllib2": "urllib.request",
+ "anydbm": "dbm",
+ "_abcoll" : "collections.abc",
}
@@ -55,39 +55,39 @@
# complex stuff (e.g. mapping the names in the urllib and types modules).
# These rules should be run before import names are fixed.
NAME_MAPPING = {
- ('__builtin__', 'xrange'): ('builtins', 'range'),
- ('__builtin__', 'reduce'): ('functools', 'reduce'),
- ('__builtin__', 'intern'): ('sys', 'intern'),
- ('__builtin__', 'unichr'): ('builtins', 'chr'),
- ('__builtin__', 'unicode'): ('builtins', 'str'),
- ('__builtin__', 'long'): ('builtins', 'int'),
- ('itertools', 'izip'): ('builtins', 'zip'),
- ('itertools', 'imap'): ('builtins', 'map'),
- ('itertools', 'ifilter'): ('builtins', 'filter'),
- ('itertools', 'ifilterfalse'): ('itertools', 'filterfalse'),
- ('itertools', 'izip_longest'): ('itertools', 'zip_longest'),
- ('UserDict', 'IterableUserDict'): ('collections', 'UserDict'),
- ('UserList', 'UserList'): ('collections', 'UserList'),
- ('UserString', 'UserString'): ('collections', 'UserString'),
- ('whichdb', 'whichdb'): ('dbm', 'whichdb'),
- ('_socket', 'fromfd'): ('socket', 'fromfd'),
- ('_multiprocessing', 'Connection'): ('multiprocessing.connection', 'Connection'),
- ('multiprocessing.process', 'Process'): ('multiprocessing.context', 'Process'),
- ('multiprocessing.forking', 'Popen'): ('multiprocessing.popen_fork', 'Popen'),
- ('urllib', 'ContentTooShortError'): ('urllib.error', 'ContentTooShortError'),
- ('urllib', 'getproxies'): ('urllib.request', 'getproxies'),
- ('urllib', 'pathname2url'): ('urllib.request', 'pathname2url'),
- ('urllib', 'quote_plus'): ('urllib.parse', 'quote_plus'),
- ('urllib', 'quote'): ('urllib.parse', 'quote'),
- ('urllib', 'unquote_plus'): ('urllib.parse', 'unquote_plus'),
- ('urllib', 'unquote'): ('urllib.parse', 'unquote'),
- ('urllib', 'url2pathname'): ('urllib.request', 'url2pathname'),
- ('urllib', 'urlcleanup'): ('urllib.request', 'urlcleanup'),
- ('urllib', 'urlencode'): ('urllib.parse', 'urlencode'),
- ('urllib', 'urlopen'): ('urllib.request', 'urlopen'),
- ('urllib', 'urlretrieve'): ('urllib.request', 'urlretrieve'),
- ('urllib2', 'HTTPError'): ('urllib.error', 'HTTPError'),
- ('urllib2', 'URLError'): ('urllib.error', 'URLError'),
+ ("__builtin__", "xrange"): ("builtins", "range"),
+ ("__builtin__", "reduce"): ("functools", "reduce"),
+ ("__builtin__", "intern"): ("sys", "intern"),
+ ("__builtin__", "unichr"): ("builtins", "chr"),
+ ("__builtin__", "unicode"): ("builtins", "str"),
+ ("__builtin__", "long"): ("builtins", "int"),
+ ("itertools", "izip"): ("builtins", "zip"),
+ ("itertools", "imap"): ("builtins", "map"),
+ ("itertools", "ifilter"): ("builtins", "filter"),
+ ("itertools", "ifilterfalse"): ("itertools", "filterfalse"),
+ ("itertools", "izip_longest"): ("itertools", "zip_longest"),
+ ("UserDict", "IterableUserDict"): ("collections", "UserDict"),
+ ("UserList", "UserList"): ("collections", "UserList"),
+ ("UserString", "UserString"): ("collections", "UserString"),
+ ("whichdb", "whichdb"): ("dbm", "whichdb"),
+ ("_socket", "fromfd"): ("socket", "fromfd"),
+ ("_multiprocessing", "Connection"): ("multiprocessing.connection", "Connection"),
+ ("multiprocessing.process", "Process"): ("multiprocessing.context", "Process"),
+ ("multiprocessing.forking", "Popen"): ("multiprocessing.popen_fork", "Popen"),
+ ("urllib", "ContentTooShortError"): ("urllib.error", "ContentTooShortError"),
+ ("urllib", "getproxies"): ("urllib.request", "getproxies"),
+ ("urllib", "pathname2url"): ("urllib.request", "pathname2url"),
+ ("urllib", "quote_plus"): ("urllib.parse", "quote_plus"),
+ ("urllib", "quote"): ("urllib.parse", "quote"),
+ ("urllib", "unquote_plus"): ("urllib.parse", "unquote_plus"),
+ ("urllib", "unquote"): ("urllib.parse", "unquote"),
+ ("urllib", "url2pathname"): ("urllib.request", "url2pathname"),
+ ("urllib", "urlcleanup"): ("urllib.request", "urlcleanup"),
+ ("urllib", "urlencode"): ("urllib.parse", "urlencode"),
+ ("urllib", "urlopen"): ("urllib.request", "urlopen"),
+ ("urllib", "urlretrieve"): ("urllib.request", "urlretrieve"),
+ ("urllib2", "HTTPError"): ("urllib.error", "HTTPError"),
+ ("urllib2", "URLError"): ("urllib.error", "URLError"),
}
PYTHON2_EXCEPTIONS = (
@@ -152,10 +152,10 @@
NAME_MAPPING[("exceptions", excname)] = ("builtins", excname)
MULTIPROCESSING_EXCEPTIONS = (
- 'AuthenticationError',
- 'BufferTooShort',
- 'ProcessError',
- 'TimeoutError',
+ "AuthenticationError",
+ "BufferTooShort",
+ "ProcessError",
+ "TimeoutError",
)
for excname in MULTIPROCESSING_EXCEPTIONS:
@@ -170,82 +170,82 @@
# Non-mutual mappings.
IMPORT_MAPPING.update({
- 'cPickle': 'pickle',
- '_elementtree': 'xml.etree.ElementTree',
- 'FileDialog': 'tkinter.filedialog',
- 'SimpleDialog': 'tkinter.simpledialog',
- 'DocXMLRPCServer': 'xmlrpc.server',
- 'SimpleHTTPServer': 'http.server',
- 'CGIHTTPServer': 'http.server',
+ "cPickle": "pickle",
+ "_elementtree": "xml.etree.ElementTree",
+ "FileDialog": "tkinter.filedialog",
+ "SimpleDialog": "tkinter.simpledialog",
+ "DocXMLRPCServer": "xmlrpc.server",
+ "SimpleHTTPServer": "http.server",
+ "CGIHTTPServer": "http.server",
# For compatibility with broken pickles saved in old Python 3 versions
- 'UserDict': 'collections',
- 'UserList': 'collections',
- 'UserString': 'collections',
- 'whichdb': 'dbm',
- 'StringIO': 'io',
- 'cStringIO': 'io',
+ "UserDict": "collections",
+ "UserList": "collections",
+ "UserString": "collections",
+ "whichdb": "dbm",
+ "StringIO": "io",
+ "cStringIO": "io",
})
REVERSE_IMPORT_MAPPING.update({
- '_bz2': 'bz2',
- '_dbm': 'dbm',
- '_functools': 'functools',
- '_gdbm': 'gdbm',
- '_pickle': 'pickle',
+ "_bz2": "bz2",
+ "_dbm": "dbm",
+ "_functools": "functools",
+ "_gdbm": "gdbm",
+ "_pickle": "pickle",
})
NAME_MAPPING.update({
- ('__builtin__', 'basestring'): ('builtins', 'str'),
- ('exceptions', 'StandardError'): ('builtins', 'Exception'),
- ('UserDict', 'UserDict'): ('collections', 'UserDict'),
- ('socket', '_socketobject'): ('socket', 'SocketType'),
+ ("__builtin__", "basestring"): ("builtins", "str"),
+ ("exceptions", "StandardError"): ("builtins", "Exception"),
+ ("UserDict", "UserDict"): ("collections", "UserDict"),
+ ("socket", "_socketobject"): ("socket", "SocketType"),
})
REVERSE_NAME_MAPPING.update({
- ('_functools', 'reduce'): ('__builtin__', 'reduce'),
- ('tkinter.filedialog', 'FileDialog'): ('FileDialog', 'FileDialog'),
- ('tkinter.filedialog', 'LoadFileDialog'): ('FileDialog', 'LoadFileDialog'),
- ('tkinter.filedialog', 'SaveFileDialog'): ('FileDialog', 'SaveFileDialog'),
- ('tkinter.simpledialog', 'SimpleDialog'): ('SimpleDialog', 'SimpleDialog'),
- ('xmlrpc.server', 'ServerHTMLDoc'): ('DocXMLRPCServer', 'ServerHTMLDoc'),
- ('xmlrpc.server', 'XMLRPCDocGenerator'):
- ('DocXMLRPCServer', 'XMLRPCDocGenerator'),
- ('xmlrpc.server', 'DocXMLRPCRequestHandler'):
- ('DocXMLRPCServer', 'DocXMLRPCRequestHandler'),
- ('xmlrpc.server', 'DocXMLRPCServer'):
- ('DocXMLRPCServer', 'DocXMLRPCServer'),
- ('xmlrpc.server', 'DocCGIXMLRPCRequestHandler'):
- ('DocXMLRPCServer', 'DocCGIXMLRPCRequestHandler'),
- ('http.server', 'SimpleHTTPRequestHandler'):
- ('SimpleHTTPServer', 'SimpleHTTPRequestHandler'),
- ('http.server', 'CGIHTTPRequestHandler'):
- ('CGIHTTPServer', 'CGIHTTPRequestHandler'),
- ('_socket', 'socket'): ('socket', '_socketobject'),
+ ("_functools", "reduce"): ("__builtin__", "reduce"),
+ ("tkinter.filedialog", "FileDialog"): ("FileDialog", "FileDialog"),
+ ("tkinter.filedialog", "LoadFileDialog"): ("FileDialog", "LoadFileDialog"),
+ ("tkinter.filedialog", "SaveFileDialog"): ("FileDialog", "SaveFileDialog"),
+ ("tkinter.simpledialog", "SimpleDialog"): ("SimpleDialog", "SimpleDialog"),
+ ("xmlrpc.server", "ServerHTMLDoc"): ("DocXMLRPCServer", "ServerHTMLDoc"),
+ ("xmlrpc.server", "XMLRPCDocGenerator"):
+ ("DocXMLRPCServer", "XMLRPCDocGenerator"),
+ ("xmlrpc.server", "DocXMLRPCRequestHandler"):
+ ("DocXMLRPCServer", "DocXMLRPCRequestHandler"),
+ ("xmlrpc.server", "DocXMLRPCServer"):
+ ("DocXMLRPCServer", "DocXMLRPCServer"),
+ ("xmlrpc.server", "DocCGIXMLRPCRequestHandler"):
+ ("DocXMLRPCServer", "DocCGIXMLRPCRequestHandler"),
+ ("http.server", "SimpleHTTPRequestHandler"):
+ ("SimpleHTTPServer", "SimpleHTTPRequestHandler"),
+ ("http.server", "CGIHTTPRequestHandler"):
+ ("CGIHTTPServer", "CGIHTTPRequestHandler"),
+ ("_socket", "socket"): ("socket", "_socketobject"),
})
PYTHON3_OSERROR_EXCEPTIONS = (
- 'BrokenPipeError',
- 'ChildProcessError',
- 'ConnectionAbortedError',
- 'ConnectionError',
- 'ConnectionRefusedError',
- 'ConnectionResetError',
- 'FileExistsError',
- 'FileNotFoundError',
- 'InterruptedError',
- 'IsADirectoryError',
- 'NotADirectoryError',
- 'PermissionError',
- 'ProcessLookupError',
- 'TimeoutError',
+ "BrokenPipeError",
+ "ChildProcessError",
+ "ConnectionAbortedError",
+ "ConnectionError",
+ "ConnectionRefusedError",
+ "ConnectionResetError",
+ "FileExistsError",
+ "FileNotFoundError",
+ "InterruptedError",
+ "IsADirectoryError",
+ "NotADirectoryError",
+ "PermissionError",
+ "ProcessLookupError",
+ "TimeoutError",
)
for excname in PYTHON3_OSERROR_EXCEPTIONS:
- REVERSE_NAME_MAPPING[('builtins', excname)] = ('exceptions', 'OSError')
+ REVERSE_NAME_MAPPING[("builtins", excname)] = ("exceptions", "OSError")
PYTHON3_IMPORTERROR_EXCEPTIONS = (
- 'ModuleNotFoundError',
+ "ModuleNotFoundError",
)
for excname in PYTHON3_IMPORTERROR_EXCEPTIONS:
- REVERSE_NAME_MAPPING[('builtins', excname)] = ('exceptions', 'ImportError')
+ REVERSE_NAME_MAPPING[("builtins", excname)] = ("exceptions", "ImportError")
diff --git a/.venv3.10/Lib/_markupbase.py b/.venv3.10/Lib/_markupbase.py
index 3ad7e279..f6298b1c 100644
--- a/.venv3.10/Lib/_markupbase.py
+++ b/.venv3.10/Lib/_markupbase.py
@@ -7,15 +7,15 @@
import re
-_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
+_declname_match = re.compile(r"[a-zA-Z][-_.a-zA-Z0-9]*\s*").match
_declstringlit_match = re.compile(r'(\'[^\']*\'|"[^"]*")\s*').match
-_commentclose = re.compile(r'--\s*>')
-_markedsectionclose = re.compile(r']\s*]\s*>')
+_commentclose = re.compile(r"--\s*>")
+_markedsectionclose = re.compile(r"]\s*]\s*>")
# An analysis of the MS-Word extensions is available at
# http://www.planetpublish.com/xmlarena/xap/Thursday/WordtoXML.pdf
-_msmarkedsectionclose = re.compile(r']\s*>')
+_msmarkedsectionclose = re.compile(r"]\s*>")
del re
@@ -54,7 +54,7 @@ def updatepos(self, i, j):
self.offset = self.offset + j-i
return j
- _decl_otherchars = ''
+ _decl_otherchars = ""
# Internal -- parse declaration (for use by subclasses).
def parse_declaration(self, i):
@@ -80,10 +80,10 @@ def parse_declaration(self, i):
return -1
# A simple, practical version could look like: ((name|stringlit) S*) + '>'
n = len(rawdata)
- if rawdata[j:j+2] == '--': #comment
+ if rawdata[j:j+2] == "--": #comment
# Locate --.*-- as the body of the comment
return self.parse_comment(i)
- elif rawdata[j] == '[': #marked section
+ elif rawdata[j] == "[": #marked section
# Locate [statusWord [...arbitrary SGML...]] as the body of the marked section
# Where statusWord is one of TEMP, CDATA, IGNORE, INCLUDE, RCDATA
# Note that this is extended by Microsoft Office "Save as Web" function
@@ -94,7 +94,7 @@ def parse_declaration(self, i):
if j < 0:
return j
if decltype == "doctype":
- self._decl_otherchars = ''
+ self._decl_otherchars = ""
while j < n:
c = rawdata[j]
if c == ">":
@@ -140,7 +140,7 @@ def parse_declaration(self, i):
# Override this to handle MS-word extension syntax content
def parse_marked_section(self, i, report=1):
rawdata= self.rawdata
- assert rawdata[i:i+3] == ''
rawdata = self.rawdata
- if '>' in rawdata[j:]:
+ if ">" in rawdata[j:]:
return rawdata.find(">", j) + 1
return -1
@@ -309,7 +309,7 @@ def _parse_doctype_attlist(self, i, declstartpos):
c = rawdata[j:j+1]
if not c:
return -1
- if c == '>':
+ if c == ">":
# all done
return j + 1
@@ -324,7 +324,7 @@ def _parse_doctype_notation(self, i, declstartpos):
if not c:
# end of buffer; incomplete
return -1
- if c == '>':
+ if c == ">":
return j + 1
if c in "'\"":
m = _declstringlit_match(rawdata, j)
diff --git a/.venv3.10/Lib/_osx_support.py b/.venv3.10/Lib/_osx_support.py
index aa66c8b9..22d7eb10 100644
--- a/.venv3.10/Lib/_osx_support.py
+++ b/.venv3.10/Lib/_osx_support.py
@@ -5,25 +5,25 @@
import sys
__all__ = [
- 'compiler_fixup',
- 'customize_config_vars',
- 'customize_compiler',
- 'get_platform_osx',
+ "compiler_fixup",
+ "customize_config_vars",
+ "customize_compiler",
+ "get_platform_osx",
]
# configuration variables that may contain universal build flags,
# like "-arch" or "-isdkroot", that may need customization for
# the user environment
-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS')
+_UNIVERSAL_CONFIG_VARS = ("CFLAGS", "LDFLAGS", "CPPFLAGS", "BASECFLAGS",
+ "BLDSHARED", "LDSHARED", "CC", "CXX",
+ "PY_CFLAGS", "PY_LDFLAGS", "PY_CPPFLAGS",
+ "PY_CORE_CFLAGS", "PY_CORE_LDFLAGS")
# configuration variables that may contain compiler calls
-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
+_COMPILER_CONFIG_VARS = ("BLDSHARED", "LDSHARED", "CC", "CXX")
# prefix added to original configuration variable names
-_INITPRE = '_OSX_SUPPORT_INITIAL_'
+_INITPRE = "_OSX_SUPPORT_INITIAL_"
def _find_executable(executable, path=None):
@@ -33,13 +33,13 @@ def _find_executable(executable, path=None):
os.environ['PATH']. Returns the complete filename or None if not found.
"""
if path is None:
- path = os.environ['PATH']
+ path = os.environ["PATH"]
paths = path.split(os.pathsep)
base, ext = os.path.splitext(executable)
- if (sys.platform == 'win32') and (ext != '.exe'):
- executable = executable + '.exe'
+ if (sys.platform == "win32") and (ext != ".exe"):
+ executable = executable + ".exe"
if not os.path.isfile(executable):
for p in paths:
@@ -71,14 +71,14 @@ def _read_output(commandstring, capture_stderr=False):
cmd = "%s >'%s' 2>&1" % (commandstring, fp.name)
else:
cmd = "%s 2>/dev/null >'%s'" % (commandstring, fp.name)
- return fp.read().decode('utf-8').strip() if not os.system(cmd) else None
+ return fp.read().decode("utf-8").strip() if not os.system(cmd) else None
def _find_build_tool(toolname):
"""Find a build tool on current path or using xcrun"""
return (_find_executable(toolname)
or _read_output("/usr/bin/xcrun -find %s" % (toolname,))
- or ''
+ or ""
)
_SYSTEM_VERSION = None
@@ -94,21 +94,21 @@ def _get_system_version():
global _SYSTEM_VERSION
if _SYSTEM_VERSION is None:
- _SYSTEM_VERSION = ''
+ _SYSTEM_VERSION = ""
try:
- f = open('/System/Library/CoreServices/SystemVersion.plist', encoding="utf-8")
+ f = open("/System/Library/CoreServices/SystemVersion.plist", encoding="utf-8")
except OSError:
# We're on a plain darwin box, fall back to the default
# behaviour.
pass
else:
try:
- m = re.search(r'ProductUserVisibleVersion\s*'
- r'(.*?)', f.read())
+ m = re.search(r"ProductUserVisibleVersion\s*"
+ r"(.*?)", f.read())
finally:
f.close()
if m is not None:
- _SYSTEM_VERSION = '.'.join(m.group(1).split('.')[:2])
+ _SYSTEM_VERSION = ".".join(m.group(1).split(".")[:2])
# else: fall back to the default behaviour
return _SYSTEM_VERSION
@@ -126,7 +126,7 @@ def _get_system_version_tuple():
osx_version = _get_system_version()
if osx_version:
try:
- _SYSTEM_VERSION_TUPLE = tuple(int(i) for i in osx_version.split('.'))
+ _SYSTEM_VERSION_TUPLE = tuple(int(i) for i in osx_version.split("."))
except ValueError:
_SYSTEM_VERSION_TUPLE = ()
@@ -143,7 +143,7 @@ def _remove_original_values(_config_vars):
def _save_modified_value(_config_vars, cv, newvalue):
"""Save modified and original unmodified value of configuration var"""
- oldvalue = _config_vars.get(cv, '')
+ oldvalue = _config_vars.get(cv, "")
if (oldvalue != newvalue) and (_INITPRE + cv not in _config_vars):
_config_vars[_INITPRE + cv] = oldvalue
_config_vars[cv] = newvalue
@@ -157,7 +157,7 @@ def _default_sysroot(cc):
if _cache_default_sysroot is not None:
return _cache_default_sysroot
- contents = _read_output('%s -c -E -v - "):
@@ -166,12 +166,12 @@ def _default_sysroot(cc):
in_incdirs = False
elif in_incdirs:
line = line.strip()
- if line == '/usr/include':
- _cache_default_sysroot = '/'
+ if line == "/usr/include":
+ _cache_default_sysroot = "/"
elif line.endswith(".sdk/usr/include"):
_cache_default_sysroot = line[:-12]
if _cache_default_sysroot is None:
- _cache_default_sysroot = '/'
+ _cache_default_sysroot = "/"
return _cache_default_sysroot
@@ -212,12 +212,12 @@ def _find_appropriate_compiler(_config_vars):
# miscompiles Python.
# skip checks if the compiler was overridden with a CC env variable
- if 'CC' in os.environ:
+ if "CC" in os.environ:
return _config_vars
# The CC config var might contain additional arguments.
# Ignore them while searching.
- cc = oldcc = _config_vars['CC'].split()[0]
+ cc = oldcc = _config_vars["CC"].split()[0]
if not _find_executable(cc):
# Compiler is not found on the shell search PATH.
# Now search for clang, first on PATH (if the Command LIne
@@ -230,15 +230,15 @@ def _find_appropriate_compiler(_config_vars):
# implemented on top of subprocess and is therefore not
# usable as well)
- cc = _find_build_tool('clang')
+ cc = _find_build_tool("clang")
- elif os.path.basename(cc).startswith('gcc'):
+ elif os.path.basename(cc).startswith("gcc"):
# Compiler is GCC, check if it is LLVM-GCC
data = _read_output("'%s' --version"
% (cc.replace("'", "'\"'\"'"),))
- if data and 'llvm-gcc' in data:
+ if data and "llvm-gcc" in data:
# Found LLVM-GCC, fall back to clang
- cc = _find_build_tool('clang')
+ cc = _find_build_tool("clang")
if not cc:
raise SystemError(
@@ -251,8 +251,8 @@ def _find_appropriate_compiler(_config_vars):
for cv in _COMPILER_CONFIG_VARS:
if cv in _config_vars and cv not in os.environ:
cv_split = _config_vars[cv].split()
- cv_split[0] = cc if cv != 'CXX' else cc + '++'
- _save_modified_value(_config_vars, cv, ' '.join(cv_split))
+ cv_split[0] = cc if cv != "CXX" else cc + "++"
+ _save_modified_value(_config_vars, cv, " ".join(cv_split))
return _config_vars
@@ -264,8 +264,8 @@ def _remove_universal_flags(_config_vars):
# Do not alter a config var explicitly overridden by env var
if cv in _config_vars and cv not in os.environ:
flags = _config_vars[cv]
- flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII)
- flags = re.sub(r'-isysroot\s*\S+', ' ', flags)
+ flags = re.sub(r"-arch\s+\w+\s", " ", flags, flags=re.ASCII)
+ flags = re.sub(r"-isysroot\s*\S+", " ", flags)
_save_modified_value(_config_vars, cv, flags)
return _config_vars
@@ -283,16 +283,16 @@ def _remove_unsupported_archs(_config_vars):
# 32-bit installer on the python.org website.
# skip checks if the compiler was overridden with a CC env variable
- if 'CC' in os.environ:
+ if "CC" in os.environ:
return _config_vars
- if re.search(r'-arch\s+ppc', _config_vars['CFLAGS']) is not None:
+ if re.search(r"-arch\s+ppc", _config_vars["CFLAGS"]) is not None:
# NOTE: Cannot use subprocess here because of bootstrap
# issues when building Python itself
status = os.system(
"""echo 'int main{};' | """
"""'%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/null"""
- %(_config_vars['CC'].replace("'", "'\"'\"'"),))
+ %(_config_vars["CC"].replace("'", "'\"'\"'"),))
if status:
# The compile failed for some reason. Because of differences
# across Xcode and compiler versions, there is no reliable way
@@ -305,7 +305,7 @@ def _remove_unsupported_archs(_config_vars):
for cv in _UNIVERSAL_CONFIG_VARS:
if cv in _config_vars and cv not in os.environ:
flags = _config_vars[cv]
- flags = re.sub(r'-arch\s+ppc\w*\s', ' ', flags)
+ flags = re.sub(r"-arch\s+ppc\w*\s", " ", flags)
_save_modified_value(_config_vars, cv, flags)
return _config_vars
@@ -316,13 +316,13 @@ def _override_all_archs(_config_vars):
# NOTE: This name was introduced by Apple in OSX 10.5 and
# is used by several scripting languages distributed with
# that OS release.
- if 'ARCHFLAGS' in os.environ:
- arch = os.environ['ARCHFLAGS']
+ if "ARCHFLAGS" in os.environ:
+ arch = os.environ["ARCHFLAGS"]
for cv in _UNIVERSAL_CONFIG_VARS:
- if cv in _config_vars and '-arch' in _config_vars[cv]:
+ if cv in _config_vars and "-arch" in _config_vars[cv]:
flags = _config_vars[cv]
- flags = re.sub(r'-arch\s+\w+\s', ' ', flags)
- flags = flags + ' ' + arch
+ flags = re.sub(r"-arch\s+\w+\s", " ", flags)
+ flags = flags + " " + arch
_save_modified_value(_config_vars, cv, flags)
return _config_vars
@@ -340,8 +340,8 @@ def _check_for_unavailable_sdk(_config_vars):
# that the header files and dev libs have been installed
# to /usr and /System/Library by either a standalone CLT
# package or the CLT component within Xcode.
- cflags = _config_vars.get('CFLAGS', '')
- m = re.search(r'-isysroot\s*(\S+)', cflags)
+ cflags = _config_vars.get("CFLAGS", "")
+ m = re.search(r"-isysroot\s*(\S+)", cflags)
if m is not None:
sdk = m.group(1)
if not os.path.exists(sdk):
@@ -349,7 +349,7 @@ def _check_for_unavailable_sdk(_config_vars):
# Do not alter a config var explicitly overridden by env var
if cv in _config_vars and cv not in os.environ:
flags = _config_vars[cv]
- flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags)
+ flags = re.sub(r"-isysroot\s*\S+(?:\s|$)", " ", flags)
_save_modified_value(_config_vars, cv, flags)
return _config_vars
@@ -373,13 +373,13 @@ def compiler_fixup(compiler_so, cc_args):
# all.
stripArch = stripSysroot = True
else:
- stripArch = '-arch' in cc_args
- stripSysroot = any(arg for arg in cc_args if arg.startswith('-isysroot'))
+ stripArch = "-arch" in cc_args
+ stripSysroot = any(arg for arg in cc_args if arg.startswith("-isysroot"))
- if stripArch or 'ARCHFLAGS' in os.environ:
+ if stripArch or "ARCHFLAGS" in os.environ:
while True:
try:
- index = compiler_so.index('-arch')
+ index = compiler_so.index("-arch")
# Strip this argument and the next one:
del compiler_so[index:index+2]
except ValueError:
@@ -388,21 +388,21 @@ def compiler_fixup(compiler_so, cc_args):
elif not _supports_arm64_builds():
# Look for "-arch arm64" and drop that
for idx in reversed(range(len(compiler_so))):
- if compiler_so[idx] == '-arch' and compiler_so[idx+1] == "arm64":
+ if compiler_so[idx] == "-arch" and compiler_so[idx+1] == "arm64":
del compiler_so[idx:idx+2]
- if 'ARCHFLAGS' in os.environ and not stripArch:
+ if "ARCHFLAGS" in os.environ and not stripArch:
# User specified different -arch flags in the environ,
# see also distutils.sysconfig
- compiler_so = compiler_so + os.environ['ARCHFLAGS'].split()
+ compiler_so = compiler_so + os.environ["ARCHFLAGS"].split()
if stripSysroot:
while True:
- indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')]
+ indices = [i for i,x in enumerate(compiler_so) if x.startswith("-isysroot")]
if not indices:
break
index = indices[0]
- if compiler_so[index] == '-isysroot':
+ if compiler_so[index] == "-isysroot":
# Strip this argument and the next one:
del compiler_so[index:index+2]
else:
@@ -414,17 +414,17 @@ def compiler_fixup(compiler_so, cc_args):
# users have that installed by default.
sysroot = None
argvar = cc_args
- indices = [i for i,x in enumerate(cc_args) if x.startswith('-isysroot')]
+ indices = [i for i,x in enumerate(cc_args) if x.startswith("-isysroot")]
if not indices:
argvar = compiler_so
- indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')]
+ indices = [i for i,x in enumerate(compiler_so) if x.startswith("-isysroot")]
for idx in indices:
- if argvar[idx] == '-isysroot':
+ if argvar[idx] == "-isysroot":
sysroot = argvar[idx+1]
break
else:
- sysroot = argvar[idx][len('-isysroot'):]
+ sysroot = argvar[idx][len("-isysroot"):]
break
if sysroot and not os.path.isdir(sysroot):
@@ -506,7 +506,7 @@ def get_platform_osx(_config_vars, osname, release, machine):
# machine is going to compile and link as if it were
# MACOSX_DEPLOYMENT_TARGET.
- macver = _config_vars.get('MACOSX_DEPLOYMENT_TARGET', '')
+ macver = _config_vars.get("MACOSX_DEPLOYMENT_TARGET", "")
macrelease = _get_system_version() or macver
macver = macver or macrelease
@@ -518,57 +518,57 @@ def get_platform_osx(_config_vars, osname, release, machine):
# return the same machine type for the platform string.
# Otherwise, distutils may consider this a cross-compiling
# case and disallow installs.
- cflags = _config_vars.get(_INITPRE+'CFLAGS',
- _config_vars.get('CFLAGS', ''))
+ cflags = _config_vars.get(_INITPRE+"CFLAGS",
+ _config_vars.get("CFLAGS", ""))
if macrelease:
try:
- macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])
+ macrelease = tuple(int(i) for i in macrelease.split(".")[0:2])
except ValueError:
macrelease = (10, 3)
else:
# assume no universal support
macrelease = (10, 3)
- if (macrelease >= (10, 4)) and '-arch' in cflags.strip():
+ if (macrelease >= (10, 4)) and "-arch" in cflags.strip():
# The universal build will build fat binaries, but not on
# systems before 10.4
- machine = 'fat'
+ machine = "fat"
- archs = re.findall(r'-arch\s+(\S+)', cflags)
+ archs = re.findall(r"-arch\s+(\S+)", cflags)
archs = tuple(sorted(set(archs)))
if len(archs) == 1:
machine = archs[0]
- elif archs == ('arm64', 'x86_64'):
- machine = 'universal2'
- elif archs == ('i386', 'ppc'):
- machine = 'fat'
- elif archs == ('i386', 'x86_64'):
- machine = 'intel'
- elif archs == ('i386', 'ppc', 'x86_64'):
- machine = 'fat3'
- elif archs == ('ppc64', 'x86_64'):
- machine = 'fat64'
- elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'):
- machine = 'universal'
+ elif archs == ("arm64", "x86_64"):
+ machine = "universal2"
+ elif archs == ("i386", "ppc"):
+ machine = "fat"
+ elif archs == ("i386", "x86_64"):
+ machine = "intel"
+ elif archs == ("i386", "ppc", "x86_64"):
+ machine = "fat3"
+ elif archs == ("ppc64", "x86_64"):
+ machine = "fat64"
+ elif archs == ("i386", "ppc", "ppc64", "x86_64"):
+ machine = "universal"
else:
raise ValueError(
"Don't know machine value for archs=%r" % (archs,))
- elif machine == 'i386':
+ elif machine == "i386":
# On OSX the machine type returned by uname is always the
# 32-bit variant, even if the executable architecture is
# the 64-bit variant
if sys.maxsize >= 2**32:
- machine = 'x86_64'
+ machine = "x86_64"
- elif machine in ('PowerPC', 'Power_Macintosh'):
+ elif machine in ("PowerPC", "Power_Macintosh"):
# Pick a sane name for the PPC architecture.
# See 'i386' case
if sys.maxsize >= 2**32:
- machine = 'ppc64'
+ machine = "ppc64"
else:
- machine = 'ppc'
+ machine = "ppc"
return (osname, release, machine)
diff --git a/.venv3.10/Lib/_py_abc.py b/.venv3.10/Lib/_py_abc.py
index c870ae90..c45fc592 100644
--- a/.venv3.10/Lib/_py_abc.py
+++ b/.venv3.10/Lib/_py_abc.py
@@ -108,7 +108,7 @@ def __instancecheck__(cls, instance):
def __subclasscheck__(cls, subclass):
"""Override for issubclass(subclass, cls)."""
if not isinstance(subclass, type):
- raise TypeError('issubclass() arg 1 must be a class')
+ raise TypeError("issubclass() arg 1 must be a class")
# Check cache
if subclass in cls._abc_cache:
return True
@@ -129,7 +129,7 @@ def __subclasscheck__(cls, subclass):
cls._abc_negative_cache.add(subclass)
return ok
# Check if it's a direct subclass
- if cls in getattr(subclass, '__mro__', ()):
+ if cls in getattr(subclass, "__mro__", ()):
cls._abc_cache.add(subclass)
return True
# Check if it's a subclass of a registered class (recursive)
diff --git a/.venv3.10/Lib/_pydecimal.py b/.venv3.10/Lib/_pydecimal.py
index 3d6cece9..fc07d32e 100644
--- a/.venv3.10/Lib/_pydecimal.py
+++ b/.venv3.10/Lib/_pydecimal.py
@@ -114,42 +114,42 @@
__all__ = [
# Two major classes
- 'Decimal', 'Context',
+ "Decimal", "Context",
# Named tuple representation
- 'DecimalTuple',
+ "DecimalTuple",
# Contexts
- 'DefaultContext', 'BasicContext', 'ExtendedContext',
+ "DefaultContext", "BasicContext", "ExtendedContext",
# Exceptions
- 'DecimalException', 'Clamped', 'InvalidOperation', 'DivisionByZero',
- 'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow',
- 'FloatOperation',
+ "DecimalException", "Clamped", "InvalidOperation", "DivisionByZero",
+ "Inexact", "Rounded", "Subnormal", "Overflow", "Underflow",
+ "FloatOperation",
# Exceptional conditions that trigger InvalidOperation
- 'DivisionImpossible', 'InvalidContext', 'ConversionSyntax', 'DivisionUndefined',
+ "DivisionImpossible", "InvalidContext", "ConversionSyntax", "DivisionUndefined",
# Constants for use in setting up contexts
- 'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING',
- 'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', 'ROUND_05UP',
+ "ROUND_DOWN", "ROUND_HALF_UP", "ROUND_HALF_EVEN", "ROUND_CEILING",
+ "ROUND_FLOOR", "ROUND_UP", "ROUND_HALF_DOWN", "ROUND_05UP",
# Functions for manipulating contexts
- 'setcontext', 'getcontext', 'localcontext',
+ "setcontext", "getcontext", "localcontext",
# Limits for the C version for compatibility
- 'MAX_PREC', 'MAX_EMAX', 'MIN_EMIN', 'MIN_ETINY',
+ "MAX_PREC", "MAX_EMAX", "MIN_EMIN", "MIN_ETINY",
# C version: compile time choice that enables the thread local context (deprecated, now always true)
- 'HAVE_THREADS',
+ "HAVE_THREADS",
# C version: compile time choice that enables the coroutine local context
- 'HAVE_CONTEXTVAR'
+ "HAVE_CONTEXTVAR"
]
__xname__ = __name__ # sys.modules lookup (--without-threads)
-__name__ = 'decimal' # For pickling
-__version__ = '1.70' # Highest version of the spec this complies with
+__name__ = "decimal" # For pickling
+__version__ = "1.70" # Highest version of the spec this complies with
# See http://speleotrove.com/decimal/
__libmpdec_version__ = "2.4.2" # compatible libmpdec version
@@ -159,19 +159,19 @@
try:
from collections import namedtuple as _namedtuple
- DecimalTuple = _namedtuple('DecimalTuple', 'sign digits exponent')
+ DecimalTuple = _namedtuple("DecimalTuple", "sign digits exponent")
except ImportError:
DecimalTuple = lambda *args: args
# Rounding
-ROUND_DOWN = 'ROUND_DOWN'
-ROUND_HALF_UP = 'ROUND_HALF_UP'
-ROUND_HALF_EVEN = 'ROUND_HALF_EVEN'
-ROUND_CEILING = 'ROUND_CEILING'
-ROUND_FLOOR = 'ROUND_FLOOR'
-ROUND_UP = 'ROUND_UP'
-ROUND_HALF_DOWN = 'ROUND_HALF_DOWN'
-ROUND_05UP = 'ROUND_05UP'
+ROUND_DOWN = "ROUND_DOWN"
+ROUND_HALF_UP = "ROUND_HALF_UP"
+ROUND_HALF_EVEN = "ROUND_HALF_EVEN"
+ROUND_CEILING = "ROUND_CEILING"
+ROUND_FLOOR = "ROUND_FLOOR"
+ROUND_UP = "ROUND_UP"
+ROUND_HALF_DOWN = "ROUND_HALF_DOWN"
+ROUND_05UP = "ROUND_05UP"
# Compatibility with the C version
HAVE_THREADS = True
@@ -249,7 +249,7 @@ class InvalidOperation(DecimalException):
"""
def handle(self, context, *args):
if args:
- ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True)
+ ans = _dec_from_triple(args[0]._sign, args[0]._int, "n", True)
return ans._fix_nan(context)
return _NaN
@@ -379,12 +379,12 @@ def handle(self, context, sign, *args):
if sign == 0:
if context.rounding == ROUND_CEILING:
return _SignedInfinity[sign]
- return _dec_from_triple(sign, '9'*context.prec,
+ return _dec_from_triple(sign, "9"*context.prec,
context.Emax-context.prec+1)
if sign == 1:
if context.rounding == ROUND_FLOOR:
return _SignedInfinity[sign]
- return _dec_from_triple(sign, '9'*context.prec,
+ return _dec_from_triple(sign, "9"*context.prec,
context.Emax-context.prec+1)
@@ -439,7 +439,7 @@ class FloatOperation(DecimalException, TypeError):
import contextvars
-_current_context_var = contextvars.ContextVar('decimal_context')
+_current_context_var = contextvars.ContextVar("decimal_context")
def getcontext():
"""Returns this thread's context.
@@ -513,7 +513,7 @@ def sin(x):
class Decimal(object):
"""Floating point class for decimal arithmetic."""
- __slots__ = ('_exp','_int','_sign', '_is_special')
+ __slots__ = ("_exp","_int","_sign", "_is_special")
# Generally, the value of the Decimal instance is given by
# (-1)**_sign * _int * 10**_exp
# Special values are signified by _is_special == True
@@ -554,31 +554,31 @@ def __new__(cls, value="0", context=None):
return context._raise_error(ConversionSyntax,
"Invalid literal for Decimal: %r" % value)
- if m.group('sign') == "-":
+ if m.group("sign") == "-":
self._sign = 1
else:
self._sign = 0
- intpart = m.group('int')
+ intpart = m.group("int")
if intpart is not None:
# finite number
- fracpart = m.group('frac') or ''
- exp = int(m.group('exp') or '0')
+ fracpart = m.group("frac") or ""
+ exp = int(m.group("exp") or "0")
self._int = str(int(intpart+fracpart))
self._exp = exp - len(fracpart)
self._is_special = False
else:
- diag = m.group('diag')
+ diag = m.group("diag")
if diag is not None:
# NaN
- self._int = str(int(diag or '0')).lstrip('0')
- if m.group('signal'):
- self._exp = 'N'
+ self._int = str(int(diag or "0")).lstrip("0")
+ if m.group("signal"):
+ self._exp = "N"
else:
- self._exp = 'n'
+ self._exp = "n"
else:
# infinity
- self._int = '0'
- self._exp = 'F'
+ self._int = "0"
+ self._exp = "F"
self._is_special = True
return self
@@ -612,18 +612,18 @@ def __new__(cls, value="0", context=None):
# tuple/list conversion (possibly from as_tuple())
if isinstance(value, (list,tuple)):
if len(value) != 3:
- raise ValueError('Invalid tuple size in creation of Decimal '
- 'from list or tuple. The list or tuple '
- 'should have exactly three elements.')
+ raise ValueError("Invalid tuple size in creation of Decimal "
+ "from list or tuple. The list or tuple "
+ "should have exactly three elements.")
# process sign. The isinstance test rejects floats
if not (isinstance(value[0], int) and value[0] in (0,1)):
raise ValueError("Invalid sign. The first value in the tuple "
"should be an integer; either 0 for a "
"positive number or 1 for a negative number.")
self._sign = value[0]
- if value[2] == 'F':
+ if value[2] == "F":
# infinity: value[1] is ignored
- self._int = '0'
+ self._int = "0"
self._exp = value[2]
self._is_special = True
else:
@@ -638,14 +638,14 @@ def __new__(cls, value="0", context=None):
raise ValueError("The second value in the tuple must "
"be composed of integers in the range "
"0 through 9.")
- if value[2] in ('n', 'N'):
+ if value[2] in ("n", "N"):
# NaN: digits form the diagnostic
- self._int = ''.join(map(str, digits))
+ self._int = "".join(map(str, digits))
self._exp = value[2]
self._is_special = True
elif isinstance(value[2], int):
# finite number: digits give the coefficient
- self._int = ''.join(map(str, digits or [0]))
+ self._int = "".join(map(str, digits or [0]))
self._exp = value[2]
self._is_special = False
else:
@@ -723,9 +723,9 @@ def _isnan(self):
"""
if self._is_special:
exp = self._exp
- if exp == 'n':
+ if exp == "n":
return 1
- elif exp == 'N':
+ elif exp == "N":
return 2
return 0
@@ -736,7 +736,7 @@ def _isinfinity(self):
1 if +INF
-1 if -INF
"""
- if self._exp == 'F':
+ if self._exp == "F":
if self._sign:
return -1
return 1
@@ -763,10 +763,10 @@ def _check_nans(self, other=None, context=None):
context = getcontext()
if self_is_nan == 2:
- return context._raise_error(InvalidOperation, 'sNaN',
+ return context._raise_error(InvalidOperation, "sNaN",
self)
if other_is_nan == 2:
- return context._raise_error(InvalidOperation, 'sNaN',
+ return context._raise_error(InvalidOperation, "sNaN",
other)
if self_is_nan:
return self._fix_nan(context)
@@ -791,19 +791,19 @@ def _compare_check_nans(self, other, context):
if self._is_special or other._is_special:
if self.is_snan():
return context._raise_error(InvalidOperation,
- 'comparison involving sNaN',
+ "comparison involving sNaN",
self)
elif other.is_snan():
return context._raise_error(InvalidOperation,
- 'comparison involving sNaN',
+ "comparison involving sNaN",
other)
elif self.is_qnan():
return context._raise_error(InvalidOperation,
- 'comparison involving NaN',
+ "comparison involving NaN",
self)
elif other.is_qnan():
return context._raise_error(InvalidOperation,
- 'comparison involving NaN',
+ "comparison involving NaN",
other)
return 0
@@ -812,7 +812,7 @@ def __bool__(self):
NaNs and infinities are considered nonzero.
"""
- return self._is_special or self._int != '0'
+ return self._is_special or self._int != "0"
def _cmp(self, other):
"""Compare the two non-NaN decimal instances self and other.
@@ -848,8 +848,8 @@ def _cmp(self, other):
self_adjusted = self.adjusted()
other_adjusted = other.adjusted()
if self_adjusted == other_adjusted:
- self_padded = self._int + '0'*(self._exp - other._exp)
- other_padded = other._int + '0'*(other._exp - self._exp)
+ self_padded = self._int + "0"*(self._exp - other._exp)
+ other_padded = other._int + "0"*(other._exp - self._exp)
if self_padded == other_padded:
return 0
elif self_padded < other_padded:
@@ -949,7 +949,7 @@ def __hash__(self):
# in the documentation. (See library docs, 'Built-in Types').
if self._is_special:
if self.is_snan():
- raise TypeError('Cannot hash a signaling NaN value.')
+ raise TypeError("Cannot hash a signaling NaN value.")
elif self.is_nan():
return object.__hash__(self)
else:
@@ -1034,14 +1034,14 @@ def __str__(self, eng=False, context=None):
Captures all of the information in the underlying representation.
"""
- sign = ['', '-'][self._sign]
+ sign = ["", "-"][self._sign]
if self._is_special:
- if self._exp == 'F':
- return sign + 'Infinity'
- elif self._exp == 'n':
- return sign + 'NaN' + self._int
+ if self._exp == "F":
+ return sign + "Infinity"
+ elif self._exp == "n":
+ return sign + "NaN" + self._int
else: # self._exp == 'N'
- return sign + 'sNaN' + self._int
+ return sign + "sNaN" + self._int
# number of digits of self._int to left of decimal point
leftdigits = self._exp + len(self._int)
@@ -1055,7 +1055,7 @@ def __str__(self, eng=False, context=None):
elif not eng:
# usual scientific notation: 1 digit on left of the point
dotplace = 1
- elif self._int == '0':
+ elif self._int == "0":
# engineering notation, zero
dotplace = (leftdigits + 1) % 3 - 1
else:
@@ -1063,20 +1063,20 @@ def __str__(self, eng=False, context=None):
dotplace = (leftdigits - 1) % 3 + 1
if dotplace <= 0:
- intpart = '0'
- fracpart = '.' + '0'*(-dotplace) + self._int
+ intpart = "0"
+ fracpart = "." + "0"*(-dotplace) + self._int
elif dotplace >= len(self._int):
- intpart = self._int+'0'*(dotplace-len(self._int))
- fracpart = ''
+ intpart = self._int+"0"*(dotplace-len(self._int))
+ fracpart = ""
else:
intpart = self._int[:dotplace]
- fracpart = '.' + self._int[dotplace:]
+ fracpart = "." + self._int[dotplace:]
if leftdigits == dotplace:
- exp = ''
+ exp = ""
else:
if context is None:
context = getcontext()
- exp = ['e', 'E'][context.capitals] + "%+d" % (leftdigits-dotplace)
+ exp = ["e", "E"][context.capitals] + "%+d" % (leftdigits-dotplace)
return sign + intpart + fracpart + exp
@@ -1174,7 +1174,7 @@ def __add__(self, other, context=None):
if self._isinfinity():
# If both INF, same sign => same as both, opposite => error.
if self._sign != other._sign and other._isinfinity():
- return context._raise_error(InvalidOperation, '-INF + INF')
+ return context._raise_error(InvalidOperation, "-INF + INF")
return Decimal(self)
if other._isinfinity():
return Decimal(other) # Can't both be infinity here
@@ -1189,7 +1189,7 @@ def __add__(self, other, context=None):
sign = min(self._sign, other._sign)
if negativezero:
sign = 1
- ans = _dec_from_triple(sign, '0', exp)
+ ans = _dec_from_triple(sign, "0", exp)
ans = ans._fix(context)
return ans
if not self:
@@ -1211,7 +1211,7 @@ def __add__(self, other, context=None):
if op1.sign != op2.sign:
# Equal and opposite
if op1.int == op2.int:
- ans = _dec_from_triple(negativezero, '0', exp)
+ ans = _dec_from_triple(negativezero, "0", exp)
ans = ans._fix(context)
return ans
if op1.int < op2.int:
@@ -1285,29 +1285,29 @@ def __mul__(self, other, context=None):
if self._isinfinity():
if not other:
- return context._raise_error(InvalidOperation, '(+-)INF * 0')
+ return context._raise_error(InvalidOperation, "(+-)INF * 0")
return _SignedInfinity[resultsign]
if other._isinfinity():
if not self:
- return context._raise_error(InvalidOperation, '0 * (+-)INF')
+ return context._raise_error(InvalidOperation, "0 * (+-)INF")
return _SignedInfinity[resultsign]
resultexp = self._exp + other._exp
# Special case for multiplying by zero
if not self or not other:
- ans = _dec_from_triple(resultsign, '0', resultexp)
+ ans = _dec_from_triple(resultsign, "0", resultexp)
# Fixing in case the exponent is out of bounds
ans = ans._fix(context)
return ans
# Special case for multiplying by power of 10
- if self._int == '1':
+ if self._int == "1":
ans = _dec_from_triple(resultsign, other._int, resultexp)
ans = ans._fix(context)
return ans
- if other._int == '1':
+ if other._int == "1":
ans = _dec_from_triple(resultsign, self._int, resultexp)
ans = ans._fix(context)
return ans
@@ -1338,20 +1338,20 @@ def __truediv__(self, other, context=None):
return ans
if self._isinfinity() and other._isinfinity():
- return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF')
+ return context._raise_error(InvalidOperation, "(+-)INF/(+-)INF")
if self._isinfinity():
return _SignedInfinity[sign]
if other._isinfinity():
- context._raise_error(Clamped, 'Division by infinity')
- return _dec_from_triple(sign, '0', context.Etiny())
+ context._raise_error(Clamped, "Division by infinity")
+ return _dec_from_triple(sign, "0", context.Etiny())
# Special cases for zeroes
if not other:
if not self:
- return context._raise_error(DivisionUndefined, '0 / 0')
- return context._raise_error(DivisionByZero, 'x / 0', sign)
+ return context._raise_error(DivisionUndefined, "0 / 0")
+ return context._raise_error(DivisionByZero, "x / 0", sign)
if not self:
exp = self._exp - other._exp
@@ -1394,7 +1394,7 @@ def _divide(self, other, context):
expdiff = self.adjusted() - other.adjusted()
if not self or other._isinfinity() or expdiff <= -2:
- return (_dec_from_triple(sign, '0', 0),
+ return (_dec_from_triple(sign, "0", 0),
self._rescale(ideal_exp, context.rounding))
if expdiff <= context.prec:
op1 = _WorkRep(self)
@@ -1410,7 +1410,7 @@ def _divide(self, other, context):
# Here the quotient is too large to be representable
ans = context._raise_error(DivisionImpossible,
- 'quotient too large in //, % or divmod')
+ "quotient too large in //, % or divmod")
return ans, ans
def __rtruediv__(self, other, context=None):
@@ -1438,19 +1438,19 @@ def __divmod__(self, other, context=None):
sign = self._sign ^ other._sign
if self._isinfinity():
if other._isinfinity():
- ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)')
+ ans = context._raise_error(InvalidOperation, "divmod(INF, INF)")
return ans, ans
else:
return (_SignedInfinity[sign],
- context._raise_error(InvalidOperation, 'INF % x'))
+ context._raise_error(InvalidOperation, "INF % x"))
if not other:
if not self:
- ans = context._raise_error(DivisionUndefined, 'divmod(0, 0)')
+ ans = context._raise_error(DivisionUndefined, "divmod(0, 0)")
return ans, ans
else:
- return (context._raise_error(DivisionByZero, 'x // 0', sign),
- context._raise_error(InvalidOperation, 'x % 0'))
+ return (context._raise_error(DivisionByZero, "x // 0", sign),
+ context._raise_error(InvalidOperation, "x % 0"))
quotient, remainder = self._divide(other, context)
remainder = remainder._fix(context)
@@ -1479,12 +1479,12 @@ def __mod__(self, other, context=None):
return ans
if self._isinfinity():
- return context._raise_error(InvalidOperation, 'INF % x')
+ return context._raise_error(InvalidOperation, "INF % x")
elif not other:
if self:
- return context._raise_error(InvalidOperation, 'x % 0')
+ return context._raise_error(InvalidOperation, "x % 0")
else:
- return context._raise_error(DivisionUndefined, '0 % 0')
+ return context._raise_error(DivisionUndefined, "0 % 0")
remainder = self._divide(other, context)[1]
remainder = remainder._fix(context)
@@ -1513,16 +1513,16 @@ def remainder_near(self, other, context=None):
# self == +/-infinity -> InvalidOperation
if self._isinfinity():
return context._raise_error(InvalidOperation,
- 'remainder_near(infinity, x)')
+ "remainder_near(infinity, x)")
# other == 0 -> either InvalidOperation or DivisionUndefined
if not other:
if self:
return context._raise_error(InvalidOperation,
- 'remainder_near(x, 0)')
+ "remainder_near(x, 0)")
else:
return context._raise_error(DivisionUndefined,
- 'remainder_near(0, 0)')
+ "remainder_near(0, 0)")
# other = +/-infinity -> remainder = self
if other._isinfinity():
@@ -1532,7 +1532,7 @@ def remainder_near(self, other, context=None):
# self = 0 -> remainder = self, with ideal exponent
ideal_exponent = min(self._exp, other._exp)
if not self:
- ans = _dec_from_triple(self._sign, '0', ideal_exponent)
+ ans = _dec_from_triple(self._sign, "0", ideal_exponent)
return ans._fix(context)
# catch most cases of large or small quotient
@@ -1587,16 +1587,16 @@ def __floordiv__(self, other, context=None):
if self._isinfinity():
if other._isinfinity():
- return context._raise_error(InvalidOperation, 'INF // INF')
+ return context._raise_error(InvalidOperation, "INF // INF")
else:
return _SignedInfinity[self._sign ^ other._sign]
if not other:
if self:
- return context._raise_error(DivisionByZero, 'x // 0',
+ return context._raise_error(DivisionByZero, "x // 0",
self._sign ^ other._sign)
else:
- return context._raise_error(DivisionUndefined, '0 // 0')
+ return context._raise_error(DivisionUndefined, "0 // 0")
return self._divide(other, context)[0]
@@ -1628,7 +1628,7 @@ def __int__(self):
if self._exp >= 0:
return s*int(self._int)*10**self._exp
else:
- return s*int(self._int[:self._exp] or '0')
+ return s*int(self._int[:self._exp] or "0")
__trunc__ = __int__
@@ -1654,7 +1654,7 @@ def _fix_nan(self, context):
# precision-1 if clamp=1.
max_payload_len = context.prec - context.clamp
if len(payload) > max_payload_len:
- payload = payload[len(payload)-max_payload_len:].lstrip('0')
+ payload = payload[len(payload)-max_payload_len:].lstrip("0")
return _dec_from_triple(self._sign, payload, self._exp, True)
return Decimal(self)
@@ -1685,7 +1685,7 @@ def _fix(self, context):
new_exp = min(max(self._exp, Etiny), exp_max)
if new_exp != self._exp:
context._raise_error(Clamped)
- return _dec_from_triple(self._sign, '0', new_exp)
+ return _dec_from_triple(self._sign, "0", new_exp)
else:
return Decimal(self)
@@ -1694,7 +1694,7 @@ def _fix(self, context):
exp_min = len(self._int) + self._exp - context.prec
if exp_min > Etop:
# overflow: exp_min > Etop iff self.adjusted() > Emax
- ans = context._raise_error(Overflow, 'above Emax', self._sign)
+ ans = context._raise_error(Overflow, "above Emax", self._sign)
context._raise_error(Inexact)
context._raise_error(Rounded)
return ans
@@ -1707,11 +1707,11 @@ def _fix(self, context):
if self._exp < exp_min:
digits = len(self._int) + self._exp - exp_min
if digits < 0:
- self = _dec_from_triple(self._sign, '1', exp_min-1)
+ self = _dec_from_triple(self._sign, "1", exp_min-1)
digits = 0
rounding_method = self._pick_rounding_function[context.rounding]
changed = rounding_method(self, digits)
- coeff = self._int[:digits] or '0'
+ coeff = self._int[:digits] or "0"
if changed > 0:
coeff = str(int(coeff)+1)
if len(coeff) > context.prec:
@@ -1720,7 +1720,7 @@ def _fix(self, context):
# check whether the rounding pushed the exponent out of range
if exp_min > Etop:
- ans = context._raise_error(Overflow, 'above Emax', self._sign)
+ ans = context._raise_error(Overflow, "above Emax", self._sign)
else:
ans = _dec_from_triple(self._sign, coeff, exp_min)
@@ -1744,7 +1744,7 @@ def _fix(self, context):
# fold down if clamp == 1 and self has too few digits
if context.clamp == 1 and self._exp > Etop:
context._raise_error(Clamped)
- self_padded = self._int + '0'*(self._exp - Etop)
+ self_padded = self._int + "0"*(self._exp - Etop)
return _dec_from_triple(self._sign, self_padded, Etop)
# here self was representable to begin with; return unchanged
@@ -1773,7 +1773,7 @@ def _round_up(self, prec):
def _round_half_up(self, prec):
"""Rounds 5 up (away from 0)"""
- if self._int[prec] in '56789':
+ if self._int[prec] in "56789":
return 1
elif _all_zeros(self._int, prec):
return 0
@@ -1790,7 +1790,7 @@ def _round_half_down(self, prec):
def _round_half_even(self, prec):
"""Round 5 to even, rest to nearest."""
if _exact_half(self._int, prec) and \
- (prec == 0 or self._int[prec-1] in '02468'):
+ (prec == 0 or self._int[prec-1] in "02468"):
return -1
else:
return self._round_half_up(prec)
@@ -1811,7 +1811,7 @@ def _round_floor(self, prec):
def _round_05up(self, prec):
"""Round down unless digit prec-1 is 0 or 5."""
- if prec and self._int[prec-1] not in '05':
+ if prec and self._int[prec-1] not in "05":
return self._round_down(prec)
else:
return -self._round_down(prec)
@@ -1877,8 +1877,8 @@ def __round__(self, n=None):
if n is not None:
# two-argument form: use the equivalent quantize call
if not isinstance(n, int):
- raise TypeError('Second argument to round should be integral')
- exp = _dec_from_triple(0, '1', -n)
+ raise TypeError("Second argument to round should be integral")
+ exp = _dec_from_triple(0, "1", -n)
return self.quantize(exp)
# one-argument form
@@ -1938,23 +1938,23 @@ def fma(self, other, third, context=None):
if self._is_special or other._is_special:
if context is None:
context = getcontext()
- if self._exp == 'N':
- return context._raise_error(InvalidOperation, 'sNaN', self)
- if other._exp == 'N':
- return context._raise_error(InvalidOperation, 'sNaN', other)
- if self._exp == 'n':
+ if self._exp == "N":
+ return context._raise_error(InvalidOperation, "sNaN", self)
+ if other._exp == "N":
+ return context._raise_error(InvalidOperation, "sNaN", other)
+ if self._exp == "n":
product = self
- elif other._exp == 'n':
+ elif other._exp == "n":
product = other
- elif self._exp == 'F':
+ elif self._exp == "F":
if not other:
return context._raise_error(InvalidOperation,
- 'INF * 0 in fma')
+ "INF * 0 in fma")
product = _SignedInfinity[self._sign ^ other._sign]
- elif other._exp == 'F':
+ elif other._exp == "F":
if not self:
return context._raise_error(InvalidOperation,
- '0 * INF in fma')
+ "0 * INF in fma")
product = _SignedInfinity[self._sign ^ other._sign]
else:
product = _dec_from_triple(self._sign ^ other._sign,
@@ -1983,13 +1983,13 @@ def _power_modulo(self, other, modulo, context=None):
modulo_is_nan = modulo._isnan()
if self_is_nan or other_is_nan or modulo_is_nan:
if self_is_nan == 2:
- return context._raise_error(InvalidOperation, 'sNaN',
+ return context._raise_error(InvalidOperation, "sNaN",
self)
if other_is_nan == 2:
- return context._raise_error(InvalidOperation, 'sNaN',
+ return context._raise_error(InvalidOperation, "sNaN",
other)
if modulo_is_nan == 2:
- return context._raise_error(InvalidOperation, 'sNaN',
+ return context._raise_error(InvalidOperation, "sNaN",
modulo)
if self_is_nan:
return self._fix_nan(context)
@@ -2002,31 +2002,31 @@ def _power_modulo(self, other, modulo, context=None):
other._isinteger() and
modulo._isinteger()):
return context._raise_error(InvalidOperation,
- 'pow() 3rd argument not allowed '
- 'unless all arguments are integers')
+ "pow() 3rd argument not allowed "
+ "unless all arguments are integers")
if other < 0:
return context._raise_error(InvalidOperation,
- 'pow() 2nd argument cannot be '
- 'negative when 3rd argument specified')
+ "pow() 2nd argument cannot be "
+ "negative when 3rd argument specified")
if not modulo:
return context._raise_error(InvalidOperation,
- 'pow() 3rd argument cannot be 0')
+ "pow() 3rd argument cannot be 0")
# additional restriction for decimal: the modulus must be less
# than 10**prec in absolute value
if modulo.adjusted() >= context.prec:
return context._raise_error(InvalidOperation,
- 'insufficient precision: pow() 3rd '
- 'argument must not have more than '
- 'precision digits')
+ "insufficient precision: pow() 3rd "
+ "argument must not have more than "
+ "precision digits")
# define 0**0 == NaN, for consistency with two-argument pow
# (even though it hurts!)
if not other and not self:
return context._raise_error(InvalidOperation,
- 'at least one of pow() 1st argument '
- 'and 2nd argument must be nonzero; '
- '0**0 is not defined')
+ "at least one of pow() 1st argument "
+ "and 2nd argument must be nonzero; "
+ "0**0 is not defined")
# compute sign of result
if other._iseven():
@@ -2137,7 +2137,7 @@ def _power_exact(self, other, p):
zeros = min(exponent-ideal_exponent, p-1)
else:
zeros = 0
- return _dec_from_triple(0, '1' + '0'*zeros, exponent-zeros)
+ return _dec_from_triple(0, "1" + "0"*zeros, exponent-zeros)
# case where y is negative: xc must be either a power
# of 2 or a power of 5.
@@ -2283,7 +2283,7 @@ def _power_exact(self, other, p):
zeros = min(xe-ideal_exponent, p-len(str_xc))
else:
zeros = 0
- return _dec_from_triple(0, str_xc+'0'*zeros, xe-zeros)
+ return _dec_from_triple(0, str_xc+"0"*zeros, xe-zeros)
def __pow__(self, other, modulo=None, context=None):
"""Return self ** other [ % modulo].
@@ -2327,7 +2327,7 @@ def __pow__(self, other, modulo=None, context=None):
# 0**0 = NaN (!), x**0 = 1 for nonzero x (including +/-Infinity)
if not other:
if not self:
- return context._raise_error(InvalidOperation, '0 ** 0')
+ return context._raise_error(InvalidOperation, "0 ** 0")
else:
return _One
@@ -2342,14 +2342,14 @@ def __pow__(self, other, modulo=None, context=None):
# (-0)**noninteger = 0**noninteger
if self:
return context._raise_error(InvalidOperation,
- 'x ** y with x negative and y not an integer')
+ "x ** y with x negative and y not an integer")
# negate self, without doing any unwanted rounding
self = self.copy_negate()
# 0**(+ve or Inf)= 0; 0**(-ve or -Inf) = Infinity
if not self:
if other._sign == 0:
- return _dec_from_triple(result_sign, '0', 0)
+ return _dec_from_triple(result_sign, "0", 0)
else:
return _SignedInfinity[result_sign]
@@ -2358,7 +2358,7 @@ def __pow__(self, other, modulo=None, context=None):
if other._sign == 0:
return _SignedInfinity[result_sign]
else:
- return _dec_from_triple(result_sign, '0', 0)
+ return _dec_from_triple(result_sign, "0", 0)
# 1**other = 1, but the choice of exponent and the flags
# depend on the exponent of self, and on whether other is a
@@ -2385,7 +2385,7 @@ def __pow__(self, other, modulo=None, context=None):
context._raise_error(Rounded)
exp = 1-context.prec
- return _dec_from_triple(result_sign, '1'+'0'*-exp, exp)
+ return _dec_from_triple(result_sign, "1"+"0"*-exp, exp)
# compute adjusted exponent of self
self_adj = self.adjusted()
@@ -2394,7 +2394,7 @@ def __pow__(self, other, modulo=None, context=None):
# self ** -infinity is infinity if self < 1, 0 if self > 1
if other._isinfinity():
if (other._sign == 0) == (self_adj < 0):
- return _dec_from_triple(result_sign, '0', 0)
+ return _dec_from_triple(result_sign, "0", 0)
else:
return _SignedInfinity[result_sign]
@@ -2413,13 +2413,13 @@ def __pow__(self, other, modulo=None, context=None):
# self > 1 and other +ve, or self < 1 and other -ve
# possibility of overflow
if bound >= len(str(context.Emax)):
- ans = _dec_from_triple(result_sign, '1', context.Emax+1)
+ ans = _dec_from_triple(result_sign, "1", context.Emax+1)
else:
# self > 1 and other -ve, or self < 1 and other +ve
# possibility of underflow to 0
Etiny = context.Etiny()
if bound >= len(str(-Etiny)):
- ans = _dec_from_triple(result_sign, '1', Etiny-1)
+ ans = _dec_from_triple(result_sign, "1", Etiny-1)
# try for an exact result with precision +1
if ans is None:
@@ -2468,7 +2468,7 @@ def __pow__(self, other, modulo=None, context=None):
# ensures that the Rounded signal will be raised.
if len(ans._int) <= context.prec:
expdiff = context.prec + 1 - len(ans._int)
- ans = _dec_from_triple(ans._sign, ans._int+'0'*expdiff,
+ ans = _dec_from_triple(ans._sign, ans._int+"0"*expdiff,
ans._exp-expdiff)
# create a copy of the current context, with cleared flags/traps
@@ -2491,7 +2491,7 @@ def __pow__(self, other, modulo=None, context=None):
# arguments. Note that the order of the exceptions is
# important here.
if newcontext.flags[Overflow]:
- context._raise_error(Overflow, 'above Emax', ans._sign)
+ context._raise_error(Overflow, "above Emax", ans._sign)
for exception in Underflow, Subnormal, Inexact, Rounded, Clamped:
if newcontext.flags[exception]:
context._raise_error(exception)
@@ -2524,11 +2524,11 @@ def normalize(self, context=None):
return dup
if not dup:
- return _dec_from_triple(dup._sign, '0', 0)
+ return _dec_from_triple(dup._sign, "0", 0)
exp_max = [context.Emax, context.Etop()][context.clamp]
end = len(dup._int)
exp = dup._exp
- while dup._int[end-1] == '0' and exp < exp_max:
+ while dup._int[end-1] == "0" and exp < exp_max:
exp += 1
end -= 1
return _dec_from_triple(dup._sign, dup._int[:end], exp)
@@ -2554,32 +2554,32 @@ def quantize(self, exp, rounding=None, context=None):
if exp._isinfinity() and self._isinfinity():
return Decimal(self) # if both are inf, it is OK
return context._raise_error(InvalidOperation,
- 'quantize with one INF')
+ "quantize with one INF")
# exp._exp should be between Etiny and Emax
if not (context.Etiny() <= exp._exp <= context.Emax):
return context._raise_error(InvalidOperation,
- 'target exponent out of bounds in quantize')
+ "target exponent out of bounds in quantize")
if not self:
- ans = _dec_from_triple(self._sign, '0', exp._exp)
+ ans = _dec_from_triple(self._sign, "0", exp._exp)
return ans._fix(context)
self_adjusted = self.adjusted()
if self_adjusted > context.Emax:
return context._raise_error(InvalidOperation,
- 'exponent of quantize result too large for current context')
+ "exponent of quantize result too large for current context")
if self_adjusted - exp._exp + 1 > context.prec:
return context._raise_error(InvalidOperation,
- 'quantize result has too many digits for current context')
+ "quantize result has too many digits for current context")
ans = self._rescale(exp._exp, rounding)
if ans.adjusted() > context.Emax:
return context._raise_error(InvalidOperation,
- 'exponent of quantize result too large for current context')
+ "exponent of quantize result too large for current context")
if len(ans._int) > context.prec:
return context._raise_error(InvalidOperation,
- 'quantize result has too many digits for current context')
+ "quantize result has too many digits for current context")
# raise appropriate flags
if ans and ans.adjusted() < context.Emin:
@@ -2623,22 +2623,22 @@ def _rescale(self, exp, rounding):
if self._is_special:
return Decimal(self)
if not self:
- return _dec_from_triple(self._sign, '0', exp)
+ return _dec_from_triple(self._sign, "0", exp)
if self._exp >= exp:
# pad answer with zeros if necessary
return _dec_from_triple(self._sign,
- self._int + '0'*(self._exp - exp), exp)
+ self._int + "0"*(self._exp - exp), exp)
# too many digits; round and lose data. If self.adjusted() <
# exp-1, replace self by 10**(exp-1) before rounding
digits = len(self._int) + self._exp - exp
if digits < 0:
- self = _dec_from_triple(self._sign, '1', exp-1)
+ self = _dec_from_triple(self._sign, "1", exp-1)
digits = 0
this_function = self._pick_rounding_function[rounding]
changed = this_function(self, digits)
- coeff = self._int[:digits] or '0'
+ coeff = self._int[:digits] or "0"
if changed == 1:
coeff = str(int(coeff)+1)
return _dec_from_triple(self._sign, coeff, exp)
@@ -2684,7 +2684,7 @@ def to_integral_exact(self, rounding=None, context=None):
if self._exp >= 0:
return Decimal(self)
if not self:
- return _dec_from_triple(self._sign, '0', 0)
+ return _dec_from_triple(self._sign, "0", 0)
if context is None:
context = getcontext()
if rounding is None:
@@ -2729,11 +2729,11 @@ def sqrt(self, context=None):
if not self:
# exponent = self._exp // 2. sqrt(-0) = -0
- ans = _dec_from_triple(self._sign, '0', self._exp // 2)
+ ans = _dec_from_triple(self._sign, "0", self._exp // 2)
return ans._fix(context)
if self._sign == 1:
- return context._raise_error(InvalidOperation, 'sqrt(-x), x > 0')
+ return context._raise_error(InvalidOperation, "sqrt(-x), x > 0")
# At this point self represents a positive number. Let p be
# the desired precision and express self in the form c*100**e
@@ -2896,13 +2896,13 @@ def _isinteger(self):
if self._exp >= 0:
return True
rest = self._int[self._exp:]
- return rest == '0'*len(rest)
+ return rest == "0"*len(rest)
def _iseven(self):
"""Returns True if self is even. Assumes self is an integer."""
if not self or self._exp > 0:
return True
- return self._int[-1+self._exp] in '02468'
+ return self._int[-1+self._exp] in "02468"
def adjusted(self):
"""Return the adjusted exponent of self"""
@@ -3070,16 +3070,16 @@ def exp(self, context=None):
# larger exponent the result either overflows or underflows.
if self._sign == 0 and adj > len(str((context.Emax+1)*3)):
# overflow
- ans = _dec_from_triple(0, '1', context.Emax+1)
+ ans = _dec_from_triple(0, "1", context.Emax+1)
elif self._sign == 1 and adj > len(str((-context.Etiny()+1)*3)):
# underflow to 0
- ans = _dec_from_triple(0, '1', context.Etiny()-1)
+ ans = _dec_from_triple(0, "1", context.Etiny()-1)
elif self._sign == 0 and adj < -p:
# p+1 digits; final round will raise correct flags
- ans = _dec_from_triple(0, '1' + '0'*(p-1) + '1', -p)
+ ans = _dec_from_triple(0, "1" + "0"*(p-1) + "1", -p)
elif self._sign == 1 and adj < -p-1:
# p+1 digits; final round will raise correct flags
- ans = _dec_from_triple(0, '9'*(p+1), -p-1)
+ ans = _dec_from_triple(0, "9"*(p+1), -p-1)
# general case
else:
op = _WorkRep(self)
@@ -3126,11 +3126,11 @@ def is_finite(self):
def is_infinite(self):
"""Return True if self is infinite; otherwise return False."""
- return self._exp == 'F'
+ return self._exp == "F"
def is_nan(self):
"""Return True if self is a qNaN or sNaN; otherwise return False."""
- return self._exp in ('n', 'N')
+ return self._exp in ("n", "N")
def is_normal(self, context=None):
"""Return True if self is a normal number; otherwise return False."""
@@ -3142,7 +3142,7 @@ def is_normal(self, context=None):
def is_qnan(self):
"""Return True if self is a quiet NaN; otherwise return False."""
- return self._exp == 'n'
+ return self._exp == "n"
def is_signed(self):
"""Return True if self is negative; otherwise return False."""
@@ -3150,7 +3150,7 @@ def is_signed(self):
def is_snan(self):
"""Return True if self is a signaling NaN; otherwise return False."""
- return self._exp == 'N'
+ return self._exp == "N"
def is_subnormal(self, context=None):
"""Return True if self is subnormal; otherwise return False."""
@@ -3162,7 +3162,7 @@ def is_subnormal(self, context=None):
def is_zero(self):
"""Return True if self is a zero; otherwise return False."""
- return not self._is_special and self._int == '0'
+ return not self._is_special and self._int == "0"
def _ln_exp_bound(self):
"""Compute a lower bound for the adjusted exponent of self.ln().
@@ -3215,7 +3215,7 @@ def ln(self, context=None):
# ln(negative) raises InvalidOperation
if self._sign == 1:
return context._raise_error(InvalidOperation,
- 'ln of a negative value')
+ "ln of a negative value")
# result is irrational, so necessarily inexact
op = _WorkRep(self)
@@ -3291,10 +3291,10 @@ def log10(self, context=None):
# log10(negative or -Infinity) raises InvalidOperation
if self._sign == 1:
return context._raise_error(InvalidOperation,
- 'log10 of a negative value')
+ "log10 of a negative value")
# log10(10**n) = n
- if self._int[0] == '1' and self._int[1:] == '0'*(len(self._int) - 1):
+ if self._int[0] == "1" and self._int[1:] == "0"*(len(self._int) - 1):
# answer may need rounding
ans = Decimal(self._exp + len(self._int) - 1)
else:
@@ -3342,7 +3342,7 @@ def logb(self, context=None):
# logb(0) = -Inf, DivisionByZero
if not self:
- return context._raise_error(DivisionByZero, 'logb(0)', 1)
+ return context._raise_error(DivisionByZero, "logb(0)", 1)
# otherwise, simply return the adjusted exponent of self, as a
# Decimal. Note that no attempt is made to fit the result
@@ -3360,19 +3360,19 @@ def _islogical(self):
if self._sign != 0 or self._exp != 0:
return False
for dig in self._int:
- if dig not in '01':
+ if dig not in "01":
return False
return True
def _fill_logical(self, context, opa, opb):
dif = context.prec - len(opa)
if dif > 0:
- opa = '0'*dif + opa
+ opa = "0"*dif + opa
elif dif < 0:
opa = opa[-context.prec:]
dif = context.prec - len(opb)
if dif > 0:
- opb = '0'*dif + opb
+ opb = "0"*dif + opb
elif dif < 0:
opb = opb[-context.prec:]
return opa, opb
@@ -3392,13 +3392,13 @@ def logical_and(self, other, context=None):
# make the operation, and clean starting zeroes
result = "".join([str(int(a)&int(b)) for a,b in zip(opa,opb)])
- return _dec_from_triple(0, result.lstrip('0') or '0', 0)
+ return _dec_from_triple(0, result.lstrip("0") or "0", 0)
def logical_invert(self, context=None):
"""Invert all its digits."""
if context is None:
context = getcontext()
- return self.logical_xor(_dec_from_triple(0,'1'*context.prec,0),
+ return self.logical_xor(_dec_from_triple(0,"1"*context.prec,0),
context)
def logical_or(self, other, context=None):
@@ -3416,7 +3416,7 @@ def logical_or(self, other, context=None):
# make the operation, and clean starting zeroes
result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)])
- return _dec_from_triple(0, result.lstrip('0') or '0', 0)
+ return _dec_from_triple(0, result.lstrip("0") or "0", 0)
def logical_xor(self, other, context=None):
"""Applies an 'xor' operation between self and other's digits."""
@@ -3433,7 +3433,7 @@ def logical_xor(self, other, context=None):
# make the operation, and clean starting zeroes
result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)])
- return _dec_from_triple(0, result.lstrip('0') or '0', 0)
+ return _dec_from_triple(0, result.lstrip("0") or "0", 0)
def max_mag(self, other, context=None):
"""Compares the values numerically with their sign ignored."""
@@ -3507,7 +3507,7 @@ def next_minus(self, context=None):
if self._isinfinity() == -1:
return _NegativeInfinity
if self._isinfinity() == 1:
- return _dec_from_triple(0, '9'*context.prec, context.Etop())
+ return _dec_from_triple(0, "9"*context.prec, context.Etop())
context = context.copy()
context._set_rounding(ROUND_FLOOR)
@@ -3515,7 +3515,7 @@ def next_minus(self, context=None):
new_self = self._fix(context)
if new_self != self:
return new_self
- return self.__sub__(_dec_from_triple(0, '1', context.Etiny()-1),
+ return self.__sub__(_dec_from_triple(0, "1", context.Etiny()-1),
context)
def next_plus(self, context=None):
@@ -3530,7 +3530,7 @@ def next_plus(self, context=None):
if self._isinfinity() == 1:
return _Infinity
if self._isinfinity() == -1:
- return _dec_from_triple(1, '9'*context.prec, context.Etop())
+ return _dec_from_triple(1, "9"*context.prec, context.Etop())
context = context.copy()
context._set_rounding(ROUND_CEILING)
@@ -3538,7 +3538,7 @@ def next_plus(self, context=None):
new_self = self._fix(context)
if new_self != self:
return new_self
- return self.__add__(_dec_from_triple(0, '1', context.Etiny()-1),
+ return self.__add__(_dec_from_triple(0, "1", context.Etiny()-1),
context)
def next_toward(self, other, context=None):
@@ -3571,7 +3571,7 @@ def next_toward(self, other, context=None):
# decide which flags to raise using value of ans
if ans._isinfinity():
context._raise_error(Overflow,
- 'Infinite result from next_toward',
+ "Infinite result from next_toward",
ans._sign)
context._raise_error(Inexact)
context._raise_error(Rounded)
@@ -3657,14 +3657,14 @@ def rotate(self, other, context=None):
rotdig = self._int
topad = context.prec - len(rotdig)
if topad > 0:
- rotdig = '0'*topad + rotdig
+ rotdig = "0"*topad + rotdig
elif topad < 0:
rotdig = rotdig[-topad:]
# let's rotate!
rotated = rotdig[torot:] + rotdig[:torot]
return _dec_from_triple(self._sign,
- rotated.lstrip('0') or '0', self._exp)
+ rotated.lstrip("0") or "0", self._exp)
def scaleb(self, other, context=None):
"""Returns self operand after adding the second value to its exp."""
@@ -3715,7 +3715,7 @@ def shift(self, other, context=None):
rotdig = self._int
topad = context.prec - len(rotdig)
if topad > 0:
- rotdig = '0'*topad + rotdig
+ rotdig = "0"*topad + rotdig
elif topad < 0:
rotdig = rotdig[-topad:]
@@ -3723,11 +3723,11 @@ def shift(self, other, context=None):
if torot < 0:
shifted = rotdig[:torot]
else:
- shifted = rotdig + '0'*torot
+ shifted = rotdig + "0"*torot
shifted = shifted[-context.prec:]
return _dec_from_triple(self._sign,
- shifted.lstrip('0') or '0', self._exp)
+ shifted.lstrip("0") or "0", self._exp)
# Support for pickling, copy, and deepcopy
def __reduce__(self):
@@ -3769,43 +3769,43 @@ def __format__(self, specifier, context=None, _localeconv=None):
if self._is_special:
sign = _format_sign(self._sign, spec)
body = str(self.copy_abs())
- if spec['type'] == '%':
- body += '%'
+ if spec["type"] == "%":
+ body += "%"
return _format_align(sign, body, spec)
# a type of None defaults to 'g' or 'G', depending on context
- if spec['type'] is None:
- spec['type'] = ['g', 'G'][context.capitals]
+ if spec["type"] is None:
+ spec["type"] = ["g", "G"][context.capitals]
# if type is '%', adjust exponent of self accordingly
- if spec['type'] == '%':
+ if spec["type"] == "%":
self = _dec_from_triple(self._sign, self._int, self._exp+2)
# round if necessary, taking rounding mode from the context
rounding = context.rounding
- precision = spec['precision']
+ precision = spec["precision"]
if precision is not None:
- if spec['type'] in 'eE':
+ if spec["type"] in "eE":
self = self._round(precision+1, rounding)
- elif spec['type'] in 'fF%':
+ elif spec["type"] in "fF%":
self = self._rescale(-precision, rounding)
- elif spec['type'] in 'gG' and len(self._int) > precision:
+ elif spec["type"] in "gG" and len(self._int) > precision:
self = self._round(precision, rounding)
# special case: zeros with a positive exponent can't be
# represented in fixed point; rescale them to 0e0.
- if not self and self._exp > 0 and spec['type'] in 'fF%':
+ if not self and self._exp > 0 and spec["type"] in "fF%":
self = self._rescale(0, rounding)
# figure out placement of the decimal point
leftdigits = self._exp + len(self._int)
- if spec['type'] in 'eE':
+ if spec["type"] in "eE":
if not self and precision is not None:
dotplace = 1 - precision
else:
dotplace = 1
- elif spec['type'] in 'fF%':
+ elif spec["type"] in "fF%":
dotplace = leftdigits
- elif spec['type'] in 'gG':
+ elif spec["type"] in "gG":
if self._exp <= 0 and leftdigits > -6:
dotplace = leftdigits
else:
@@ -3813,13 +3813,13 @@ def __format__(self, specifier, context=None, _localeconv=None):
# find digits before and after decimal point, and get exponent
if dotplace < 0:
- intpart = '0'
- fracpart = '0'*(-dotplace) + self._int
+ intpart = "0"
+ fracpart = "0"*(-dotplace) + self._int
elif dotplace > len(self._int):
- intpart = self._int + '0'*(dotplace-len(self._int))
- fracpart = ''
+ intpart = self._int + "0"*(dotplace-len(self._int))
+ fracpart = ""
else:
- intpart = self._int[:dotplace] or '0'
+ intpart = self._int[:dotplace] or "0"
fracpart = self._int[dotplace:]
exp = leftdigits-dotplace
@@ -3924,10 +3924,10 @@ def __init__(self, prec=None, rounding=None, Emin=None, Emax=None,
def _set_integer_check(self, name, value, vmin, vmax):
if not isinstance(value, int):
raise TypeError("%s must be an integer" % name)
- if vmin == '-inf':
+ if vmin == "-inf":
if value > vmax:
raise ValueError("%s must be in [%s, %d]. got: %s" % (name, vmin, vmax, value))
- elif vmax == 'inf':
+ elif vmax == "inf":
if value < vmin:
raise ValueError("%s must be in [%d, %s]. got: %s" % (name, vmin, vmax, value))
else:
@@ -3939,33 +3939,33 @@ def _set_signal_dict(self, name, d):
if not isinstance(d, dict):
raise TypeError("%s must be a signal dict" % d)
for key in d:
- if not key in _signals:
+ if key not in _signals:
raise KeyError("%s is not a valid signal dict" % d)
for key in _signals:
- if not key in d:
+ if key not in d:
raise KeyError("%s is not a valid signal dict" % d)
return object.__setattr__(self, name, d)
def __setattr__(self, name, value):
- if name == 'prec':
- return self._set_integer_check(name, value, 1, 'inf')
- elif name == 'Emin':
- return self._set_integer_check(name, value, '-inf', 0)
- elif name == 'Emax':
- return self._set_integer_check(name, value, 0, 'inf')
- elif name == 'capitals':
+ if name == "prec":
+ return self._set_integer_check(name, value, 1, "inf")
+ elif name == "Emin":
+ return self._set_integer_check(name, value, "-inf", 0)
+ elif name == "Emax":
+ return self._set_integer_check(name, value, 0, "inf")
+ elif name == "capitals":
return self._set_integer_check(name, value, 0, 1)
- elif name == 'clamp':
+ elif name == "clamp":
return self._set_integer_check(name, value, 0, 1)
- elif name == 'rounding':
- if not value in _rounding_modes:
+ elif name == "rounding":
+ if value not in _rounding_modes:
# raise TypeError even for strings to have consistency
# among various implementations.
raise TypeError("%s: invalid rounding mode" % value)
return object.__setattr__(self, name, value)
- elif name == 'flags' or name == 'traps':
+ elif name == "flags" or name == "traps":
return self._set_signal_dict(name, value)
- elif name == '_ignored_flags':
+ elif name == "_ignored_flags":
return object.__setattr__(self, name, value)
else:
raise AttributeError(
@@ -3985,15 +3985,15 @@ def __reduce__(self):
def __repr__(self):
"""Show the current context."""
s = []
- s.append('Context(prec=%(prec)d, rounding=%(rounding)s, '
- 'Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, '
- 'clamp=%(clamp)d'
+ s.append("Context(prec=%(prec)d, rounding=%(rounding)s, "
+ "Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, "
+ "clamp=%(clamp)d"
% vars(self))
names = [f.__name__ for f, v in self.flags.items() if v]
- s.append('flags=[' + ', '.join(names) + ']')
+ s.append("flags=[" + ", ".join(names) + "]")
names = [t.__name__ for t, v in self.traps.items() if v]
- s.append('traps=[' + ', '.join(names) + ']')
- return ', '.join(s) + ')'
+ s.append("traps=[" + ", ".join(names) + "]")
+ return ", ".join(s) + ")"
def clear_flags(self):
"""Reset all flags to zero"""
@@ -4091,13 +4091,13 @@ def _set_rounding(self, type):
self.rounding = type
return rounding
- def create_decimal(self, num='0'):
+ def create_decimal(self, num="0"):
"""Creates a new Decimal instance but using self as context.
This method implements the to-number operation of the
IBM Decimal specification."""
- if isinstance(num, str) and (num != num.strip() or '_' in num):
+ if isinstance(num, str) and (num != num.strip() or "_" in num):
return self._raise_error(ConversionSyntax,
"trailing or leading whitespace and "
"underscores are not permitted.")
@@ -5612,7 +5612,7 @@ def to_integral_value(self, a):
to_integral = to_integral_value
class _WorkRep(object):
- __slots__ = ('sign','int','exp')
+ __slots__ = ("sign","int","exp")
# sign: 0 or 1
# int: int
# exp: None, int, or string
@@ -5687,7 +5687,7 @@ def _decimal_lshift_exact(n, e):
else:
# val_n = largest power of 10 dividing n.
str_n = str(abs(n))
- val_n = len(str_n) - len(str_n.rstrip('0'))
+ val_n = len(str_n) - len(str_n.rstrip("0"))
return None if val_n < -e else n // 10**-e
def _sqrt_nearest(n, a):
@@ -5874,12 +5874,12 @@ def getdigits(self, p):
# compute p+extra digits, correct to within 1ulp
M = 10**(p+extra+2)
digits = str(_div_nearest(_ilog(10*M, M), 100))
- if digits[-extra:] != '0'*extra:
+ if digits[-extra:] != "0"*extra:
break
extra += 3
# keep all reliable digits so far; remove trailing zeros
# and next nonzero digit
- self.digits = digits.rstrip('0')[:-1]
+ self.digits = digits.rstrip("0")[:-1]
return int(self.digits[:p+1])
_log10_digits = _Log10Memoize().getdigits
@@ -6000,8 +6000,8 @@ def _dpower(xc, xe, yc, ye, p):
return coeff, exp
def _log10_lb(c, correction = {
- '1': 100, '2': 70, '3': 53, '4': 40, '5': 31,
- '6': 23, '7': 16, '8': 10, '9': 5}):
+ "1": 100, "2": 70, "3": 53, "4": 40, "5": 31,
+ "6": 23, "7": 16, "8": 10, "9": 5}):
"""Compute a lower bound for 100*log10(c) for a positive integer c."""
if c <= 0:
raise ValueError("The argument to _log10_lb should be nonnegative.")
@@ -6133,8 +6133,8 @@ def _convert_for_comparison(self, other, equality_op=False):
\Z
""", re.VERBOSE | re.IGNORECASE).match
-_all_zeros = re.compile('0*$').match
-_exact_half = re.compile('50*$').match
+_all_zeros = re.compile("0*$").match
+_exact_half = re.compile("50*$").match
##### PEP3101 support functions ##############################################
# The functions in this section have little to do with the Decimal
@@ -6198,55 +6198,55 @@ def _parse_format_specifier(format_spec, _localeconv=None):
# zeropad; defaults for fill and alignment. If zero padding
# is requested, the fill and align fields should be absent.
- fill = format_dict['fill']
- align = format_dict['align']
- format_dict['zeropad'] = (format_dict['zeropad'] is not None)
- if format_dict['zeropad']:
+ fill = format_dict["fill"]
+ align = format_dict["align"]
+ format_dict["zeropad"] = (format_dict["zeropad"] is not None)
+ if format_dict["zeropad"]:
if fill is not None:
raise ValueError("Fill character conflicts with '0'"
" in format specifier: " + format_spec)
if align is not None:
raise ValueError("Alignment conflicts with '0' in "
"format specifier: " + format_spec)
- format_dict['fill'] = fill or ' '
+ format_dict["fill"] = fill or " "
# PEP 3101 originally specified that the default alignment should
# be left; it was later agreed that right-aligned makes more sense
# for numeric types. See http://bugs.python.org/issue6857.
- format_dict['align'] = align or '>'
+ format_dict["align"] = align or ">"
# default sign handling: '-' for negative, '' for positive
- if format_dict['sign'] is None:
- format_dict['sign'] = '-'
+ if format_dict["sign"] is None:
+ format_dict["sign"] = "-"
# minimumwidth defaults to 0; precision remains None if not given
- format_dict['minimumwidth'] = int(format_dict['minimumwidth'] or '0')
- if format_dict['precision'] is not None:
- format_dict['precision'] = int(format_dict['precision'])
+ format_dict["minimumwidth"] = int(format_dict["minimumwidth"] or "0")
+ if format_dict["precision"] is not None:
+ format_dict["precision"] = int(format_dict["precision"])
# if format type is 'g' or 'G' then a precision of 0 makes little
# sense; convert it to 1. Same if format type is unspecified.
- if format_dict['precision'] == 0:
- if format_dict['type'] is None or format_dict['type'] in 'gGn':
- format_dict['precision'] = 1
+ if format_dict["precision"] == 0:
+ if format_dict["type"] is None or format_dict["type"] in "gGn":
+ format_dict["precision"] = 1
# determine thousands separator, grouping, and decimal separator, and
# add appropriate entries to format_dict
- if format_dict['type'] == 'n':
+ if format_dict["type"] == "n":
# apart from separators, 'n' behaves just like 'g'
- format_dict['type'] = 'g'
+ format_dict["type"] = "g"
if _localeconv is None:
_localeconv = _locale.localeconv()
- if format_dict['thousands_sep'] is not None:
+ if format_dict["thousands_sep"] is not None:
raise ValueError("Explicit thousands separator conflicts with "
"'n' type in format specifier: " + format_spec)
- format_dict['thousands_sep'] = _localeconv['thousands_sep']
- format_dict['grouping'] = _localeconv['grouping']
- format_dict['decimal_point'] = _localeconv['decimal_point']
+ format_dict["thousands_sep"] = _localeconv["thousands_sep"]
+ format_dict["grouping"] = _localeconv["grouping"]
+ format_dict["decimal_point"] = _localeconv["decimal_point"]
else:
- if format_dict['thousands_sep'] is None:
- format_dict['thousands_sep'] = ''
- format_dict['grouping'] = [3, 0]
- format_dict['decimal_point'] = '.'
+ if format_dict["thousands_sep"] is None:
+ format_dict["thousands_sep"] = ""
+ format_dict["grouping"] = [3, 0]
+ format_dict["decimal_point"] = "."
return format_dict
@@ -6258,22 +6258,22 @@ def _format_align(sign, body, spec):
"""
# how much extra space do we have to play with?
- minimumwidth = spec['minimumwidth']
- fill = spec['fill']
+ minimumwidth = spec["minimumwidth"]
+ fill = spec["fill"]
padding = fill*(minimumwidth - len(sign) - len(body))
- align = spec['align']
- if align == '<':
+ align = spec["align"]
+ if align == "<":
result = sign + body + padding
- elif align == '>':
+ elif align == ">":
result = padding + sign + body
- elif align == '=':
+ elif align == "=":
result = sign + padding + body
- elif align == '^':
+ elif align == "^":
half = len(padding)//2
result = padding[:half] + sign + body + padding[half:]
else:
- raise ValueError('Unrecognised alignment field')
+ raise ValueError("Unrecognised alignment field")
return result
@@ -6298,7 +6298,7 @@ def _group_lengths(grouping):
elif grouping[-1] == _locale.CHAR_MAX:
return grouping[:-1]
else:
- raise ValueError('unrecognised format for grouping')
+ raise ValueError("unrecognised format for grouping")
def _insert_thousands_sep(digits, spec, min_width=1):
"""Insert thousands separators into a digit string.
@@ -6317,8 +6317,8 @@ def _insert_thousands_sep(digits, spec, min_width=1):
"""
- sep = spec['thousands_sep']
- grouping = spec['grouping']
+ sep = spec["thousands_sep"]
+ grouping = spec["grouping"]
groups = []
for l in _group_lengths(grouping):
@@ -6326,7 +6326,7 @@ def _insert_thousands_sep(digits, spec, min_width=1):
raise ValueError("group length should be positive")
# max(..., 1) forces at least 1 digit to the left of a separator
l = min(max(len(digits), min_width, 1), l)
- groups.append('0'*(l - len(digits)) + digits[-l:])
+ groups.append("0"*(l - len(digits)) + digits[-l:])
digits = digits[:-l]
min_width -= l
if not digits and min_width <= 0:
@@ -6334,18 +6334,18 @@ def _insert_thousands_sep(digits, spec, min_width=1):
min_width -= len(sep)
else:
l = max(len(digits), min_width, 1)
- groups.append('0'*(l - len(digits)) + digits[-l:])
+ groups.append("0"*(l - len(digits)) + digits[-l:])
return sep.join(reversed(groups))
def _format_sign(is_negative, spec):
"""Determine sign character."""
if is_negative:
- return '-'
- elif spec['sign'] in ' +':
- return spec['sign']
+ return "-"
+ elif spec["sign"] in " +":
+ return spec["sign"]
else:
- return ''
+ return ""
def _format_number(is_negative, intpart, fracpart, exp, spec):
"""Format a number, given the following data:
@@ -6367,17 +6367,17 @@ def _format_number(is_negative, intpart, fracpart, exp, spec):
sign = _format_sign(is_negative, spec)
- if fracpart or spec['alt']:
- fracpart = spec['decimal_point'] + fracpart
+ if fracpart or spec["alt"]:
+ fracpart = spec["decimal_point"] + fracpart
- if exp != 0 or spec['type'] in 'eE':
- echar = {'E': 'E', 'e': 'e', 'G': 'E', 'g': 'e'}[spec['type']]
+ if exp != 0 or spec["type"] in "eE":
+ echar = {"E": "E", "e": "e", "G": "E", "g": "e"}[spec["type"]]
fracpart += "{0}{1:+}".format(echar, exp)
- if spec['type'] == '%':
- fracpart += '%'
+ if spec["type"] == "%":
+ fracpart += "%"
- if spec['zeropad']:
- min_width = spec['minimumwidth'] - len(fracpart) - len(sign)
+ if spec["zeropad"]:
+ min_width = spec["minimumwidth"] - len(fracpart) - len(sign)
else:
min_width = 0
intpart = _insert_thousands_sep(intpart, spec, min_width)
@@ -6388,9 +6388,9 @@ def _format_number(is_negative, intpart, fracpart, exp, spec):
##### Useful Constants (internal use only) ################################
# Reusable defaults
-_Infinity = Decimal('Inf')
-_NegativeInfinity = Decimal('-Inf')
-_NaN = Decimal('NaN')
+_Infinity = Decimal("Inf")
+_NegativeInfinity = Decimal("-Inf")
+_NaN = Decimal("NaN")
_Zero = Decimal(0)
_One = Decimal(1)
_NegativeOne = Decimal(-1)
diff --git a/.venv3.10/Lib/_pyio.py b/.venv3.10/Lib/_pyio.py
index fb867fbc..4cf609b4 100644
--- a/.venv3.10/Lib/_pyio.py
+++ b/.venv3.10/Lib/_pyio.py
@@ -10,16 +10,16 @@
import sys
# Import _thread instead of threading to reduce startup cost
from _thread import allocate_lock as Lock
-if sys.platform in {'win32', 'cygwin'}:
+if sys.platform in {"win32", "cygwin"}:
from msvcrt import setmode as _setmode
else:
_setmode = None
import io
-from io import (__all__, SEEK_SET, SEEK_CUR, SEEK_END)
+from io import (SEEK_SET, SEEK_CUR, SEEK_END)
valid_seek_flags = {0, 1, 2} # Hardwired values
-if hasattr(os, 'SEEK_HOLE') :
+if hasattr(os, "SEEK_HOLE") :
valid_seek_flags.add(os.SEEK_HOLE)
valid_seek_flags.add(os.SEEK_DATA)
@@ -319,7 +319,7 @@ def __getattr__(name):
# _pyio.open is a Python function. In Python 3.10, _pyio.open() is now
# a static method, and builtins.open() is now io.open().
import warnings
- warnings.warn('OpenWrapper is deprecated, use open instead',
+ warnings.warn("OpenWrapper is deprecated, use open instead",
DeprecationWarning, stacklevel=2)
global OpenWrapper
OpenWrapper = open
@@ -765,7 +765,7 @@ def readinto1(self, b):
def _readinto(self, b, read1):
if not isinstance(b, memoryview):
b = memoryview(b)
- b = b.cast('B')
+ b = b.cast("B")
if read1:
data = self.read1(len(b))
@@ -985,7 +985,7 @@ def write(self, b):
if pos > len(self._buffer):
# Inserts null bytes between the current end of the file
# and the new write position.
- padding = b'\x00' * (pos - len(self._buffer))
+ padding = b"\x00" * (pos - len(self._buffer))
self._buffer += padding
self._buffer[pos:pos + n] = b
self._pos += n
@@ -1103,7 +1103,7 @@ def _read_unlocked(self, n=None):
# Special case for when the number of bytes to read is unspecified.
if n is None or n == -1:
self._reset_read_buf()
- if hasattr(self.raw, 'readall'):
+ if hasattr(self.raw, "readall"):
chunk = self.raw.readall()
if chunk is None:
return buf[pos:] or None
@@ -1195,7 +1195,7 @@ def _readinto(self, buf, read1):
buf = memoryview(buf)
if buf.nbytes == 0:
return 0
- buf = buf.cast('B')
+ buf = buf.cast("B")
written = 0
with self._read_lock:
@@ -1505,7 +1505,7 @@ class FileIO(RawIOBase):
_seekable = None
_closefd = True
- def __init__(self, file, mode='r', closefd=True, opener=None):
+ def __init__(self, file, mode="r", closefd=True, opener=None):
"""Open a file. The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
writing, exclusive creation or appending. The file will be created if it
doesn't exist when opened for writing or appending; it will be truncated
@@ -1527,38 +1527,38 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
self._fd = -1
if isinstance(file, float):
- raise TypeError('integer argument expected, got float')
+ raise TypeError("integer argument expected, got float")
if isinstance(file, int):
fd = file
if fd < 0:
- raise ValueError('negative file descriptor')
+ raise ValueError("negative file descriptor")
else:
fd = -1
if not isinstance(mode, str):
- raise TypeError('invalid mode: %s' % (mode,))
- if not set(mode) <= set('xrwab+'):
- raise ValueError('invalid mode: %s' % (mode,))
- if sum(c in 'rwax' for c in mode) != 1 or mode.count('+') > 1:
- raise ValueError('Must have exactly one of create/read/write/append '
- 'mode and at most one plus')
-
- if 'x' in mode:
+ raise TypeError("invalid mode: %s" % (mode,))
+ if not set(mode) <= set("xrwab+"):
+ raise ValueError("invalid mode: %s" % (mode,))
+ if sum(c in "rwax" for c in mode) != 1 or mode.count("+") > 1:
+ raise ValueError("Must have exactly one of create/read/write/append "
+ "mode and at most one plus")
+
+ if "x" in mode:
self._created = True
self._writable = True
flags = os.O_EXCL | os.O_CREAT
- elif 'r' in mode:
+ elif "r" in mode:
self._readable = True
flags = 0
- elif 'w' in mode:
+ elif "w" in mode:
self._writable = True
flags = os.O_CREAT | os.O_TRUNC
- elif 'a' in mode:
+ elif "a" in mode:
self._writable = True
self._appending = True
flags = os.O_APPEND | os.O_CREAT
- if '+' in mode:
+ if "+" in mode:
self._readable = True
self._writable = True
@@ -1569,25 +1569,25 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
else:
flags |= os.O_WRONLY
- flags |= getattr(os, 'O_BINARY', 0)
+ flags |= getattr(os, "O_BINARY", 0)
- noinherit_flag = (getattr(os, 'O_NOINHERIT', 0) or
- getattr(os, 'O_CLOEXEC', 0))
+ noinherit_flag = (getattr(os, "O_NOINHERIT", 0) or
+ getattr(os, "O_CLOEXEC", 0))
flags |= noinherit_flag
owned_fd = None
try:
if fd < 0:
if not closefd:
- raise ValueError('Cannot use closefd=False with file name')
+ raise ValueError("Cannot use closefd=False with file name")
if opener is None:
fd = os.open(file, flags, 0o666)
else:
fd = opener(file, flags)
if not isinstance(fd, int):
- raise TypeError('expected integer from opener')
+ raise TypeError("expected integer from opener")
if fd < 0:
- raise OSError('Negative file descriptor')
+ raise OSError("Negative file descriptor")
owned_fd = fd
if not noinherit_flag:
os.set_inheritable(fd, False)
@@ -1602,7 +1602,7 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
# Ignore the AttributeError if stat.S_ISDIR or errno.EISDIR
# don't exist.
pass
- self._blksize = getattr(fdfstat, 'st_blksize', 0)
+ self._blksize = getattr(fdfstat, "st_blksize", 0)
if self._blksize <= 1:
self._blksize = DEFAULT_BUFFER_SIZE
@@ -1629,7 +1629,7 @@ def __init__(self, file, mode='r', closefd=True, opener=None):
def __del__(self):
if self._fd >= 0 and self._closefd and not self.closed:
import warnings
- warnings.warn('unclosed file %r' % (self,), ResourceWarning,
+ warnings.warn("unclosed file %r" % (self,), ResourceWarning,
stacklevel=2, source=self)
self.close()
@@ -1637,26 +1637,26 @@ def __getstate__(self):
raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")
def __repr__(self):
- class_name = '%s.%s' % (self.__class__.__module__,
+ class_name = "%s.%s" % (self.__class__.__module__,
self.__class__.__qualname__)
if self.closed:
- return '<%s [closed]>' % class_name
+ return "<%s [closed]>" % class_name
try:
name = self.name
except AttributeError:
- return ('<%s fd=%d mode=%r closefd=%r>' %
+ return ("<%s fd=%d mode=%r closefd=%r>" %
(class_name, self._fd, self.mode, self._closefd))
else:
- return ('<%s name=%r mode=%r closefd=%r>' %
+ return ("<%s name=%r mode=%r closefd=%r>" %
(class_name, name, self.mode, self._closefd))
def _checkReadable(self):
if not self._readable:
- raise UnsupportedOperation('File not open for reading')
+ raise UnsupportedOperation("File not open for reading")
def _checkWritable(self, msg=None):
if not self._writable:
- raise UnsupportedOperation('File not open for writing')
+ raise UnsupportedOperation("File not open for writing")
def read(self, size=None):
"""Read at most size bytes, returned as bytes.
@@ -1711,7 +1711,7 @@ def readall(self):
def readinto(self, b):
"""Same as RawIOBase.readinto()."""
- m = memoryview(b).cast('B')
+ m = memoryview(b).cast("B")
data = self.read(len(m))
n = len(data)
m[:n] = data
@@ -1743,7 +1743,7 @@ def seek(self, pos, whence=SEEK_SET):
Note that not all file objects are seekable.
"""
if isinstance(pos, float):
- raise TypeError('an integer is required')
+ raise TypeError("an integer is required")
self._checkClosed()
return os.lseek(self._fd, pos, whence)
@@ -1822,21 +1822,21 @@ def mode(self):
"""String giving the file mode"""
if self._created:
if self._readable:
- return 'xb+'
+ return "xb+"
else:
- return 'xb'
+ return "xb"
elif self._appending:
if self._readable:
- return 'ab+'
+ return "ab+"
else:
- return 'ab'
+ return "ab"
elif self._readable:
if self._writable:
- return 'rb+'
+ return "rb+"
else:
- return 'rb'
+ return "rb"
else:
- return 'wb'
+ return "wb"
class TextIOBase(IOBase):
@@ -1913,7 +1913,7 @@ class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
translate=False, it ensures that the newline sequence is returned in
one piece.
"""
- def __init__(self, decoder, translate, errors='strict'):
+ def __init__(self, decoder, translate, errors="strict"):
codecs.IncrementalDecoder.__init__(self, errors=errors)
self.translate = translate
self.decoder = decoder
@@ -1937,9 +1937,9 @@ def decode(self, input, final=False):
self.pendingcr = True
# Record which newlines are read
- crlf = output.count('\r\n')
- cr = output.count('\r') - crlf
- lf = output.count('\n') - crlf
+ crlf = output.count("\r\n")
+ cr = output.count("\r") - crlf
+ lf = output.count("\n") - crlf
self.seennl |= (lf and self._LF) | (cr and self._CR) \
| (crlf and self._CRLF)
@@ -2061,11 +2061,11 @@ def __init__(self, buffer, encoding=None, errors=None, newline=None,
codecs.lookup_error(errors)
self._buffer = buffer
- self._decoded_chars = '' # buffer for text returned from decoder
+ self._decoded_chars = "" # buffer for text returned from decoder
self._decoded_chars_used = 0 # offset into _decoded_chars for read()
self._snapshot = None # info for reconstructing decoder state
self._seekable = self._telling = self.buffer.seekable()
- self._has_read1 = hasattr(self.buffer, 'read1')
+ self._has_read1 = hasattr(self.buffer, "read1")
self._configure(encoding, errors, newline,
line_buffering, write_through)
@@ -2086,7 +2086,7 @@ def _configure(self, encoding=None, errors=None, newline=None,
self._readuniversal = not newline
self._readtranslate = newline is None
self._readnl = newline
- self._writetranslate = newline != ''
+ self._writetranslate = newline != ""
self._writenl = newline or os.linesep
self._line_buffering = line_buffering
@@ -2166,7 +2166,7 @@ def reconfigure(self, *,
if encoding is None:
errors = self._errors
else:
- errors = 'strict'
+ errors = "strict"
elif not isinstance(errors, str):
raise TypeError("invalid errors: %r" % errors)
@@ -2226,7 +2226,7 @@ def isatty(self):
return self.buffer.isatty()
def write(self, s):
- 'Write data, where s is a str'
+ "Write data, where s is a str"
if self.closed:
raise ValueError("write to closed file")
if not isinstance(s, str):
@@ -2242,7 +2242,7 @@ def write(self, s):
self.buffer.write(b)
if self._line_buffering and (haslf or "\r" in s):
self.flush()
- self._set_decoded_chars('')
+ self._set_decoded_chars("")
self._snapshot = None
if self._decoder:
self._decoder.reset()
@@ -2383,7 +2383,7 @@ def tell(self):
skip_back = 1
assert skip_bytes <= len(next_input)
while skip_bytes > 0:
- decoder.setstate((b'', dec_flags))
+ decoder.setstate((b"", dec_flags))
# Decode up to temptative start point
n = len(decoder.decode(next_input[:skip_bytes]))
if n <= chars_to_skip:
@@ -2402,7 +2402,7 @@ def tell(self):
skip_back = skip_back * 2
else:
skip_bytes = 0
- decoder.setstate((b'', dec_flags))
+ decoder.setstate((b"", dec_flags))
# Note our initial start point.
start_pos = position + skip_bytes
@@ -2432,7 +2432,7 @@ def tell(self):
break
else:
# We didn't get enough decoded data; signal EOF to get more.
- chars_decoded += len(decoder.decode(b'', final=True))
+ chars_decoded += len(decoder.decode(b"", final=True))
need_eof = True
if chars_decoded < chars_to_skip:
raise OSError("can't reconstruct logical file position")
@@ -2487,7 +2487,7 @@ def _reset_encoder(position):
raise UnsupportedOperation("can't do nonzero end-relative seeks")
self.flush()
position = self.buffer.seek(0, whence)
- self._set_decoded_chars('')
+ self._set_decoded_chars("")
self._snapshot = None
if self._decoder:
self._decoder.reset()
@@ -2506,7 +2506,7 @@ def _reset_encoder(position):
# Seek back to the safe start point.
self.buffer.seek(start_pos)
- self._set_decoded_chars('')
+ self._set_decoded_chars("")
self._snapshot = None
# Restore the decoder to its state from the safe start point.
@@ -2514,8 +2514,8 @@ def _reset_encoder(position):
self._decoder.reset()
elif self._decoder or dec_flags or chars_to_skip:
self._decoder = self._decoder or self._get_decoder()
- self._decoder.setstate((b'', dec_flags))
- self._snapshot = (dec_flags, b'')
+ self._decoder.setstate((b"", dec_flags))
+ self._snapshot = (dec_flags, b"")
if chars_to_skip:
# Just like _read_chunk, feed the decoder and save a snapshot.
@@ -2548,7 +2548,7 @@ def read(self, size=None):
# Read everything.
result = (self._get_decoded_chars() +
decoder.decode(self.buffer.read(), final=True))
- self._set_decoded_chars('')
+ self._set_decoded_chars("")
self._snapshot = None
return result
else:
@@ -2594,7 +2594,7 @@ def readline(self, size=None):
while True:
if self._readtranslate:
# Newlines are already translated, only search for \n
- pos = line.find('\n', start)
+ pos = line.find("\n", start)
if pos >= 0:
endpos = pos + 1
break
@@ -2651,7 +2651,7 @@ def readline(self, size=None):
line += self._get_decoded_chars()
else:
# end of file
- self._set_decoded_chars('')
+ self._set_decoded_chars("")
self._snapshot = None
return line
diff --git a/.venv3.10/Lib/_sitebuiltins.py b/.venv3.10/Lib/_sitebuiltins.py
index c66269a5..4deabcd9 100644
--- a/.venv3.10/Lib/_sitebuiltins.py
+++ b/.venv3.10/Lib/_sitebuiltins.py
@@ -15,7 +15,7 @@ def __init__(self, name, eof):
self.name = name
self.eof = eof
def __repr__(self):
- return 'Use %s() or %s to exit' % (self.name, self.eof)
+ return "Use %s() or %s to exit" % (self.name, self.eof)
def __call__(self, code=None):
# Shells like IDLE catch the SystemExit, but listen when their
# stdin wrapper is closed.
@@ -47,14 +47,14 @@ def __setup(self):
data = None
for filename in self.__filenames:
try:
- with open(filename, encoding='utf-8') as fp:
+ with open(filename, encoding="utf-8") as fp:
data = fp.read()
break
except OSError:
pass
if not data:
data = self.__data
- self.__lines = data.split('\n')
+ self.__lines = data.split("\n")
self.__linecnt = len(self.__lines)
def __repr__(self):
@@ -66,7 +66,7 @@ def __repr__(self):
def __call__(self):
self.__setup()
- prompt = 'Hit Return for more, or q (and Return) to quit: '
+ prompt = "Hit Return for more, or q (and Return) to quit: "
lineno = 0
while 1:
try:
@@ -79,9 +79,9 @@ def __call__(self):
key = None
while key is None:
key = input(prompt)
- if key not in ('', 'q'):
+ if key not in ("", "q"):
key = None
- if key == 'q':
+ if key == "q":
break
diff --git a/.venv3.10/Lib/_strptime.py b/.venv3.10/Lib/_strptime.py
index b97dfcce..815e3f9d 100644
--- a/.venv3.10/Lib/_strptime.py
+++ b/.venv3.10/Lib/_strptime.py
@@ -117,17 +117,17 @@ def __calc_date_time(self):
date_time[0] = time.strftime("%c", time_tuple).lower()
date_time[1] = time.strftime("%x", time_tuple).lower()
date_time[2] = time.strftime("%X", time_tuple).lower()
- replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'),
- (self.f_month[3], '%B'), (self.a_weekday[2], '%a'),
- (self.a_month[3], '%b'), (self.am_pm[1], '%p'),
- ('1999', '%Y'), ('99', '%y'), ('22', '%H'),
- ('44', '%M'), ('55', '%S'), ('76', '%j'),
- ('17', '%d'), ('03', '%m'), ('3', '%m'),
+ replacement_pairs = [("%", "%%"), (self.f_weekday[2], "%A"),
+ (self.f_month[3], "%B"), (self.a_weekday[2], "%a"),
+ (self.a_month[3], "%b"), (self.am_pm[1], "%p"),
+ ("1999", "%Y"), ("99", "%y"), ("22", "%H"),
+ ("44", "%M"), ("55", "%S"), ("76", "%j"),
+ ("17", "%d"), ("03", "%m"), ("3", "%m"),
# '3' needed for when no leading zero.
- ('2', '%w'), ('10', '%I')]
+ ("2", "%w"), ("10", "%I")]
replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone
for tz in tz_values])
- for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')):
+ for offset,directive in ((0,"%c"), (1,"%x"), (2,"%X")):
current_format = date_time[offset]
for old, new in replacement_pairs:
# Must deal with possible lack of locale info
@@ -140,11 +140,11 @@ def __calc_date_time(self):
# 2005-01-03 occurs before the first Monday of the year. Otherwise
# %U is used.
time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0))
- if '00' in time.strftime(directive, time_tuple):
- U_W = '%W'
+ if "00" in time.strftime(directive, time_tuple):
+ U_W = "%W"
else:
- U_W = '%U'
- date_time[offset] = current_format.replace('11', U_W)
+ U_W = "%U"
+ date_time[offset] = current_format.replace("11", U_W)
self.LC_date_time = date_time[0]
self.LC_date = date_time[1]
self.LC_time = date_time[2]
@@ -183,38 +183,38 @@ def __init__(self, locale_time=None):
base = super()
base.__init__({
# The " [1-9]" part of the regex is to make %c from ANSI C work
- 'd': r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])",
- 'f': r"(?P[0-9]{1,6})",
- 'H': r"(?P2[0-3]|[0-1]\d|\d)",
- 'I': r"(?P1[0-2]|0[1-9]|[1-9])",
- 'G': r"(?P\d\d\d\d)",
- 'j': r"(?P36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])",
- 'm': r"(?P1[0-2]|0[1-9]|[1-9])",
- 'M': r"(?P[0-5]\d|\d)",
- 'S': r"(?P6[0-1]|[0-5]\d|\d)",
- 'U': r"(?P5[0-3]|[0-4]\d|\d)",
- 'w': r"(?P[0-6])",
- 'u': r"(?P[1-7])",
- 'V': r"(?P5[0-3]|0[1-9]|[1-4]\d|\d)",
+ "d": r"(?P3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])",
+ "f": r"(?P[0-9]{1,6})",
+ "H": r"(?P2[0-3]|[0-1]\d|\d)",
+ "I": r"(?P1[0-2]|0[1-9]|[1-9])",
+ "G": r"(?P\d\d\d\d)",
+ "j": r"(?P36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])",
+ "m": r"(?P1[0-2]|0[1-9]|[1-9])",
+ "M": r"(?P[0-5]\d|\d)",
+ "S": r"(?P6[0-1]|[0-5]\d|\d)",
+ "U": r"(?P5[0-3]|[0-4]\d|\d)",
+ "w": r"(?P[0-6])",
+ "u": r"(?P[1-7])",
+ "V": r"(?P5[0-3]|0[1-9]|[1-4]\d|\d)",
# W is set below by using 'U'
- 'y': r"(?P\d\d)",
+ "y": r"(?P\d\d)",
#XXX: Does 'Y' need to worry about having less or more than
# 4 digits?
- 'Y': r"(?P\d\d\d\d)",
- 'z': r"(?P[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|(?-i:Z))",
- 'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),
- 'a': self.__seqToRE(self.locale_time.a_weekday, 'a'),
- 'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'),
- 'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'),
- 'p': self.__seqToRE(self.locale_time.am_pm, 'p'),
- 'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone
+ "Y": r"(?P\d\d\d\d)",
+ "z": r"(?P[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|(?-i:Z))",
+ "A": self.__seqToRE(self.locale_time.f_weekday, "A"),
+ "a": self.__seqToRE(self.locale_time.a_weekday, "a"),
+ "B": self.__seqToRE(self.locale_time.f_month[1:], "B"),
+ "b": self.__seqToRE(self.locale_time.a_month[1:], "b"),
+ "p": self.__seqToRE(self.locale_time.am_pm, "p"),
+ "Z": self.__seqToRE((tz for tz_names in self.locale_time.timezone
for tz in tz_names),
- 'Z'),
- '%': '%'})
- base.__setitem__('W', base.__getitem__('U').replace('U', 'W'))
- base.__setitem__('c', self.pattern(self.locale_time.LC_date_time))
- base.__setitem__('x', self.pattern(self.locale_time.LC_date))
- base.__setitem__('X', self.pattern(self.locale_time.LC_time))
+ "Z"),
+ "%": "%"})
+ base.__setitem__("W", base.__getitem__("U").replace("U", "W"))
+ base.__setitem__("c", self.pattern(self.locale_time.LC_date_time))
+ base.__setitem__("x", self.pattern(self.locale_time.LC_date))
+ base.__setitem__("X", self.pattern(self.locale_time.LC_time))
def __seqToRE(self, to_convert, directive):
"""Convert a list to a regex string for matching a directive.
@@ -227,13 +227,13 @@ def __seqToRE(self, to_convert, directive):
"""
to_convert = sorted(to_convert, key=len, reverse=True)
for value in to_convert:
- if value != '':
+ if value != "":
break
else:
- return ''
- regex = '|'.join(re_escape(stuff) for stuff in to_convert)
- regex = '(?P<%s>%s' % (directive, regex)
- return '%s)' % regex
+ return ""
+ regex = "|".join(re_escape(stuff) for stuff in to_convert)
+ regex = "(?P<%s>%s" % (directive, regex)
+ return "%s)" % regex
def pattern(self, format):
"""Return regex pattern for the format string.
@@ -242,16 +242,16 @@ def pattern(self, format):
regex syntax are escaped.
"""
- processed_format = ''
+ processed_format = ""
# The sub() call escapes all characters that might be misconstrued
# as regex syntax. Cannot use re.escape since we have to deal with
# format directives (%m, etc.).
regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
format = regex_chars.sub(r"\\\1", format)
- whitespace_replacement = re_compile(r'\s+')
- format = whitespace_replacement.sub(r'\\s+', format)
- while '%' in format:
- directive_index = format.index('%')+1
+ whitespace_replacement = re_compile(r"\s+")
+ format = whitespace_replacement.sub(r"\\s+", format)
+ while "%" in format:
+ directive_index = format.index("%")+1
processed_format = "%s%s%s" % (processed_format,
format[:directive_index-1],
self[format[directive_index]])
@@ -372,8 +372,8 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
# handled by making out of other directives
# U, W
# worthless without day of the week
- if group_key == 'y':
- year = int(found_dict['y'])
+ if group_key == "y":
+ year = int(found_dict["y"])
# Open Group specification for strptime() states that a %y
#value in the range of [00, 68] is in the century 2000, while
#[69,99] is in the century 1900
@@ -381,25 +381,25 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
year += 2000
else:
year += 1900
- elif group_key == 'Y':
- year = int(found_dict['Y'])
- elif group_key == 'G':
- iso_year = int(found_dict['G'])
- elif group_key == 'm':
- month = int(found_dict['m'])
- elif group_key == 'B':
- month = locale_time.f_month.index(found_dict['B'].lower())
- elif group_key == 'b':
- month = locale_time.a_month.index(found_dict['b'].lower())
- elif group_key == 'd':
- day = int(found_dict['d'])
- elif group_key == 'H':
- hour = int(found_dict['H'])
- elif group_key == 'I':
- hour = int(found_dict['I'])
- ampm = found_dict.get('p', '').lower()
+ elif group_key == "Y":
+ year = int(found_dict["Y"])
+ elif group_key == "G":
+ iso_year = int(found_dict["G"])
+ elif group_key == "m":
+ month = int(found_dict["m"])
+ elif group_key == "B":
+ month = locale_time.f_month.index(found_dict["B"].lower())
+ elif group_key == "b":
+ month = locale_time.a_month.index(found_dict["b"].lower())
+ elif group_key == "d":
+ day = int(found_dict["d"])
+ elif group_key == "H":
+ hour = int(found_dict["H"])
+ elif group_key == "I":
+ hour = int(found_dict["I"])
+ ampm = found_dict.get("p", "").lower()
# If there was no AM/PM indicator, we'll treat this like AM
- if ampm in ('', locale_time.am_pm[0]):
+ if ampm in ("", locale_time.am_pm[0]):
# We're in AM so the hour is correct unless we're
# looking at 12 midnight.
# 12 midnight == 12 AM == hour 0
@@ -411,49 +411,49 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
# 12 noon == 12 PM == hour 12
if hour != 12:
hour += 12
- elif group_key == 'M':
- minute = int(found_dict['M'])
- elif group_key == 'S':
- second = int(found_dict['S'])
- elif group_key == 'f':
- s = found_dict['f']
+ elif group_key == "M":
+ minute = int(found_dict["M"])
+ elif group_key == "S":
+ second = int(found_dict["S"])
+ elif group_key == "f":
+ s = found_dict["f"]
# Pad to always return microseconds.
s += "0" * (6 - len(s))
fraction = int(s)
- elif group_key == 'A':
- weekday = locale_time.f_weekday.index(found_dict['A'].lower())
- elif group_key == 'a':
- weekday = locale_time.a_weekday.index(found_dict['a'].lower())
- elif group_key == 'w':
- weekday = int(found_dict['w'])
+ elif group_key == "A":
+ weekday = locale_time.f_weekday.index(found_dict["A"].lower())
+ elif group_key == "a":
+ weekday = locale_time.a_weekday.index(found_dict["a"].lower())
+ elif group_key == "w":
+ weekday = int(found_dict["w"])
if weekday == 0:
weekday = 6
else:
weekday -= 1
- elif group_key == 'u':
- weekday = int(found_dict['u'])
+ elif group_key == "u":
+ weekday = int(found_dict["u"])
weekday -= 1
- elif group_key == 'j':
- julian = int(found_dict['j'])
- elif group_key in ('U', 'W'):
+ elif group_key == "j":
+ julian = int(found_dict["j"])
+ elif group_key in ("U", "W"):
week_of_year = int(found_dict[group_key])
- if group_key == 'U':
+ if group_key == "U":
# U starts week on Sunday.
week_of_year_start = 6
else:
# W starts week on Monday.
week_of_year_start = 0
- elif group_key == 'V':
- iso_week = int(found_dict['V'])
- elif group_key == 'z':
- z = found_dict['z']
- if z == 'Z':
+ elif group_key == "V":
+ iso_week = int(found_dict["V"])
+ elif group_key == "z":
+ z = found_dict["z"]
+ if z == "Z":
gmtoff = 0
else:
- if z[3] == ':':
+ if z[3] == ":":
z = z[:3] + z[4:]
if len(z) > 5:
- if z[5] != ':':
+ if z[5] != ":":
msg = f"Inconsistent use of : in {found_dict['z']}"
raise ValueError(msg)
z = z[:5] + z[6:]
@@ -468,10 +468,10 @@ def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
if z.startswith("-"):
gmtoff = -gmtoff
gmtoff_fraction = -gmtoff_fraction
- elif group_key == 'Z':
+ elif group_key == "Z":
# Since -1 is default value only need to worry about setting tz if
# it can be something other than -1.
- found_zone = found_dict['Z'].lower()
+ found_zone = found_dict["Z"].lower()
for value, tz_values in enumerate(locale_time.timezone):
if found_zone in tz_values:
# Deal with bad locale setup where timezone names are the
diff --git a/.venv3.10/Lib/_threading_local.py b/.venv3.10/Lib/_threading_local.py
index b006d76c..9b4996e6 100644
--- a/.venv3.10/Lib/_threading_local.py
+++ b/.venv3.10/Lib/_threading_local.py
@@ -145,13 +145,13 @@
class _localimpl:
"""A class managing thread-local dicts"""
- __slots__ = 'key', 'dicts', 'localargs', 'locallock', '__weakref__'
+ __slots__ = "key", "dicts", "localargs", "locallock", "__weakref__"
def __init__(self):
# The key used in the Thread objects' attribute dicts.
# We keep it a string for speed but make it unlikely to clash with
# a "real" attribute.
- self.key = '_threading_local._localimpl.' + str(id(self))
+ self.key = "_threading_local._localimpl." + str(id(self))
# { id(Thread) -> (ref(Thread), thread-local dict) }
self.dicts = {}
@@ -189,7 +189,7 @@ def thread_deleted(_, idt=idt):
@contextmanager
def _patch(self):
- impl = object.__getattribute__(self, '_local__impl')
+ impl = object.__getattribute__(self, "_local__impl")
try:
dct = impl.get_dict()
except KeyError:
@@ -197,12 +197,12 @@ def _patch(self):
args, kw = impl.localargs
self.__init__(*args, **kw)
with impl.locallock:
- object.__setattr__(self, '__dict__', dct)
+ object.__setattr__(self, "__dict__", dct)
yield
class local:
- __slots__ = '_local__impl', '__dict__'
+ __slots__ = "_local__impl", "__dict__"
def __new__(cls, /, *args, **kw):
if (args or kw) and (cls.__init__ is object.__init__):
@@ -211,7 +211,7 @@ def __new__(cls, /, *args, **kw):
impl = _localimpl()
impl.localargs = (args, kw)
impl.locallock = RLock()
- object.__setattr__(self, '_local__impl', impl)
+ object.__setattr__(self, "_local__impl", impl)
# We need to create the thread dict in anticipation of
# __init__ being called, to make sure we don't call it
# again ourselves.
@@ -223,7 +223,7 @@ def __getattribute__(self, name):
return object.__getattribute__(self, name)
def __setattr__(self, name, value):
- if name == '__dict__':
+ if name == "__dict__":
raise AttributeError(
"%r object attribute '__dict__' is read-only"
% self.__class__.__name__)
@@ -231,7 +231,7 @@ def __setattr__(self, name, value):
return object.__setattr__(self, name, value)
def __delattr__(self, name):
- if name == '__dict__':
+ if name == "__dict__":
raise AttributeError(
"%r object attribute '__dict__' is read-only"
% self.__class__.__name__)
diff --git a/.venv3.10/Lib/_weakrefset.py b/.venv3.10/Lib/_weakrefset.py
index 2a276843..2fc497d4 100644
--- a/.venv3.10/Lib/_weakrefset.py
+++ b/.venv3.10/Lib/_weakrefset.py
@@ -5,7 +5,7 @@
from _weakref import ref
from types import GenericAlias
-__all__ = ['WeakSet']
+__all__ = ["WeakSet"]
class _IterationGuard:
@@ -81,7 +81,7 @@ def __contains__(self, item):
def __reduce__(self):
return (self.__class__, (list(self),),
- getattr(self, '__dict__', None))
+ getattr(self, "__dict__", None))
def add(self, item):
if self._pending_removals:
@@ -103,7 +103,7 @@ def pop(self):
try:
itemref = self.data.pop()
except KeyError:
- raise KeyError('pop from empty WeakSet') from None
+ raise KeyError("pop from empty WeakSet") from None
item = itemref()
if item is not None:
return item
diff --git a/.venv3.10/Lib/abc.py b/.venv3.10/Lib/abc.py
index 3c552ceb..3d46ddcd 100644
--- a/.venv3.10/Lib/abc.py
+++ b/.venv3.10/Lib/abc.py
@@ -87,7 +87,7 @@ def my_abstract_property(self):
_reset_registry, _reset_caches)
except ImportError:
from _py_abc import ABCMeta, get_cache_token
- ABCMeta.__module__ = 'abc'
+ ABCMeta.__module__ = "abc"
else:
class ABCMeta(type):
"""Metaclass for defining Abstract Base Classes (ABCs).
@@ -159,7 +159,7 @@ class after this function is called.
If cls is not an instance of ABCMeta, does nothing.
"""
- if not hasattr(cls, '__abstractmethods__'):
+ if not hasattr(cls, "__abstractmethods__"):
# We check for __abstractmethods__ here because cls might by a C
# implementation or a python implementation (especially during
# testing), and we want to handle both cases.
@@ -169,7 +169,7 @@ class after this function is called.
# Check the existing abstract methods of the parents, keep only the ones
# that are not implemented.
for scls in cls.__bases__:
- for name in getattr(scls, '__abstractmethods__', ()):
+ for name in getattr(scls, "__abstractmethods__", ()):
value = getattr(cls, name, None)
if getattr(value, "__isabstractmethod__", False):
abstracts.add(name)
diff --git a/.venv3.10/Lib/aifc.py b/.venv3.10/Lib/aifc.py
index ed5da7d8..f6ba19af 100644
--- a/.venv3.10/Lib/aifc.py
+++ b/.venv3.10/Lib/aifc.py
@@ -147,32 +147,32 @@ class Error(Exception):
def _read_long(file):
try:
- return struct.unpack('>l', file.read(4))[0]
+ return struct.unpack(">l", file.read(4))[0]
except struct.error:
raise EOFError from None
def _read_ulong(file):
try:
- return struct.unpack('>L', file.read(4))[0]
+ return struct.unpack(">L", file.read(4))[0]
except struct.error:
raise EOFError from None
def _read_short(file):
try:
- return struct.unpack('>h', file.read(2))[0]
+ return struct.unpack(">h", file.read(2))[0]
except struct.error:
raise EOFError from None
def _read_ushort(file):
try:
- return struct.unpack('>H', file.read(2))[0]
+ return struct.unpack(">H", file.read(2))[0]
except struct.error:
raise EOFError from None
def _read_string(file):
length = ord(file.read(1))
if length == 0:
- data = b''
+ data = b""
else:
data = file.read(length)
if length & 1 == 0:
@@ -199,24 +199,24 @@ def _read_float(f): # 10 bytes
return sign * f
def _write_short(f, x):
- f.write(struct.pack('>h', x))
+ f.write(struct.pack(">h", x))
def _write_ushort(f, x):
- f.write(struct.pack('>H', x))
+ f.write(struct.pack(">H", x))
def _write_long(f, x):
- f.write(struct.pack('>l', x))
+ f.write(struct.pack(">l", x))
def _write_ulong(f, x):
- f.write(struct.pack('>L', x))
+ f.write(struct.pack(">L", x))
def _write_string(f, s):
if len(s) > 255:
raise ValueError("string exceeds maximum pstring length")
- f.write(struct.pack('B', len(s)))
+ f.write(struct.pack("B", len(s)))
f.write(s)
if len(s) & 1 == 0:
- f.write(b'\x00')
+ f.write(b"\x00")
def _write_float(f, x):
import math
@@ -254,13 +254,13 @@ def _write_float(f, x):
from chunk import Chunk
from collections import namedtuple
-_aifc_params = namedtuple('_aifc_params',
- 'nchannels sampwidth framerate nframes comptype compname')
+_aifc_params = namedtuple("_aifc_params",
+ "nchannels sampwidth framerate nframes comptype compname")
-_aifc_params.nchannels.__doc__ = 'Number of audio channels (1 for mono, 2 for stereo)'
-_aifc_params.sampwidth.__doc__ = 'Sample width in bytes'
-_aifc_params.framerate.__doc__ = 'Sampling frequency'
-_aifc_params.nframes.__doc__ = 'Number of audio frames'
+_aifc_params.nchannels.__doc__ = "Number of audio channels (1 for mono, 2 for stereo)"
+_aifc_params.sampwidth.__doc__ = "Sample width in bytes"
+_aifc_params.framerate.__doc__ = "Sampling frequency"
+_aifc_params.nframes.__doc__ = "Number of audio frames"
_aifc_params.comptype.__doc__ = 'Compression type ("NONE" for AIFF files)'
_aifc_params.compname.__doc__ = ("""\
A human-readable version of the compression type
@@ -312,15 +312,15 @@ def initfp(self, file):
self._soundpos = 0
self._file = file
chunk = Chunk(file)
- if chunk.getname() != b'FORM':
- raise Error('file does not start with FORM id')
+ if chunk.getname() != b"FORM":
+ raise Error("file does not start with FORM id")
formdata = chunk.read(4)
- if formdata == b'AIFF':
+ if formdata == b"AIFF":
self._aifc = 0
- elif formdata == b'AIFC':
+ elif formdata == b"AIFC":
self._aifc = 1
else:
- raise Error('not an AIFF or AIFF-C file')
+ raise Error("not an AIFF or AIFF-C file")
self._comm_chunk_read = 0
self._ssnd_chunk = None
while 1:
@@ -330,24 +330,24 @@ def initfp(self, file):
except EOFError:
break
chunkname = chunk.getname()
- if chunkname == b'COMM':
+ if chunkname == b"COMM":
self._read_comm_chunk(chunk)
self._comm_chunk_read = 1
- elif chunkname == b'SSND':
+ elif chunkname == b"SSND":
self._ssnd_chunk = chunk
dummy = chunk.read(8)
self._ssnd_seek_needed = 0
- elif chunkname == b'FVER':
+ elif chunkname == b"FVER":
self._version = _read_ulong(chunk)
- elif chunkname == b'MARK':
+ elif chunkname == b"MARK":
self._readmark(chunk)
chunk.skip()
if not self._comm_chunk_read or not self._ssnd_chunk:
- raise Error('COMM chunk and/or SSND chunk missing')
+ raise Error("COMM chunk and/or SSND chunk missing")
def __init__(self, f):
if isinstance(f, str):
- file_object = builtins.open(f, 'rb')
+ file_object = builtins.open(f, "rb")
try:
self.initfp(file_object)
except:
@@ -417,11 +417,11 @@ def getmark(self, id):
for marker in self._markers:
if id == marker[0]:
return marker
- raise Error('marker {0!r} does not exist'.format(id))
+ raise Error("marker {0!r} does not exist".format(id))
def setpos(self, pos):
if pos < 0 or pos > self._nframes:
- raise Error('position not in range')
+ raise Error("position not in range")
self._soundpos = pos
self._ssnd_seek_needed = 1
@@ -434,7 +434,7 @@ def readframes(self, nframes):
self._ssnd_chunk.seek(pos + 8)
self._ssnd_seek_needed = 0
if nframes == 0:
- return b''
+ return b""
data = self._ssnd_chunk.read(nframes * self._framesize)
if self._convert and data:
data = self._convert(data)
@@ -456,7 +456,7 @@ def _ulaw2lin(self, data):
def _adpcm2lin(self, data):
import audioop
- if not hasattr(self, '_adpcmstate'):
+ if not hasattr(self, "_adpcmstate"):
# first time
self._adpcmstate = None
data, self._adpcmstate = audioop.adpcm2lin(data, 2, self._adpcmstate)
@@ -468,16 +468,16 @@ def _read_comm_chunk(self, chunk):
self._sampwidth = (_read_short(chunk) + 7) // 8
self._framerate = int(_read_float(chunk))
if self._sampwidth <= 0:
- raise Error('bad sample width')
+ raise Error("bad sample width")
if self._nchannels <= 0:
- raise Error('bad # of channels')
+ raise Error("bad # of channels")
self._framesize = self._nchannels * self._sampwidth
if self._aifc:
#DEBUG: SGI's soundeditor produces a bad size :-(
kludge = 0
if chunk.chunksize == 18:
kludge = 1
- warnings.warn('Warning: bad COMM chunk size')
+ warnings.warn("Warning: bad COMM chunk size")
chunk.chunksize = 23
#DEBUG end
self._comptype = chunk.read(4)
@@ -490,19 +490,19 @@ def _read_comm_chunk(self, chunk):
chunk.file.seek(-1, 1)
#DEBUG end
self._compname = _read_string(chunk)
- if self._comptype != b'NONE':
- if self._comptype == b'G722':
+ if self._comptype != b"NONE":
+ if self._comptype == b"G722":
self._convert = self._adpcm2lin
- elif self._comptype in (b'ulaw', b'ULAW'):
+ elif self._comptype in (b"ulaw", b"ULAW"):
self._convert = self._ulaw2lin
- elif self._comptype in (b'alaw', b'ALAW'):
+ elif self._comptype in (b"alaw", b"ALAW"):
self._convert = self._alaw2lin
else:
- raise Error('unsupported compression type')
+ raise Error("unsupported compression type")
self._sampwidth = 2
else:
- self._comptype = b'NONE'
- self._compname = b'not compressed'
+ self._comptype = b"NONE"
+ self._compname = b"not compressed"
def _readmark(self, chunk):
nmarkers = _read_short(chunk)
@@ -519,8 +519,8 @@ def _readmark(self, chunk):
# a position 0 and name ''
self._markers.append((id, pos, name))
except EOFError:
- w = ('Warning: MARK chunk contains only %s marker%s instead of %s' %
- (len(self._markers), '' if len(self._markers) == 1 else 's',
+ w = ("Warning: MARK chunk contains only %s marker%s instead of %s" %
+ (len(self._markers), "" if len(self._markers) == 1 else "s",
nmarkers))
warnings.warn(w)
@@ -558,7 +558,7 @@ class Aifc_write:
def __init__(self, f):
if isinstance(f, str):
- file_object = builtins.open(f, 'wb')
+ file_object = builtins.open(f, "wb")
try:
self.initfp(file_object)
except:
@@ -566,7 +566,7 @@ def __init__(self, f):
raise
# treat .aiff file extensions as non-compressed audio
- if f.endswith('.aiff'):
+ if f.endswith(".aiff"):
self._aifc = 0
else:
# assume it is an open file object already
@@ -575,8 +575,8 @@ def __init__(self, f):
def initfp(self, file):
self._file = file
self._version = _AIFC_version
- self._comptype = b'NONE'
- self._compname = b'not compressed'
+ self._comptype = b"NONE"
+ self._compname = b"not compressed"
self._convert = None
self._nchannels = 0
self._sampwidth = 0
@@ -603,53 +603,53 @@ def __exit__(self, *args):
#
def aiff(self):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
self._aifc = 0
def aifc(self):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
self._aifc = 1
def setnchannels(self, nchannels):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
if nchannels < 1:
- raise Error('bad # of channels')
+ raise Error("bad # of channels")
self._nchannels = nchannels
def getnchannels(self):
if not self._nchannels:
- raise Error('number of channels not set')
+ raise Error("number of channels not set")
return self._nchannels
def setsampwidth(self, sampwidth):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
if sampwidth < 1 or sampwidth > 4:
- raise Error('bad sample width')
+ raise Error("bad sample width")
self._sampwidth = sampwidth
def getsampwidth(self):
if not self._sampwidth:
- raise Error('sample width not set')
+ raise Error("sample width not set")
return self._sampwidth
def setframerate(self, framerate):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
if framerate <= 0:
- raise Error('bad frame rate')
+ raise Error("bad frame rate")
self._framerate = framerate
def getframerate(self):
if not self._framerate:
- raise Error('frame rate not set')
+ raise Error("frame rate not set")
return self._framerate
def setnframes(self, nframes):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
self._nframes = nframes
def getnframes(self):
@@ -657,10 +657,10 @@ def getnframes(self):
def setcomptype(self, comptype, compname):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
- if comptype not in (b'NONE', b'ulaw', b'ULAW',
- b'alaw', b'ALAW', b'G722'):
- raise Error('unsupported compression type')
+ raise Error("cannot change parameters after starting to write")
+ if comptype not in (b"NONE", b"ulaw", b"ULAW",
+ b"alaw", b"ALAW", b"G722"):
+ raise Error("unsupported compression type")
self._comptype = comptype
self._compname = compname
@@ -678,10 +678,10 @@ def getcompname(self):
def setparams(self, params):
nchannels, sampwidth, framerate, nframes, comptype, compname = params
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
- if comptype not in (b'NONE', b'ulaw', b'ULAW',
- b'alaw', b'ALAW', b'G722'):
- raise Error('unsupported compression type')
+ raise Error("cannot change parameters after starting to write")
+ if comptype not in (b"NONE", b"ulaw", b"ULAW",
+ b"alaw", b"ALAW", b"G722"):
+ raise Error("unsupported compression type")
self.setnchannels(nchannels)
self.setsampwidth(sampwidth)
self.setframerate(framerate)
@@ -690,17 +690,17 @@ def setparams(self, params):
def getparams(self):
if not self._nchannels or not self._sampwidth or not self._framerate:
- raise Error('not all parameters set')
+ raise Error("not all parameters set")
return _aifc_params(self._nchannels, self._sampwidth, self._framerate,
self._nframes, self._comptype, self._compname)
def setmark(self, id, pos, name):
if id <= 0:
- raise Error('marker ID must be > 0')
+ raise Error("marker ID must be > 0")
if pos < 0:
- raise Error('marker position must be >= 0')
+ raise Error("marker position must be >= 0")
if not isinstance(name, bytes):
- raise Error('marker name must be bytes')
+ raise Error("marker name must be bytes")
for i in range(len(self._markers)):
if id == self._markers[i][0]:
self._markers[i] = id, pos, name
@@ -711,7 +711,7 @@ def getmark(self, id):
for marker in self._markers:
if id == marker[0]:
return marker
- raise Error('marker {0!r} does not exist'.format(id))
+ raise Error("marker {0!r} does not exist".format(id))
def getmarkers(self):
if len(self._markers) == 0:
@@ -723,7 +723,7 @@ def tell(self):
def writeframesraw(self, data):
if not isinstance(data, (bytes, bytearray)):
- data = memoryview(data).cast('B')
+ data = memoryview(data).cast("B")
self._ensure_header_written(len(data))
nframes = len(data) // (self._sampwidth * self._nchannels)
if self._convert:
@@ -745,7 +745,7 @@ def close(self):
self._ensure_header_written(0)
if self._datawritten & 1:
# quick pad to even size
- self._file.write(b'\x00')
+ self._file.write(b"\x00")
self._datawritten = self._datawritten + 1
self._writemarkers()
if self._nframeswritten != self._nframes or \
@@ -773,50 +773,50 @@ def _lin2ulaw(self, data):
def _lin2adpcm(self, data):
import audioop
- if not hasattr(self, '_adpcmstate'):
+ if not hasattr(self, "_adpcmstate"):
self._adpcmstate = None
data, self._adpcmstate = audioop.lin2adpcm(data, 2, self._adpcmstate)
return data
def _ensure_header_written(self, datasize):
if not self._nframeswritten:
- if self._comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
+ if self._comptype in (b"ULAW", b"ulaw", b"ALAW", b"alaw", b"G722"):
if not self._sampwidth:
self._sampwidth = 2
if self._sampwidth != 2:
- raise Error('sample width must be 2 when compressing '
- 'with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)')
+ raise Error("sample width must be 2 when compressing "
+ "with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)")
if not self._nchannels:
- raise Error('# channels not specified')
+ raise Error("# channels not specified")
if not self._sampwidth:
- raise Error('sample width not specified')
+ raise Error("sample width not specified")
if not self._framerate:
- raise Error('sampling rate not specified')
+ raise Error("sampling rate not specified")
self._write_header(datasize)
def _init_compression(self):
- if self._comptype == b'G722':
+ if self._comptype == b"G722":
self._convert = self._lin2adpcm
- elif self._comptype in (b'ulaw', b'ULAW'):
+ elif self._comptype in (b"ulaw", b"ULAW"):
self._convert = self._lin2ulaw
- elif self._comptype in (b'alaw', b'ALAW'):
+ elif self._comptype in (b"alaw", b"ALAW"):
self._convert = self._lin2alaw
def _write_header(self, initlength):
- if self._aifc and self._comptype != b'NONE':
+ if self._aifc and self._comptype != b"NONE":
self._init_compression()
- self._file.write(b'FORM')
+ self._file.write(b"FORM")
if not self._nframes:
self._nframes = initlength // (self._nchannels * self._sampwidth)
self._datalength = self._nframes * self._nchannels * self._sampwidth
if self._datalength & 1:
self._datalength = self._datalength + 1
if self._aifc:
- if self._comptype in (b'ulaw', b'ULAW', b'alaw', b'ALAW'):
+ if self._comptype in (b"ulaw", b"ULAW", b"alaw", b"ALAW"):
self._datalength = self._datalength // 2
if self._datalength & 1:
self._datalength = self._datalength + 1
- elif self._comptype == b'G722':
+ elif self._comptype == b"G722":
self._datalength = (self._datalength + 3) // 4
if self._datalength & 1:
self._datalength = self._datalength + 1
@@ -826,19 +826,19 @@ def _write_header(self, initlength):
self._form_length_pos = None
commlength = self._write_form_length(self._datalength)
if self._aifc:
- self._file.write(b'AIFC')
- self._file.write(b'FVER')
+ self._file.write(b"AIFC")
+ self._file.write(b"FVER")
_write_ulong(self._file, 4)
_write_ulong(self._file, self._version)
else:
- self._file.write(b'AIFF')
- self._file.write(b'COMM')
+ self._file.write(b"AIFF")
+ self._file.write(b"COMM")
_write_ulong(self._file, commlength)
_write_short(self._file, self._nchannels)
if self._form_length_pos is not None:
self._nframes_pos = self._file.tell()
_write_ulong(self._file, self._nframes)
- if self._comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
+ if self._comptype in (b"ULAW", b"ulaw", b"ALAW", b"alaw", b"G722"):
_write_short(self._file, 8)
else:
_write_short(self._file, self._sampwidth * 8)
@@ -846,7 +846,7 @@ def _write_header(self, initlength):
if self._aifc:
self._file.write(self._comptype)
_write_string(self._file, self._compname)
- self._file.write(b'SSND')
+ self._file.write(b"SSND")
if self._form_length_pos is not None:
self._ssnd_length_pos = self._file.tell()
_write_ulong(self._file, self._datalength + 8)
@@ -870,7 +870,7 @@ def _patchheader(self):
curpos = self._file.tell()
if self._datawritten & 1:
datalength = self._datawritten + 1
- self._file.write(b'\x00')
+ self._file.write(b"\x00")
else:
datalength = self._datawritten
if datalength == self._datalength and \
@@ -891,7 +891,7 @@ def _patchheader(self):
def _writemarkers(self):
if len(self._markers) == 0:
return
- self._file.write(b'MARK')
+ self._file.write(b"MARK")
length = 2
for marker in self._markers:
id, pos, name = marker
@@ -909,24 +909,24 @@ def _writemarkers(self):
def open(f, mode=None):
if mode is None:
- if hasattr(f, 'mode'):
+ if hasattr(f, "mode"):
mode = f.mode
else:
- mode = 'rb'
- if mode in ('r', 'rb'):
+ mode = "rb"
+ if mode in ("r", "rb"):
return Aifc_read(f)
- elif mode in ('w', 'wb'):
+ elif mode in ("w", "wb"):
return Aifc_write(f)
else:
raise Error("mode must be 'r', 'rb', 'w', or 'wb'")
-if __name__ == '__main__':
+if __name__ == "__main__":
import sys
if not sys.argv[1:]:
- sys.argv.append('/usr/demos/data/audio/bach.aiff')
+ sys.argv.append("/usr/demos/data/audio/bach.aiff")
fn = sys.argv[1]
- with open(fn, 'r') as f:
+ with open(fn, "r") as f:
print("Reading", fn)
print("nchannels =", f.getnchannels())
print("nframes =", f.getnframes())
@@ -937,7 +937,7 @@ def open(f, mode=None):
if sys.argv[2:]:
gn = sys.argv[2]
print("Writing", gn)
- with open(gn, 'w') as g:
+ with open(gn, "w") as g:
g.setparams(f.getparams())
while 1:
data = f.readframes(1024)
diff --git a/.venv3.10/Lib/antigravity.py b/.venv3.10/Lib/antigravity.py
index 6dc52073..ccd63ed3 100644
--- a/.venv3.10/Lib/antigravity.py
+++ b/.venv3.10/Lib/antigravity.py
@@ -5,13 +5,13 @@
webbrowser.open("https://xkcd.com/353/")
def geohash(latitude, longitude, datedow):
- '''Compute geohash() using the Munroe algorithm.
+ """Compute geohash() using the Munroe algorithm.
>>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
37.857713 -122.544543
- '''
+ """
# https://xkcd.com/426/
h = hashlib.md5(datedow, usedforsecurity=False).hexdigest()
- p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
- print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
+ p, q = [("%f" % float.fromhex("0." + x)) for x in (h[:16], h[16:32])]
+ print("%d%s %d%s" % (latitude, p[1:], longitude, q[1:]))
diff --git a/.venv3.10/Lib/argparse.py b/.venv3.10/Lib/argparse.py
index 736bf5ab..9d1c511c 100644
--- a/.venv3.10/Lib/argparse.py
+++ b/.venv3.10/Lib/argparse.py
@@ -62,26 +62,26 @@
still considered an implementation detail.)
"""
-__version__ = '1.1'
+__version__ = "1.1"
__all__ = [
- 'ArgumentParser',
- 'ArgumentError',
- 'ArgumentTypeError',
- 'BooleanOptionalAction',
- 'FileType',
- 'HelpFormatter',
- 'ArgumentDefaultsHelpFormatter',
- 'RawDescriptionHelpFormatter',
- 'RawTextHelpFormatter',
- 'MetavarTypeHelpFormatter',
- 'Namespace',
- 'Action',
- 'ONE_OR_MORE',
- 'OPTIONAL',
- 'PARSER',
- 'REMAINDER',
- 'SUPPRESS',
- 'ZERO_OR_MORE',
+ "ArgumentParser",
+ "ArgumentError",
+ "ArgumentTypeError",
+ "BooleanOptionalAction",
+ "FileType",
+ "HelpFormatter",
+ "ArgumentDefaultsHelpFormatter",
+ "RawDescriptionHelpFormatter",
+ "RawTextHelpFormatter",
+ "MetavarTypeHelpFormatter",
+ "Namespace",
+ "Action",
+ "ONE_OR_MORE",
+ "OPTIONAL",
+ "PARSER",
+ "REMAINDER",
+ "SUPPRESS",
+ "ZERO_OR_MORE",
]
@@ -91,14 +91,14 @@
from gettext import gettext as _, ngettext
-SUPPRESS = '==SUPPRESS=='
+SUPPRESS = "==SUPPRESS=="
-OPTIONAL = '?'
-ZERO_OR_MORE = '*'
-ONE_OR_MORE = '+'
-PARSER = 'A...'
-REMAINDER = '...'
-_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
+OPTIONAL = "?"
+ZERO_OR_MORE = "*"
+ONE_OR_MORE = "+"
+PARSER = "A..."
+REMAINDER = "..."
+_UNRECOGNIZED_ARGS_ATTR = "_unrecognized_args"
# =============================
# Utility functions and classes
@@ -121,12 +121,12 @@ def __repr__(self):
arg_strings.append(repr(arg))
for name, value in self._get_kwargs():
if name.isidentifier():
- arg_strings.append('%s=%r' % (name, value))
+ arg_strings.append("%s=%r" % (name, value))
else:
star_args[name] = value
if star_args:
- arg_strings.append('**%s' % repr(star_args))
- return '%s(%s)' % (type_name, ', '.join(arg_strings))
+ arg_strings.append("**%s" % repr(star_args))
+ return "%s(%s)" % (type_name, ", ".join(arg_strings))
def _get_kwargs(self):
return list(self.__dict__.items())
@@ -183,8 +183,8 @@ def __init__(self,
self._root_section = self._Section(self, None)
self._current_section = self._root_section
- self._whitespace_matcher = _re.compile(r'\s+', _re.ASCII)
- self._long_break_matcher = _re.compile(r'\n\n\n+')
+ self._whitespace_matcher = _re.compile(r"\s+", _re.ASCII)
+ self._long_break_matcher = _re.compile(r"\n\n\n+")
# ===============================
# Section and indentation methods
@@ -195,7 +195,7 @@ def _indent(self):
def _dedent(self):
self._current_indent -= self._indent_increment
- assert self._current_indent >= 0, 'Indent decreased below 0.'
+ assert self._current_indent >= 0, "Indent decreased below 0."
self._level -= 1
class _Section(object):
@@ -217,17 +217,17 @@ def format_help(self):
# return nothing if the section was empty
if not item_help:
- return ''
+ return ""
# add the heading if the section was non-empty
if self.heading is not SUPPRESS and self.heading is not None:
current_indent = self.formatter._current_indent
- heading = '%*s%s:\n' % (current_indent, '', self.heading)
+ heading = "%*s%s:\n" % (current_indent, "", self.heading)
else:
- heading = ''
+ heading = ""
# join the section-initial newline, the heading and the help
- return join(['\n', heading, item_help, '\n'])
+ return join(["\n", heading, item_help, "\n"])
def _add_item(self, func, args):
self._current_section.items.append((func, args))
@@ -282,18 +282,18 @@ def add_arguments(self, actions):
def format_help(self):
help = self._root_section.format_help()
if help:
- help = self._long_break_matcher.sub('\n\n', help)
- help = help.strip('\n') + '\n'
+ help = self._long_break_matcher.sub("\n\n", help)
+ help = help.strip("\n") + "\n"
return help
def _join_parts(self, part_strings):
- return ''.join([part
+ return "".join([part
for part in part_strings
if part and part is not SUPPRESS])
def _format_usage(self, usage, actions, groups, prefix):
if prefix is None:
- prefix = _('usage: ')
+ prefix = _("usage: ")
# if usage is specified, use that
if usage is not None:
@@ -301,11 +301,11 @@ def _format_usage(self, usage, actions, groups, prefix):
# if no optionals or positionals are available, usage is just prog
elif usage is None and not actions:
- usage = '%(prog)s' % dict(prog=self._prog)
+ usage = "%(prog)s" % dict(prog=self._prog)
# if optionals and positionals are available, calculate usage
elif usage is None:
- prog = '%(prog)s' % dict(prog=self._prog)
+ prog = "%(prog)s" % dict(prog=self._prog)
# split optionals from positionals
optionals = []
@@ -319,7 +319,7 @@ def _format_usage(self, usage, actions, groups, prefix):
# build full usage string
format = self._format_actions_usage
action_usage = format(optionals + positionals, groups)
- usage = ' '.join([s for s in [prog, action_usage] if s])
+ usage = " ".join([s for s in [prog, action_usage] if s])
# wrap the usage parts if it's too long
text_width = self._width - self._current_indent
@@ -327,16 +327,16 @@ def _format_usage(self, usage, actions, groups, prefix):
# break usage into wrappable parts
part_regexp = (
- r'\(.*?\)+(?=\s|$)|'
- r'\[.*?\]+(?=\s|$)|'
- r'\S+'
+ r"\(.*?\)+(?=\s|$)|"
+ r"\[.*?\]+(?=\s|$)|"
+ r"\S+"
)
opt_usage = format(optionals, groups)
pos_usage = format(positionals, groups)
opt_parts = _re.findall(part_regexp, opt_usage)
pos_parts = _re.findall(part_regexp, pos_usage)
- assert ' '.join(opt_parts) == opt_usage
- assert ' '.join(pos_parts) == pos_usage
+ assert " ".join(opt_parts) == opt_usage
+ assert " ".join(pos_parts) == pos_usage
# helper for wrapping lines
def get_lines(parts, indent, prefix=None):
@@ -348,20 +348,20 @@ def get_lines(parts, indent, prefix=None):
line_len = len(indent) - 1
for part in parts:
if line_len + 1 + len(part) > text_width and line:
- lines.append(indent + ' '.join(line))
+ lines.append(indent + " ".join(line))
line = []
line_len = len(indent) - 1
line.append(part)
line_len += len(part) + 1
if line:
- lines.append(indent + ' '.join(line))
+ lines.append(indent + " ".join(line))
if prefix is not None:
lines[0] = lines[0][len(indent):]
return lines
# if prog is short, follow it with optionals or positionals
if len(prefix) + len(prog) <= 0.75 * text_width:
- indent = ' ' * (len(prefix) + len(prog) + 1)
+ indent = " " * (len(prefix) + len(prog) + 1)
if opt_parts:
lines = get_lines([prog] + opt_parts, indent, prefix)
lines.extend(get_lines(pos_parts, indent))
@@ -372,7 +372,7 @@ def get_lines(parts, indent, prefix=None):
# if prog is long, put it on its own line
else:
- indent = ' ' * len(prefix)
+ indent = " " * len(prefix)
parts = opt_parts + pos_parts
lines = get_lines(parts, indent)
if len(lines) > 1:
@@ -382,10 +382,10 @@ def get_lines(parts, indent, prefix=None):
lines = [prog] + lines
# join lines into usage
- usage = '\n'.join(lines)
+ usage = "\n".join(lines)
# prefix with 'usage:'
- return '%s%s\n\n' % (prefix, usage)
+ return "%s%s\n\n" % (prefix, usage)
def _format_actions_usage(self, actions, groups):
# find group indices and identify actions in groups
@@ -393,7 +393,7 @@ def _format_actions_usage(self, actions, groups):
inserts = {}
for group in groups:
if not group._group_actions:
- raise ValueError(f'empty group {group}')
+ raise ValueError(f"empty group {group}")
try:
start = actions.index(group._group_actions[0])
@@ -414,24 +414,24 @@ def _format_actions_usage(self, actions, groups):
if not group.required:
if start in inserts:
- inserts[start] += ' ['
+ inserts[start] += " ["
else:
- inserts[start] = '['
+ inserts[start] = "["
if end in inserts:
- inserts[end] += ']'
+ inserts[end] += "]"
else:
- inserts[end] = ']'
+ inserts[end] = "]"
elif exposed_actions_count > 1:
if start in inserts:
- inserts[start] += ' ('
+ inserts[start] += " ("
else:
- inserts[start] = '('
+ inserts[start] = "("
if end in inserts:
- inserts[end] += ')'
+ inserts[end] += ")"
else:
- inserts[end] = ')'
+ inserts[end] = ")"
for i in range(start + 1, end):
- inserts[i] = '|'
+ inserts[i] = "|"
# collect all actions format strings
parts = []
@@ -441,9 +441,9 @@ def _format_actions_usage(self, actions, groups):
# remove | separators for suppressed arguments
if action.help is SUPPRESS:
parts.append(None)
- if inserts.get(i) == '|':
+ if inserts.get(i) == "|":
inserts.pop(i)
- elif inserts.get(i + 1) == '|':
+ elif inserts.get(i + 1) == "|":
inserts.pop(i + 1)
# produce all arg strings
@@ -453,7 +453,7 @@ def _format_actions_usage(self, actions, groups):
# if it's in a group, strip the outer []
if action in group_actions:
- if part[0] == '[' and part[-1] == ']':
+ if part[0] == "[" and part[-1] == "]":
part = part[1:-1]
# add the action string to the list
@@ -473,11 +473,11 @@ def _format_actions_usage(self, actions, groups):
else:
default = self._get_default_metavar_for_optional(action)
args_string = self._format_args(action, default)
- part = '%s %s' % (option_string, args_string)
+ part = "%s %s" % (option_string, args_string)
# make it look optional if it's not required or in a group
if not action.required and action not in group_actions:
- part = '[%s]' % part
+ part = "[%s]" % part
# add the action string to the list
parts.append(part)
@@ -487,25 +487,25 @@ def _format_actions_usage(self, actions, groups):
parts[i:i] = [inserts[i]]
# join all the action items with spaces
- text = ' '.join([item for item in parts if item is not None])
+ text = " ".join([item for item in parts if item is not None])
# clean up separators for mutually exclusive groups
- open = r'[\[(]'
- close = r'[\])]'
- text = _re.sub(r'(%s) ' % open, r'\1', text)
- text = _re.sub(r' (%s)' % close, r'\1', text)
- text = _re.sub(r'%s *%s' % (open, close), r'', text)
+ open = r"[\[(]"
+ close = r"[\])]"
+ text = _re.sub(r"(%s) " % open, r"\1", text)
+ text = _re.sub(r" (%s)" % close, r"\1", text)
+ text = _re.sub(r"%s *%s" % (open, close), r"", text)
text = text.strip()
# return the text
return text
def _format_text(self, text):
- if '%(prog)' in text:
+ if "%(prog)" in text:
text = text % dict(prog=self._prog)
text_width = max(self._width - self._current_indent, 11)
- indent = ' ' * self._current_indent
- return self._fill_text(text, text_width, indent) + '\n\n'
+ indent = " " * self._current_indent
+ return self._fill_text(text, text_width, indent) + "\n\n"
def _format_action(self, action):
# determine the required width and the entry label
@@ -517,19 +517,19 @@ def _format_action(self, action):
# no help; start on same line and add a final newline
if not action.help:
- tup = self._current_indent, '', action_header
- action_header = '%*s%s\n' % tup
+ tup = self._current_indent, "", action_header
+ action_header = "%*s%s\n" % tup
# short action name; start on the same line and pad two spaces
elif len(action_header) <= action_width:
- tup = self._current_indent, '', action_width, action_header
- action_header = '%*s%-*s ' % tup
+ tup = self._current_indent, "", action_width, action_header
+ action_header = "%*s%-*s " % tup
indent_first = 0
# long action name; start on the next line
else:
- tup = self._current_indent, '', action_header
- action_header = '%*s%s\n' % tup
+ tup = self._current_indent, "", action_header
+ action_header = "%*s%s\n" % tup
indent_first = help_position
# collect the pieces of the action help
@@ -540,13 +540,13 @@ def _format_action(self, action):
help_text = self._expand_help(action)
if help_text:
help_lines = self._split_lines(help_text, help_width)
- parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
+ parts.append("%*s%s\n" % (indent_first, "", help_lines[0]))
for line in help_lines[1:]:
- parts.append('%*s%s\n' % (help_position, '', line))
+ parts.append("%*s%s\n" % (help_position, "", line))
# or add a newline if the description doesn't end with one
- elif not action_header.endswith('\n'):
- parts.append('\n')
+ elif not action_header.endswith("\n"):
+ parts.append("\n")
# if there are any sub-actions, add their help as well
for subaction in self._iter_indented_subactions(action):
@@ -575,16 +575,16 @@ def _format_action_invocation(self, action):
default = self._get_default_metavar_for_optional(action)
args_string = self._format_args(action, default)
for option_string in action.option_strings:
- parts.append('%s %s' % (option_string, args_string))
+ parts.append("%s %s" % (option_string, args_string))
- return ', '.join(parts)
+ return ", ".join(parts)
def _metavar_formatter(self, action, default_metavar):
if action.metavar is not None:
result = action.metavar
elif action.choices is not None:
choice_strs = [str(choice) for choice in action.choices]
- result = '{%s}' % ','.join(choice_strs)
+ result = "{%s}" % ",".join(choice_strs)
else:
result = default_metavar
@@ -598,29 +598,29 @@ def format(tuple_size):
def _format_args(self, action, default_metavar):
get_metavar = self._metavar_formatter(action, default_metavar)
if action.nargs is None:
- result = '%s' % get_metavar(1)
+ result = "%s" % get_metavar(1)
elif action.nargs == OPTIONAL:
- result = '[%s]' % get_metavar(1)
+ result = "[%s]" % get_metavar(1)
elif action.nargs == ZERO_OR_MORE:
metavar = get_metavar(1)
if len(metavar) == 2:
- result = '[%s [%s ...]]' % metavar
+ result = "[%s [%s ...]]" % metavar
else:
- result = '[%s ...]' % metavar
+ result = "[%s ...]" % metavar
elif action.nargs == ONE_OR_MORE:
- result = '%s [%s ...]' % get_metavar(2)
+ result = "%s [%s ...]" % get_metavar(2)
elif action.nargs == REMAINDER:
- result = '...'
+ result = "..."
elif action.nargs == PARSER:
- result = '%s ...' % get_metavar(1)
+ result = "%s ..." % get_metavar(1)
elif action.nargs == SUPPRESS:
- result = ''
+ result = ""
else:
try:
- formats = ['%s' for _ in range(action.nargs)]
+ formats = ["%s" for _ in range(action.nargs)]
except TypeError:
raise ValueError("invalid nargs value") from None
- result = ' '.join(formats) % get_metavar(action.nargs)
+ result = " ".join(formats) % get_metavar(action.nargs)
return result
def _expand_help(self, action):
@@ -629,11 +629,11 @@ def _expand_help(self, action):
if params[name] is SUPPRESS:
del params[name]
for name in list(params):
- if hasattr(params[name], '__name__'):
+ if hasattr(params[name], "__name__"):
params[name] = params[name].__name__
- if params.get('choices') is not None:
- choices_str = ', '.join([str(c) for c in params['choices']])
- params['choices'] = choices_str
+ if params.get("choices") is not None:
+ choices_str = ", ".join([str(c) for c in params["choices"]])
+ params["choices"] = choices_str
return self._get_help_string(action) % params
def _iter_indented_subactions(self, action):
@@ -647,14 +647,14 @@ def _iter_indented_subactions(self, action):
self._dedent()
def _split_lines(self, text, width):
- text = self._whitespace_matcher.sub(' ', text).strip()
+ text = self._whitespace_matcher.sub(" ", text).strip()
# The textwrap module is used only for formatting help.
# Delay its import for speeding up the common usage of argparse.
import textwrap
return textwrap.wrap(text, width)
def _fill_text(self, text, width, indent):
- text = self._whitespace_matcher.sub(' ', text).strip()
+ text = self._whitespace_matcher.sub(" ", text).strip()
import textwrap
return textwrap.fill(text, width,
initial_indent=indent,
@@ -678,7 +678,7 @@ class RawDescriptionHelpFormatter(HelpFormatter):
"""
def _fill_text(self, text, width, indent):
- return ''.join(indent + line for line in text.splitlines(keepends=True))
+ return "".join(indent + line for line in text.splitlines(keepends=True))
class RawTextHelpFormatter(RawDescriptionHelpFormatter):
@@ -701,11 +701,11 @@ class ArgumentDefaultsHelpFormatter(HelpFormatter):
def _get_help_string(self, action):
help = action.help
- if '%(default)' not in action.help:
+ if "%(default)" not in action.help:
if action.default is not SUPPRESS:
defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
if action.option_strings or action.nargs in defaulting_nargs:
- help += ' (default: %(default)s)'
+ help += " (default: %(default)s)"
return help
@@ -733,13 +733,13 @@ def _get_action_name(argument):
if argument is None:
return None
elif argument.option_strings:
- return '/'.join(argument.option_strings)
+ return "/".join(argument.option_strings)
elif argument.metavar not in (None, SUPPRESS):
return argument.metavar
elif argument.dest not in (None, SUPPRESS):
return argument.dest
elif argument.choices:
- return '{' + ','.join(argument.choices) + '}'
+ return "{" + ",".join(argument.choices) + "}"
else:
return None
@@ -757,9 +757,9 @@ def __init__(self, argument, message):
def __str__(self):
if self.argument_name is None:
- format = '%(message)s'
+ format = "%(message)s"
else:
- format = 'argument %(argument_name)s: %(message)s'
+ format = "argument %(argument_name)s: %(message)s"
return format % dict(message=self.message,
argument_name=self.argument_name)
@@ -848,16 +848,16 @@ def __init__(self,
def _get_kwargs(self):
names = [
- 'option_strings',
- 'dest',
- 'nargs',
- 'const',
- 'default',
- 'type',
- 'choices',
- 'required',
- 'help',
- 'metavar',
+ "option_strings",
+ "dest",
+ "nargs",
+ "const",
+ "default",
+ "type",
+ "choices",
+ "required",
+ "help",
+ "metavar",
]
return [(name, getattr(self, name)) for name in names]
@@ -865,7 +865,7 @@ def format_usage(self):
return self.option_strings[0]
def __call__(self, parser, namespace, values, option_string=None):
- raise NotImplementedError(_('.__call__() not defined'))
+ raise NotImplementedError(_(".__call__() not defined"))
class BooleanOptionalAction(Action):
def __init__(self,
@@ -882,8 +882,8 @@ def __init__(self,
for option_string in option_strings:
_option_strings.append(option_string)
- if option_string.startswith('--'):
- option_string = '--no-' + option_string[2:]
+ if option_string.startswith("--"):
+ option_string = "--no-" + option_string[2:]
_option_strings.append(option_string)
if help is not None and default is not None and default is not SUPPRESS:
@@ -902,10 +902,10 @@ def __init__(self,
def __call__(self, parser, namespace, values, option_string=None):
if option_string in self.option_strings:
- setattr(namespace, self.dest, not option_string.startswith('--no-'))
+ setattr(namespace, self.dest, not option_string.startswith("--no-"))
def format_usage(self):
- return ' | '.join(self.option_strings)
+ return " | ".join(self.option_strings)
class _StoreAction(Action):
@@ -922,11 +922,11 @@ def __init__(self,
help=None,
metavar=None):
if nargs == 0:
- raise ValueError('nargs for store actions must be != 0; if you '
- 'have nothing to store, actions such as store '
- 'true or store const may be more appropriate')
+ raise ValueError("nargs for store actions must be != 0; if you "
+ "have nothing to store, actions such as store "
+ "true or store const may be more appropriate")
if const is not None and nargs != OPTIONAL:
- raise ValueError('nargs must be %r to supply const' % OPTIONAL)
+ raise ValueError("nargs must be %r to supply const" % OPTIONAL)
super(_StoreAction, self).__init__(
option_strings=option_strings,
dest=dest,
@@ -1014,11 +1014,11 @@ def __init__(self,
help=None,
metavar=None):
if nargs == 0:
- raise ValueError('nargs for append actions must be != 0; if arg '
- 'strings are not supplying the value to append, '
- 'the append const action may be more appropriate')
+ raise ValueError("nargs for append actions must be != 0; if arg "
+ "strings are not supplying the value to append, "
+ "the append const action may be more appropriate")
if const is not None and nargs != OPTIONAL:
- raise ValueError('nargs must be %r to supply const' % OPTIONAL)
+ raise ValueError("nargs must be %r to supply const" % OPTIONAL)
super(_AppendAction, self).__init__(
option_strings=option_strings,
dest=dest,
@@ -1140,7 +1140,7 @@ class _ChoicesPseudoAction(Action):
def __init__(self, name, aliases, help):
metavar = dest = name
if aliases:
- metavar += ' (%s)' % ', '.join(aliases)
+ metavar += " (%s)" % ", ".join(aliases)
sup = super(_SubParsersAction._ChoicesPseudoAction, self)
sup.__init__(option_strings=[], dest=dest, help=help,
metavar=metavar)
@@ -1170,14 +1170,14 @@ def __init__(self,
def add_parser(self, name, **kwargs):
# set prog from the existing prefix
- if kwargs.get('prog') is None:
- kwargs['prog'] = '%s %s' % (self._prog_prefix, name)
+ if kwargs.get("prog") is None:
+ kwargs["prog"] = "%s %s" % (self._prog_prefix, name)
- aliases = kwargs.pop('aliases', ())
+ aliases = kwargs.pop("aliases", ())
# create a pseudo-action to hold the choice help
- if 'help' in kwargs:
- help = kwargs.pop('help')
+ if "help" in kwargs:
+ help = kwargs.pop("help")
choice_action = self._ChoicesPseudoAction(name, aliases, help)
self._choices_actions.append(choice_action)
@@ -1206,9 +1206,9 @@ def __call__(self, parser, namespace, values, option_string=None):
try:
parser = self._name_parser_map[parser_name]
except KeyError:
- args = {'parser_name': parser_name,
- 'choices': ', '.join(self._name_parser_map)}
- msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args
+ args = {"parser_name": parser_name,
+ "choices": ", ".join(self._name_parser_map)}
+ msg = _("unknown parser %(parser_name)r (choices: %(choices)s)") % args
raise ArgumentError(self, msg)
# parse all the remaining options into the namespace
@@ -1254,7 +1254,7 @@ class FileType(object):
be handled. Accepts the same value as the builtin open() function.
"""
- def __init__(self, mode='r', bufsize=-1, encoding=None, errors=None):
+ def __init__(self, mode="r", bufsize=-1, encoding=None, errors=None):
self._mode = mode
self._bufsize = bufsize
self._encoding = encoding
@@ -1262,11 +1262,11 @@ def __init__(self, mode='r', bufsize=-1, encoding=None, errors=None):
def __call__(self, string):
# the special argument "-" means sys.std{in,out}
- if string == '-':
- if 'r' in self._mode:
- return _sys.stdin.buffer if 'b' in self._mode else _sys.stdin
- elif any(c in self._mode for c in 'wax'):
- return _sys.stdout.buffer if 'b' in self._mode else _sys.stdout
+ if string == "-":
+ if "r" in self._mode:
+ return _sys.stdin.buffer if "b" in self._mode else _sys.stdin
+ elif any(c in self._mode for c in "wax"):
+ return _sys.stdout.buffer if "b" in self._mode else _sys.stdout
else:
msg = _('argument "-" with mode %r') % self._mode
raise ValueError(msg)
@@ -1276,17 +1276,17 @@ def __call__(self, string):
return open(string, self._mode, self._bufsize, self._encoding,
self._errors)
except OSError as e:
- args = {'filename': string, 'error': e}
+ args = {"filename": string, "error": e}
message = _("can't open '%(filename)s': %(error)s")
raise ArgumentTypeError(message % args)
def __repr__(self):
args = self._mode, self._bufsize
- kwargs = [('encoding', self._encoding), ('errors', self._errors)]
- args_str = ', '.join([repr(arg) for arg in args if arg != -1] +
- ['%s=%r' % (kw, arg) for kw, arg in kwargs
+ kwargs = [("encoding", self._encoding), ("errors", self._errors)]
+ args_str = ", ".join([repr(arg) for arg in args if arg != -1] +
+ ["%s=%r" % (kw, arg) for kw, arg in kwargs
if arg is not None])
- return '%s(%s)' % (type(self).__name__, args_str)
+ return "%s(%s)" % (type(self).__name__, args_str)
# ===========================
# Optional and Positional Parsing
@@ -1330,18 +1330,18 @@ def __init__(self,
self._registries = {}
# register actions
- self.register('action', None, _StoreAction)
- self.register('action', 'store', _StoreAction)
- self.register('action', 'store_const', _StoreConstAction)
- self.register('action', 'store_true', _StoreTrueAction)
- self.register('action', 'store_false', _StoreFalseAction)
- self.register('action', 'append', _AppendAction)
- self.register('action', 'append_const', _AppendConstAction)
- self.register('action', 'count', _CountAction)
- self.register('action', 'help', _HelpAction)
- self.register('action', 'version', _VersionAction)
- self.register('action', 'parsers', _SubParsersAction)
- self.register('action', 'extend', _ExtendAction)
+ self.register("action", None, _StoreAction)
+ self.register("action", "store", _StoreAction)
+ self.register("action", "store_const", _StoreConstAction)
+ self.register("action", "store_true", _StoreTrueAction)
+ self.register("action", "store_false", _StoreFalseAction)
+ self.register("action", "append", _AppendAction)
+ self.register("action", "append_const", _AppendConstAction)
+ self.register("action", "count", _CountAction)
+ self.register("action", "help", _HelpAction)
+ self.register("action", "version", _VersionAction)
+ self.register("action", "parsers", _SubParsersAction)
+ self.register("action", "extend", _ExtendAction)
# raise an exception if the conflict handler is invalid
self._get_handler()
@@ -1358,7 +1358,7 @@ def __init__(self,
self._defaults = {}
# determines whether an "option" looks like a negative number
- self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')
+ self._negative_number_matcher = _re.compile(r"^-\d+$|^-\d*\.\d+$")
# whether or not there are any optionals that look like negative
# numbers -- uses a list so it can be shared and edited
@@ -1407,8 +1407,8 @@ def add_argument(self, *args, **kwargs):
# argument
chars = self.prefix_chars
if not args or len(args) == 1 and args[0][0] not in chars:
- if args and 'dest' in kwargs:
- raise ValueError('dest supplied twice for positional argument')
+ if args and "dest" in kwargs:
+ raise ValueError("dest supplied twice for positional argument")
kwargs = self._get_positional_kwargs(*args, **kwargs)
# otherwise, we're adding an optional argument
@@ -1416,12 +1416,12 @@ def add_argument(self, *args, **kwargs):
kwargs = self._get_optional_kwargs(*args, **kwargs)
# if no default was supplied, use the parser-level default
- if 'default' not in kwargs:
- dest = kwargs['dest']
+ if "default" not in kwargs:
+ dest = kwargs["dest"]
if dest in self._defaults:
- kwargs['default'] = self._defaults[dest]
+ kwargs["default"] = self._defaults[dest]
elif self.argument_default is not None:
- kwargs['default'] = self.argument_default
+ kwargs["default"] = self.argument_default
# create the action object, and add it to the parser
action_class = self._pop_action_class(kwargs)
@@ -1430,13 +1430,13 @@ def add_argument(self, *args, **kwargs):
action = action_class(**kwargs)
# raise an error if the action type is not callable
- type_func = self._registry_get('type', action.type, action.type)
+ type_func = self._registry_get("type", action.type, action.type)
if not callable(type_func):
- raise ValueError('%r is not callable' % (type_func,))
+ raise ValueError("%r is not callable" % (type_func,))
if type_func is FileType:
- raise ValueError('%r is a FileType class object, instance of it'
- ' must be passed' % (type_func,))
+ raise ValueError("%r is a FileType class object, instance of it"
+ " must be passed" % (type_func,))
# raise an error if the metavar does not match the type
if hasattr(self, "_get_formatter"):
@@ -1486,7 +1486,7 @@ def _add_container_actions(self, container):
title_group_map = {}
for group in self._action_groups:
if group.title in title_group_map:
- msg = _('cannot merge actions - two groups are named %r')
+ msg = _("cannot merge actions - two groups are named %r")
raise ValueError(msg % (group.title))
title_group_map[group.title] = group
@@ -1523,16 +1523,16 @@ def _add_container_actions(self, container):
def _get_positional_kwargs(self, dest, **kwargs):
# make sure required is not specified
- if 'required' in kwargs:
+ if "required" in kwargs:
msg = _("'required' is an invalid argument for positionals")
raise TypeError(msg)
# mark positional arguments as required if at least one is
# always required
- if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]:
- kwargs['required'] = True
- if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs:
- kwargs['required'] = True
+ if kwargs.get("nargs") not in [OPTIONAL, ZERO_OR_MORE]:
+ kwargs["required"] = True
+ if kwargs.get("nargs") == ZERO_OR_MORE and "default" not in kwargs:
+ kwargs["required"] = True
# return the keyword arguments with no option strings
return dict(kwargs, dest=dest, option_strings=[])
@@ -1543,11 +1543,11 @@ def _get_optional_kwargs(self, *args, **kwargs):
long_option_strings = []
for option_string in args:
# error on strings that don't start with an appropriate prefix
- if not option_string[0] in self.prefix_chars:
- args = {'option': option_string,
- 'prefix_chars': self.prefix_chars}
- msg = _('invalid option string %(option)r: '
- 'must start with a character %(prefix_chars)r')
+ if option_string[0] not in self.prefix_chars:
+ args = {"option": option_string,
+ "prefix_chars": self.prefix_chars}
+ msg = _("invalid option string %(option)r: "
+ "must start with a character %(prefix_chars)r")
raise ValueError(msg % args)
# strings starting with two prefix characters are long options
@@ -1556,7 +1556,7 @@ def _get_optional_kwargs(self, *args, **kwargs):
long_option_strings.append(option_string)
# infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
- dest = kwargs.pop('dest', None)
+ dest = kwargs.pop("dest", None)
if dest is None:
if long_option_strings:
dest_option_string = long_option_strings[0]
@@ -1564,24 +1564,24 @@ def _get_optional_kwargs(self, *args, **kwargs):
dest_option_string = option_strings[0]
dest = dest_option_string.lstrip(self.prefix_chars)
if not dest:
- msg = _('dest= is required for options like %r')
+ msg = _("dest= is required for options like %r")
raise ValueError(msg % option_string)
- dest = dest.replace('-', '_')
+ dest = dest.replace("-", "_")
# return the updated keyword arguments
return dict(kwargs, dest=dest, option_strings=option_strings)
def _pop_action_class(self, kwargs, default=None):
- action = kwargs.pop('action', default)
- return self._registry_get('action', action, action)
+ action = kwargs.pop("action", default)
+ return self._registry_get("action", action, action)
def _get_handler(self):
# determine function from conflict handler string
- handler_func_name = '_handle_conflict_%s' % self.conflict_handler
+ handler_func_name = "_handle_conflict_%s" % self.conflict_handler
try:
return getattr(self, handler_func_name)
except AttributeError:
- msg = _('invalid conflict_resolution value: %r')
+ msg = _("invalid conflict_resolution value: %r")
raise ValueError(msg % self.conflict_handler)
def _check_conflict(self, action):
@@ -1599,10 +1599,10 @@ def _check_conflict(self, action):
conflict_handler(action, confl_optionals)
def _handle_conflict_error(self, action, conflicting_actions):
- message = ngettext('conflicting option string: %s',
- 'conflicting option strings: %s',
+ message = ngettext("conflicting option string: %s",
+ "conflicting option strings: %s",
len(conflicting_actions))
- conflict_string = ', '.join([option_string
+ conflict_string = ", ".join([option_string
for option_string, action
in conflicting_actions])
raise ArgumentError(action, message % conflict_string)
@@ -1627,9 +1627,9 @@ class _ArgumentGroup(_ActionsContainer):
def __init__(self, container, title=None, description=None, **kwargs):
# add any missing keyword arguments by checking the container
update = kwargs.setdefault
- update('conflict_handler', container.conflict_handler)
- update('prefix_chars', container.prefix_chars)
- update('argument_default', container.argument_default)
+ update("conflict_handler", container.conflict_handler)
+ update("prefix_chars", container.prefix_chars)
+ update("argument_default", container.argument_default)
super_init = super(_ArgumentGroup, self).__init__
super_init(description=description, **kwargs)
@@ -1665,7 +1665,7 @@ def __init__(self, container, required=False):
def _add_action(self, action):
if action.required:
- msg = _('mutually exclusive arguments must be optional')
+ msg = _("mutually exclusive arguments must be optional")
raise ValueError(msg)
action = self._container._add_action(action)
self._group_actions.append(action)
@@ -1705,10 +1705,10 @@ def __init__(self,
epilog=None,
parents=[],
formatter_class=HelpFormatter,
- prefix_chars='-',
+ prefix_chars="-",
fromfile_prefix_chars=None,
argument_default=None,
- conflict_handler='error',
+ conflict_handler="error",
add_help=True,
allow_abbrev=True,
exit_on_error=True):
@@ -1733,23 +1733,23 @@ def __init__(self,
self.exit_on_error = exit_on_error
add_group = self.add_argument_group
- self._positionals = add_group(_('positional arguments'))
- self._optionals = add_group(_('options'))
+ self._positionals = add_group(_("positional arguments"))
+ self._optionals = add_group(_("options"))
self._subparsers = None
# register types
def identity(string):
return string
- self.register('type', None, identity)
+ self.register("type", None, identity)
# add help argument if necessary
# (using explicit default to override global argument_default)
- default_prefix = '-' if '-' in prefix_chars else prefix_chars[0]
+ default_prefix = "-" if "-" in prefix_chars else prefix_chars[0]
if self.add_help:
self.add_argument(
- default_prefix+'h', default_prefix*2+'help',
- action='help', default=SUPPRESS,
- help=_('show this help message and exit'))
+ default_prefix+"h", default_prefix*2+"help",
+ action="help", default=SUPPRESS,
+ help=_("show this help message and exit"))
# add parent arguments and defaults
for parent in parents:
@@ -1766,12 +1766,12 @@ def identity(string):
# =======================
def _get_kwargs(self):
names = [
- 'prog',
- 'usage',
- 'description',
- 'formatter_class',
- 'conflict_handler',
- 'add_help',
+ "prog",
+ "usage",
+ "description",
+ "formatter_class",
+ "conflict_handler",
+ "add_help",
]
return [(name, getattr(self, name)) for name in names]
@@ -1780,29 +1780,29 @@ def _get_kwargs(self):
# ==================================
def add_subparsers(self, **kwargs):
if self._subparsers is not None:
- self.error(_('cannot have multiple subparser arguments'))
+ self.error(_("cannot have multiple subparser arguments"))
# add the parser class to the arguments if it's not present
- kwargs.setdefault('parser_class', type(self))
+ kwargs.setdefault("parser_class", type(self))
- if 'title' in kwargs or 'description' in kwargs:
- title = _(kwargs.pop('title', 'subcommands'))
- description = _(kwargs.pop('description', None))
+ if "title" in kwargs or "description" in kwargs:
+ title = _(kwargs.pop("title", "subcommands"))
+ description = _(kwargs.pop("description", None))
self._subparsers = self.add_argument_group(title, description)
else:
self._subparsers = self._positionals
# prog defaults to the usage message of this parser, skipping
# optional arguments and with no "usage:" prefix
- if kwargs.get('prog') is None:
+ if kwargs.get("prog") is None:
formatter = self._get_formatter()
positionals = self._get_positional_actions()
groups = self._mutually_exclusive_groups
- formatter.add_usage(self.usage, positionals, groups, '')
- kwargs['prog'] = formatter.format_help().strip()
+ formatter.add_usage(self.usage, positionals, groups, "")
+ kwargs["prog"] = formatter.format_help().strip()
# create the parsers action and add it to the positionals list
- parsers_class = self._pop_action_class(kwargs, 'parsers')
+ parsers_class = self._pop_action_class(kwargs, "parsers")
action = parsers_class(option_strings=[], **kwargs)
self._subparsers._add_action(action)
@@ -1832,8 +1832,8 @@ def _get_positional_actions(self):
def parse_args(self, args=None, namespace=None):
args, argv = self.parse_known_args(args, namespace)
if argv:
- msg = _('unrecognized arguments: %s')
- self.error(msg % ' '.join(argv))
+ msg = _("unrecognized arguments: %s")
+ self.error(msg % " ".join(argv))
return args
def parse_known_args(self, args=None, namespace=None):
@@ -1899,24 +1899,24 @@ def _parse_known_args(self, arg_strings, namespace):
for i, arg_string in enumerate(arg_strings_iter):
# all args after -- are non-options
- if arg_string == '--':
- arg_string_pattern_parts.append('-')
+ if arg_string == "--":
+ arg_string_pattern_parts.append("-")
for arg_string in arg_strings_iter:
- arg_string_pattern_parts.append('A')
+ arg_string_pattern_parts.append("A")
# otherwise, add the arg to the arg strings
# and note the index if it was an option
else:
option_tuple = self._parse_optional(arg_string)
if option_tuple is None:
- pattern = 'A'
+ pattern = "A"
else:
option_string_indices[i] = option_tuple
- pattern = 'O'
+ pattern = "O"
arg_string_pattern_parts.append(pattern)
# join the pieces together to form the pattern
- arg_strings_pattern = ''.join(arg_string_pattern_parts)
+ arg_strings_pattern = "".join(arg_string_pattern_parts)
# converts arg strings to the appropriate and then takes the action
seen_actions = set()
@@ -1933,7 +1933,7 @@ def take_action(action, argument_strings, option_string=None):
seen_non_default_actions.add(action)
for conflict_action in action_conflicts.get(action, []):
if conflict_action in seen_non_default_actions:
- msg = _('not allowed with argument %s')
+ msg = _("not allowed with argument %s")
action_name = _get_action_name(conflict_action)
raise ArgumentError(action, msg % action_name)
@@ -1963,7 +1963,7 @@ def consume_optional(start_index):
# if there is an explicit argument, try to match the
# optional's string arguments to only this
if explicit_arg is not None:
- arg_count = match_argument(action, 'A')
+ arg_count = match_argument(action, "A")
# if the action is a single-dash option and takes no
# arguments, try to parse more single-dash options out
@@ -1972,7 +1972,7 @@ def consume_optional(start_index):
if (
arg_count == 0
and option_string[1] not in chars
- and explicit_arg != ''
+ and explicit_arg != ""
):
action_tuples.append((action, [], option_string))
char = option_string[0]
@@ -1983,7 +1983,7 @@ def consume_optional(start_index):
action = optionals_map[option_string]
explicit_arg = new_explicit_arg
else:
- msg = _('ignored explicit argument %r')
+ msg = _("ignored explicit argument %r")
raise ArgumentError(action, msg % explicit_arg)
# if the action expect exactly one argument, we've
@@ -1997,7 +1997,7 @@ def consume_optional(start_index):
# error if a double-dash option did not use the
# explicit argument
else:
- msg = _('ignored explicit argument %r')
+ msg = _("ignored explicit argument %r")
raise ArgumentError(action, msg % explicit_arg)
# if there is no explicit argument, try to match the
@@ -2104,8 +2104,8 @@ def consume_positionals(start_index):
self._get_value(action, action.default))
if required_actions:
- self.error(_('the following arguments are required: %s') %
- ', '.join(required_actions))
+ self.error(_("the following arguments are required: %s") %
+ ", ".join(required_actions))
# make sure all required groups had one option present
for group in self._mutually_exclusive_groups:
@@ -2119,8 +2119,8 @@ def consume_positionals(start_index):
names = [_get_action_name(action)
for action in group._group_actions
if action.help is not SUPPRESS]
- msg = _('one of the arguments %s is required')
- self.error(msg % ' '.join(names))
+ msg = _("one of the arguments %s is required")
+ self.error(msg % " ".join(names))
# return the updated namespace and the extra arguments
return namespace, extras
@@ -2162,14 +2162,14 @@ def _match_argument(self, action, arg_strings_pattern):
# raise an exception if we weren't able to find a match
if match is None:
nargs_errors = {
- None: _('expected one argument'),
- OPTIONAL: _('expected at most one argument'),
- ONE_OR_MORE: _('expected at least one argument'),
+ None: _("expected one argument"),
+ OPTIONAL: _("expected at most one argument"),
+ ONE_OR_MORE: _("expected at least one argument"),
}
msg = nargs_errors.get(action.nargs)
if msg is None:
- msg = ngettext('expected %s argument',
- 'expected %s arguments',
+ msg = ngettext("expected %s argument",
+ "expected %s arguments",
action.nargs) % action.nargs
raise ArgumentError(action, msg)
@@ -2182,7 +2182,7 @@ def _match_arguments_partial(self, actions, arg_strings_pattern):
result = []
for i in range(len(actions), 0, -1):
actions_slice = actions[:i]
- pattern = ''.join([self._get_nargs_pattern(action)
+ pattern = "".join([self._get_nargs_pattern(action)
for action in actions_slice])
match = _re.match(pattern, arg_strings_pattern)
if match is not None:
@@ -2198,7 +2198,7 @@ def _parse_optional(self, arg_string):
return None
# if it doesn't start with a prefix, it was meant to be positional
- if not arg_string[0] in self.prefix_chars:
+ if arg_string[0] not in self.prefix_chars:
return None
# if the option string is present in the parser, return the action
@@ -2211,8 +2211,8 @@ def _parse_optional(self, arg_string):
return None
# if the option string before the "=" is present, return the action
- if '=' in arg_string:
- option_string, explicit_arg = arg_string.split('=', 1)
+ if "=" in arg_string:
+ option_string, explicit_arg = arg_string.split("=", 1)
if option_string in self._option_string_actions:
action = self._option_string_actions[option_string]
return action, option_string, explicit_arg
@@ -2223,10 +2223,10 @@ def _parse_optional(self, arg_string):
# if multiple actions match, the option string was ambiguous
if len(option_tuples) > 1:
- options = ', '.join([option_string
+ options = ", ".join([option_string
for action, option_string, explicit_arg in option_tuples])
- args = {'option': arg_string, 'matches': options}
- msg = _('ambiguous option: %(option)s could match %(matches)s')
+ args = {"option": arg_string, "matches": options}
+ msg = _("ambiguous option: %(option)s could match %(matches)s")
self.error(msg % args)
# if exactly one action matched, this segmentation is good,
@@ -2243,7 +2243,7 @@ def _parse_optional(self, arg_string):
return None
# if it contains a space, it was meant to be a positional
- if ' ' in arg_string:
+ if " " in arg_string:
return None
# it was meant to be an optional but there is no such option
@@ -2258,8 +2258,8 @@ def _get_option_tuples(self, option_string):
chars = self.prefix_chars
if option_string[0] in chars and option_string[1] in chars:
if self.allow_abbrev:
- if '=' in option_string:
- option_prefix, explicit_arg = option_string.split('=', 1)
+ if "=" in option_string:
+ option_prefix, explicit_arg = option_string.split("=", 1)
else:
option_prefix = option_string
explicit_arg = None
@@ -2290,7 +2290,7 @@ def _get_option_tuples(self, option_string):
# shouldn't ever get here
else:
- self.error(_('unexpected option string: %s') % option_string)
+ self.error(_("unexpected option string: %s") % option_string)
# return the collected option tuples
return result
@@ -2302,40 +2302,40 @@ def _get_nargs_pattern(self, action):
# the default (None) is assumed to be a single argument
if nargs is None:
- nargs_pattern = '(-*A-*)'
+ nargs_pattern = "(-*A-*)"
# allow zero or one arguments
elif nargs == OPTIONAL:
- nargs_pattern = '(-*A?-*)'
+ nargs_pattern = "(-*A?-*)"
# allow zero or more arguments
elif nargs == ZERO_OR_MORE:
- nargs_pattern = '(-*[A-]*)'
+ nargs_pattern = "(-*[A-]*)"
# allow one or more arguments
elif nargs == ONE_OR_MORE:
- nargs_pattern = '(-*A[A-]*)'
+ nargs_pattern = "(-*A[A-]*)"
# allow any number of options or arguments
elif nargs == REMAINDER:
- nargs_pattern = '([-AO]*)'
+ nargs_pattern = "([-AO]*)"
# allow one argument followed by any number of options or arguments
elif nargs == PARSER:
- nargs_pattern = '(-*A[-AO]*)'
+ nargs_pattern = "(-*A[-AO]*)"
# suppress action, like nargs=0
elif nargs == SUPPRESS:
- nargs_pattern = '(-*-*)'
+ nargs_pattern = "(-*-*)"
# all others should be integers
else:
- nargs_pattern = '(-*%s-*)' % '-*'.join('A' * nargs)
+ nargs_pattern = "(-*%s-*)" % "-*".join("A" * nargs)
# if this is an optional action, -- is not allowed
if action.option_strings:
- nargs_pattern = nargs_pattern.replace('-*', '')
- nargs_pattern = nargs_pattern.replace('-', '')
+ nargs_pattern = nargs_pattern.replace("-*", "")
+ nargs_pattern = nargs_pattern.replace("-", "")
# return the pattern
return nargs_pattern
@@ -2347,8 +2347,8 @@ def _get_nargs_pattern(self, action):
def parse_intermixed_args(self, args=None, namespace=None):
args, argv = self.parse_known_intermixed_args(args, namespace)
if argv:
- msg = _('unrecognized arguments: %s')
- self.error(msg % ' '.join(argv))
+ msg = _("unrecognized arguments: %s")
+ self.error(msg % " ".join(argv))
return args
def parse_known_intermixed_args(self, args=None, namespace=None):
@@ -2368,13 +2368,13 @@ def parse_known_intermixed_args(self, args=None, namespace=None):
a = [action for action in positionals
if action.nargs in [PARSER, REMAINDER]]
if a:
- raise TypeError('parse_intermixed_args: positional arg'
- ' with nargs=%s'%a[0].nargs)
+ raise TypeError("parse_intermixed_args: positional arg"
+ " with nargs=%s"%a[0].nargs)
if [action.dest for group in self._mutually_exclusive_groups
for action in group._group_actions if action in positionals]:
- raise TypeError('parse_intermixed_args: positional in'
- ' mutuallyExclusiveGroup')
+ raise TypeError("parse_intermixed_args: positional in"
+ " mutuallyExclusiveGroup")
try:
save_usage = self.usage
@@ -2396,7 +2396,7 @@ def parse_known_intermixed_args(self, args=None, namespace=None):
if (hasattr(namespace, action.dest)
and getattr(namespace, action.dest)==[]):
from warnings import warn
- warn('Do not expect %s in %s' % (action.dest, namespace))
+ warn("Do not expect %s in %s" % (action.dest, namespace))
delattr(namespace, action.dest)
finally:
# restore nargs and usage before exiting
@@ -2432,7 +2432,7 @@ def _get_values(self, action, arg_strings):
# for everything but PARSER, REMAINDER args, strip out first '--'
if action.nargs not in [PARSER, REMAINDER]:
try:
- arg_strings.remove('--')
+ arg_strings.remove("--")
except ValueError:
pass
@@ -2485,9 +2485,9 @@ def _get_values(self, action, arg_strings):
return value
def _get_value(self, action, arg_string):
- type_func = self._registry_get('type', action.type, action.type)
+ type_func = self._registry_get("type", action.type, action.type)
if not callable(type_func):
- msg = _('%r is not callable')
+ msg = _("%r is not callable")
raise ArgumentError(action, msg % type_func)
# convert the value to the appropriate type
@@ -2496,15 +2496,15 @@ def _get_value(self, action, arg_string):
# ArgumentTypeErrors indicate errors
except ArgumentTypeError:
- name = getattr(action.type, '__name__', repr(action.type))
+ name = getattr(action.type, "__name__", repr(action.type))
msg = str(_sys.exc_info()[1])
raise ArgumentError(action, msg)
# TypeErrors or ValueErrors also indicate errors
except (TypeError, ValueError):
- name = getattr(action.type, '__name__', repr(action.type))
- args = {'type': name, 'value': arg_string}
- msg = _('invalid %(type)s value: %(value)r')
+ name = getattr(action.type, "__name__", repr(action.type))
+ args = {"type": name, "value": arg_string}
+ msg = _("invalid %(type)s value: %(value)r")
raise ArgumentError(action, msg % args)
# return the converted value
@@ -2513,9 +2513,9 @@ def _get_value(self, action, arg_string):
def _check_value(self, action, value):
# converted value must be one of the choices (if specified)
if action.choices is not None and value not in action.choices:
- args = {'value': value,
- 'choices': ', '.join(map(repr, action.choices))}
- msg = _('invalid choice: %(value)r (choose from %(choices)s)')
+ args = {"value": value,
+ "choices": ", ".join(map(repr, action.choices))}
+ msg = _("invalid choice: %(value)r (choose from %(choices)s)")
raise ArgumentError(action, msg % args)
# =======================
@@ -2590,5 +2590,5 @@ def error(self, message):
should either exit or raise an exception.
"""
self.print_usage(_sys.stderr)
- args = {'prog': self.prog, 'message': message}
- self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
+ args = {"prog": self.prog, "message": message}
+ self.exit(2, _("%(prog)s: error: %(message)s\n") % args)
diff --git a/.venv3.10/Lib/ast.py b/.venv3.10/Lib/ast.py
index 4f5f9827..f870d302 100644
--- a/.venv3.10/Lib/ast.py
+++ b/.venv3.10/Lib/ast.py
@@ -30,7 +30,7 @@
from enum import IntEnum, auto
-def parse(source, filename='', mode='exec', *,
+def parse(source, filename="", mode="exec", *,
type_comments=False, feature_version=None):
"""
Parse the source into an AST node.
@@ -61,14 +61,14 @@ def literal_eval(node_or_string):
Caution: A complex expression can overflow the C stack and cause a crash.
"""
if isinstance(node_or_string, str):
- node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
+ node_or_string = parse(node_or_string.lstrip(" \t"), mode="eval")
if isinstance(node_or_string, Expression):
node_or_string = node_or_string.body
def _raise_malformed_node(node):
msg = "malformed node or string"
- if lno := getattr(node, 'lineno', None):
- msg += f' on line {lno}'
- raise ValueError(msg + f': {node!r}')
+ if lno := getattr(node, "lineno", None):
+ msg += f" on line {lno}"
+ raise ValueError(msg + f": {node!r}")
def _convert_num(node):
if not isinstance(node, Constant) or type(node.value) not in (int, float, complex):
_raise_malformed_node(node)
@@ -91,7 +91,7 @@ def _convert(node):
elif isinstance(node, Set):
return set(map(_convert, node.elts))
elif (isinstance(node, Call) and isinstance(node.func, Name) and
- node.func.id == 'set' and node.args == node.keywords == []):
+ node.func.id == "set" and node.args == node.keywords == []):
return set()
elif isinstance(node, Dict):
if len(node.keys) != len(node.values):
@@ -125,11 +125,11 @@ def dump(node, annotate_fields=True, include_attributes=False, *, indent=None):
def _format(node, level=0):
if indent is not None:
level += 1
- prefix = '\n' + indent * level
- sep = ',\n' + indent * level
+ prefix = "\n" + indent * level
+ sep = ",\n" + indent * level
else:
- prefix = ''
- sep = ', '
+ prefix = ""
+ sep = ", "
if isinstance(node, AST):
cls = type(node)
args = []
@@ -147,7 +147,7 @@ def _format(node, level=0):
value, simple = _format(value, level)
allsimple = allsimple and simple
if keywords:
- args.append('%s=%s' % (name, value))
+ args.append("%s=%s" % (name, value))
else:
args.append(value)
if include_attributes and node._attributes:
@@ -160,20 +160,20 @@ def _format(node, level=0):
continue
value, simple = _format(value, level)
allsimple = allsimple and simple
- args.append('%s=%s' % (name, value))
+ args.append("%s=%s" % (name, value))
if allsimple and len(args) <= 3:
- return '%s(%s)' % (node.__class__.__name__, ', '.join(args)), not args
- return '%s(%s%s)' % (node.__class__.__name__, prefix, sep.join(args)), False
+ return "%s(%s)" % (node.__class__.__name__, ", ".join(args)), not args
+ return "%s(%s%s)" % (node.__class__.__name__, prefix, sep.join(args)), False
elif isinstance(node, list):
if not node:
- return '[]', True
- return '[%s%s]' % (prefix, sep.join(_format(x, level)[0] for x in node)), False
+ return "[]", True
+ return "[%s%s]" % (prefix, sep.join(_format(x, level)[0] for x in node)), False
return repr(node), True
if not isinstance(node, AST):
- raise TypeError('expected AST, got %r' % node.__class__.__name__)
+ raise TypeError("expected AST, got %r" % node.__class__.__name__)
if indent is not None and not isinstance(indent, str):
- indent = ' ' * indent
+ indent = " " * indent
return _format(node)[0]
@@ -182,7 +182,7 @@ def copy_location(new_node, old_node):
Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
attributes) from *old_node* to *new_node* if possible, and return *new_node*.
"""
- for attr in 'lineno', 'col_offset', 'end_lineno', 'end_col_offset':
+ for attr in "lineno", "col_offset", "end_lineno", "end_col_offset":
if attr in old_node._attributes and attr in new_node._attributes:
value = getattr(old_node, attr, None)
# end_lineno and end_col_offset are optional attributes, and they
@@ -203,23 +203,23 @@ def fix_missing_locations(node):
parent node. It works recursively starting at *node*.
"""
def _fix(node, lineno, col_offset, end_lineno, end_col_offset):
- if 'lineno' in node._attributes:
- if not hasattr(node, 'lineno'):
+ if "lineno" in node._attributes:
+ if not hasattr(node, "lineno"):
node.lineno = lineno
else:
lineno = node.lineno
- if 'end_lineno' in node._attributes:
- if getattr(node, 'end_lineno', None) is None:
+ if "end_lineno" in node._attributes:
+ if getattr(node, "end_lineno", None) is None:
node.end_lineno = end_lineno
else:
end_lineno = node.end_lineno
- if 'col_offset' in node._attributes:
- if not hasattr(node, 'col_offset'):
+ if "col_offset" in node._attributes:
+ if not hasattr(node, "col_offset"):
node.col_offset = col_offset
else:
col_offset = node.col_offset
- if 'end_col_offset' in node._attributes:
- if getattr(node, 'end_col_offset', None) is None:
+ if "end_col_offset" in node._attributes:
+ if getattr(node, "end_col_offset", None) is None:
node.end_col_offset = end_col_offset
else:
end_col_offset = node.end_col_offset
@@ -239,11 +239,11 @@ def increment_lineno(node, n=1):
# TypeIgnore is a special case where lineno is not an attribute
# but rather a field of the node itself.
if isinstance(child, TypeIgnore):
- child.lineno = getattr(child, 'lineno', 0) + n
+ child.lineno = getattr(child, "lineno", 0) + n
continue
- if 'lineno' in child._attributes:
- child.lineno = getattr(child, 'lineno', 0) + n
+ if "lineno" in child._attributes:
+ child.lineno = getattr(child, "lineno", 0) + n
if (
"end_lineno" in child._attributes
and (end_lineno := getattr(child, "end_lineno", 0)) is not None
@@ -311,18 +311,18 @@ def _splitlines_no_ff(source):
"""
idx = 0
lines = []
- next_line = ''
+ next_line = ""
while idx < len(source):
c = source[idx]
next_line += c
idx += 1
# Keep \r\n together
- if c == '\r' and idx < len(source) and source[idx] == '\n':
- next_line += '\n'
+ if c == "\r" and idx < len(source) and source[idx] == "\n":
+ next_line += "\n"
idx += 1
- if c in '\r\n':
+ if c in "\r\n":
lines.append(next_line)
- next_line = ''
+ next_line = ""
if next_line:
lines.append(next_line)
@@ -331,12 +331,12 @@ def _splitlines_no_ff(source):
def _pad_whitespace(source):
r"""Replace all chars except '\f\t' in a line with spaces."""
- result = ''
+ result = ""
for c in source:
- if c in '\f\t':
+ if c in "\f\t":
result += c
else:
- result += ' '
+ result += " "
return result
@@ -366,7 +366,7 @@ def get_source_segment(source, node, *, padded=False):
if padded:
padding = _pad_whitespace(lines[lineno].encode()[:col_offset].decode())
else:
- padding = ''
+ padding = ""
first = padding + lines[lineno].encode()[col_offset:].decode()
last = lines[end_lineno].encode()[:end_col_offset].decode()
@@ -374,7 +374,7 @@ def get_source_segment(source, node, *, padded=False):
lines.insert(0, first)
lines.append(last)
- return ''.join(lines)
+ return "".join(lines)
def walk(node):
@@ -413,7 +413,7 @@ class name of the node. So a `TryFinally` node visit function would
def visit(self, node):
"""Visit a node."""
- method = 'visit_' + node.__class__.__name__
+ method = "visit_" + node.__class__.__name__
visitor = getattr(self, method, self.generic_visit)
return visitor(node)
@@ -436,7 +436,7 @@ def visit_Constant(self, node):
type_name = name
break
if type_name is not None:
- method = 'visit_' + type_name
+ method = "visit_" + type_name
try:
visitor = getattr(self, method)
except AttributeError:
@@ -509,7 +509,7 @@ def generic_visit(self, node):
# If the ast module is loaded more than once, only add deprecated methods once
-if not hasattr(Constant, 'n'):
+if not hasattr(Constant, "n"):
# The following code is for backward compatibility.
# It will be removed in future.
@@ -556,15 +556,15 @@ def _new(cls, *args, **kwargs):
return Constant.__new__(cls, *args, **kwargs)
class Num(Constant, metaclass=_ABC):
- _fields = ('n',)
+ _fields = ("n",)
__new__ = _new
class Str(Constant, metaclass=_ABC):
- _fields = ('s',)
+ _fields = ("s",)
__new__ = _new
class Bytes(Constant, metaclass=_ABC):
- _fields = ('s',)
+ _fields = ("s",)
__new__ = _new
class NameConstant(Constant, metaclass=_ABC):
@@ -590,14 +590,14 @@ def __new__(cls, *args, **kwargs):
}
_const_node_type_names = {
- bool: 'NameConstant', # should be before int
- type(None): 'NameConstant',
- int: 'Num',
- float: 'Num',
- complex: 'Num',
- str: 'Str',
- bytes: 'Bytes',
- type(...): 'Ellipsis',
+ bool: "NameConstant", # should be before int
+ type(None): "NameConstant",
+ int: "Num",
+ float: "Num",
+ complex: "Num",
+ str: "Str",
+ bytes: "Bytes",
+ type(...): "Ellipsis",
}
class slice(AST):
@@ -614,7 +614,7 @@ def __new__(cls, dims=(), **kwargs):
return Tuple(list(dims), Load(), **kwargs)
# If the ast module is loaded more than once, only add deprecated methods once
-if not hasattr(Tuple, 'dims'):
+if not hasattr(Tuple, "dims"):
# The following code is for backward compatibility.
# It will be removed in future.
@@ -950,7 +950,7 @@ def visit_Raise(self, node):
self.fill("raise")
if not node.exc:
if node.cause:
- raise ValueError(f"Node can't use cause without an exception.")
+ raise ValueError("Node can't use cause without an exception.")
return
self.write(" ")
self.traverse(node.exc)
@@ -1295,7 +1295,7 @@ def visit_Set(self, node):
else:
# `{}` would be interpreted as a dictionary literal, and
# `set` might be shadowed. Thus:
- self.write('{*()}')
+ self.write("{*()}")
def visit_Dict(self, node):
def write_key_value_pair(k, v):
@@ -1684,20 +1684,20 @@ def unparse(ast_obj):
def main():
import argparse
- parser = argparse.ArgumentParser(prog='python -m ast')
- parser.add_argument('infile', type=argparse.FileType(mode='rb'), nargs='?',
- default='-',
- help='the file to parse; defaults to stdin')
- parser.add_argument('-m', '--mode', default='exec',
- choices=('exec', 'single', 'eval', 'func_type'),
- help='specify what kind of code must be parsed')
- parser.add_argument('--no-type-comments', default=True, action='store_false',
+ parser = argparse.ArgumentParser(prog="python -m ast")
+ parser.add_argument("infile", type=argparse.FileType(mode="rb"), nargs="?",
+ default="-",
+ help="the file to parse; defaults to stdin")
+ parser.add_argument("-m", "--mode", default="exec",
+ choices=("exec", "single", "eval", "func_type"),
+ help="specify what kind of code must be parsed")
+ parser.add_argument("--no-type-comments", default=True, action="store_false",
help="don't add information about type comments")
- parser.add_argument('-a', '--include-attributes', action='store_true',
- help='include attributes such as line numbers and '
- 'column offsets')
- parser.add_argument('-i', '--indent', type=int, default=3,
- help='indentation of nodes (number of spaces)')
+ parser.add_argument("-a", "--include-attributes", action="store_true",
+ help="include attributes such as line numbers and "
+ "column offsets")
+ parser.add_argument("-i", "--indent", type=int, default=3,
+ help="indentation of nodes (number of spaces)")
args = parser.parse_args()
with args.infile as infile:
@@ -1705,5 +1705,5 @@ def main():
tree = parse(source, args.infile.name, args.mode, type_comments=args.no_type_comments)
print(dump(tree, include_attributes=args.include_attributes, indent=args.indent))
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/.venv3.10/Lib/asynchat.py b/.venv3.10/Lib/asynchat.py
index e081e67c..a5f6a2ce 100644
--- a/.venv3.10/Lib/asynchat.py
+++ b/.venv3.10/Lib/asynchat.py
@@ -50,8 +50,8 @@
from warnings import warn
warn(
- 'The asynchat module is deprecated and will be removed in Python 3.12. '
- 'The recommended replacement is asyncio',
+ "The asynchat module is deprecated and will be removed in Python 3.12. "
+ "The recommended replacement is asyncio",
DeprecationWarning,
stacklevel=2)
@@ -70,11 +70,11 @@ class async_chat(asyncore.dispatcher):
# sign of an application bug that we don't want to pass silently
use_encoding = 0
- encoding = 'latin-1'
+ encoding = "latin-1"
def __init__(self, sock=None, map=None):
# for string terminator matching
- self.ac_in_buffer = b''
+ self.ac_in_buffer = b""
# we use a list here rather than io.BytesIO for a few reasons...
# del lst[:] is faster than bio.truncate(0)
@@ -93,7 +93,7 @@ def _collect_incoming_data(self, data):
self.incoming.append(data)
def _get_data(self):
- d = b''.join(self.incoming)
+ d = b"".join(self.incoming)
del self.incoming[:]
return d
@@ -108,7 +108,7 @@ def set_terminator(self, term):
if isinstance(term, str) and self.use_encoding:
term = bytes(term, self.encoding)
elif isinstance(term, int) and term < 0:
- raise ValueError('the number of received bytes must be positive')
+ raise ValueError("the number of received bytes must be positive")
self.terminator = term
def get_terminator(self):
@@ -144,13 +144,13 @@ def handle_read(self):
if not terminator:
# no terminator, collect it all
self.collect_incoming_data(self.ac_in_buffer)
- self.ac_in_buffer = b''
+ self.ac_in_buffer = b""
elif isinstance(terminator, int):
# numeric terminator
n = terminator
if lb < n:
self.collect_incoming_data(self.ac_in_buffer)
- self.ac_in_buffer = b''
+ self.ac_in_buffer = b""
self.terminator = self.terminator - lb
else:
self.collect_incoming_data(self.ac_in_buffer[:n])
@@ -189,7 +189,7 @@ def handle_read(self):
else:
# no prefix, collect it all
self.collect_incoming_data(self.ac_in_buffer)
- self.ac_in_buffer = b''
+ self.ac_in_buffer = b""
def handle_write(self):
self.initiate_send()
@@ -199,7 +199,7 @@ def handle_close(self):
def push(self, data):
if not isinstance(data, (bytes, bytearray, memoryview)):
- raise TypeError('data argument must be byte-ish (%r)',
+ raise TypeError("data argument must be byte-ish (%r)",
type(data))
sabs = self.ac_out_buffer_size
if len(data) > sabs:
@@ -271,7 +271,7 @@ def initiate_send(self):
def discard_buffers(self):
# Emergencies only!
- self.ac_in_buffer = b''
+ self.ac_in_buffer = b""
del self.incoming[:]
self.producer_fifo.clear()
@@ -289,7 +289,7 @@ def more(self):
return result
else:
result = self.data
- self.data = b''
+ self.data = b""
return result
diff --git a/.venv3.10/Lib/asyncio/__main__.py b/.venv3.10/Lib/asyncio/__main__.py
index 73330f4a..58bfa913 100644
--- a/.venv3.10/Lib/asyncio/__main__.py
+++ b/.venv3.10/Lib/asyncio/__main__.py
@@ -79,26 +79,26 @@ def run(self):
console.interact(
banner=banner,
- exitmsg='exiting asyncio REPL...')
+ exitmsg="exiting asyncio REPL...")
finally:
warnings.filterwarnings(
- 'ignore',
- message=r'^coroutine .* was never awaited$',
+ "ignore",
+ message=r"^coroutine .* was never awaited$",
category=RuntimeWarning)
loop.call_soon_threadsafe(loop.stop)
-if __name__ == '__main__':
+if __name__ == "__main__":
sys.audit("cpython.run_stdin")
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
- repl_locals = {'asyncio': asyncio}
- for key in {'__name__', '__package__',
- '__loader__', '__spec__',
- '__builtins__', '__file__'}:
+ repl_locals = {"asyncio": asyncio}
+ for key in {"__name__", "__package__",
+ "__loader__", "__spec__",
+ "__builtins__", "__file__"}:
repl_locals[key] = locals()[key]
console = AsyncIOInteractiveConsole(repl_locals, loop)
diff --git a/.venv3.10/Lib/asyncio/base_events.py b/.venv3.10/Lib/asyncio/base_events.py
index 0890e9e1..2803c9ae 100644
--- a/.venv3.10/Lib/asyncio/base_events.py
+++ b/.venv3.10/Lib/asyncio/base_events.py
@@ -49,7 +49,7 @@
from .log import logger
-__all__ = 'BaseEventLoop','Server',
+__all__ = "BaseEventLoop","Server",
# Minimum number of _scheduled timer handles before cleanup of
@@ -61,7 +61,7 @@
_MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5
-_HAS_IPv6 = hasattr(socket, 'AF_INET6')
+_HAS_IPv6 = hasattr(socket, "AF_INET6")
# Maximum timeout passed to select to avoid OS limitations
MAXIMUM_SELECT_TIMEOUT = 24 * 3600
@@ -73,7 +73,7 @@
def _format_handle(handle):
cb = handle._callback
- if isinstance(getattr(cb, '__self__', None), tasks.Task):
+ if isinstance(getattr(cb, "__self__", None), tasks.Task):
# format the task
return repr(cb.__self__)
else:
@@ -82,28 +82,28 @@ def _format_handle(handle):
def _format_pipe(fd):
if fd == subprocess.PIPE:
- return ''
+ return ""
elif fd == subprocess.STDOUT:
- return ''
+ return ""
else:
return repr(fd)
def _set_reuseport(sock):
- if not hasattr(socket, 'SO_REUSEPORT'):
- raise ValueError('reuse_port not supported by socket module')
+ if not hasattr(socket, "SO_REUSEPORT"):
+ raise ValueError("reuse_port not supported by socket module")
else:
try:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
except OSError:
- raise ValueError('reuse_port not supported by socket module, '
- 'SO_REUSEPORT defined but not implemented.')
+ raise ValueError("reuse_port not supported by socket module, "
+ "SO_REUSEPORT defined but not implemented.")
def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0):
# Try to skip getaddrinfo if "host" is already an IP. Users might have
# handled name resolution in their own code and pass in resolved IPs.
- if not hasattr(socket, 'inet_pton'):
+ if not hasattr(socket, "inet_pton"):
return
if proto not in {0, socket.IPPROTO_TCP, socket.IPPROTO_UDP} or \
@@ -119,9 +119,9 @@ def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0):
if port is None:
port = 0
- elif isinstance(port, bytes) and port == b'':
+ elif isinstance(port, bytes) and port == b"":
port = 0
- elif isinstance(port, str) and port == '':
+ elif isinstance(port, str) and port == "":
port = 0
else:
# If port's a service name like "http", don't skip getaddrinfo.
@@ -138,8 +138,8 @@ def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0):
afs = [family]
if isinstance(host, bytes):
- host = host.decode('idna')
- if '%' in host:
+ host = host.decode("idna")
+ if "%" in host:
# Linux's inet_pton doesn't accept an IPv6 zone index after host,
# like '::1%lo0'.
return None
@@ -149,9 +149,9 @@ def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0):
socket.inet_pton(af, host)
# The host has already been resolved.
if _HAS_IPv6 and af == socket.AF_INET6:
- return af, type, proto, '', (host, port, flowinfo, scopeid)
+ return af, type, proto, "", (host, port, flowinfo, scopeid)
else:
- return af, type, proto, '', (host, port)
+ return af, type, proto, "", (host, port)
except OSError:
pass
@@ -191,7 +191,7 @@ def _run_until_complete_cb(fut):
futures._get_loop(fut).stop()
-if hasattr(socket, 'TCP_NODELAY'):
+if hasattr(socket, "TCP_NODELAY"):
def _set_nodelay(sock):
if (sock.family in {socket.AF_INET, socket.AF_INET6} and
sock.type == socket.SOCK_STREAM and
@@ -291,7 +291,7 @@ def __init__(self, loop, sockets, protocol_factory, ssl_context, backlog,
self._serving_forever_fut = None
def __repr__(self):
- return f'<{self.__class__.__name__} sockets={self.sockets!r}>'
+ return f"<{self.__class__.__name__} sockets={self.sockets!r}>"
def _attach(self):
assert self._sockets is not None
@@ -360,9 +360,9 @@ async def start_serving(self):
async def serve_forever(self):
if self._serving_forever_fut is not None:
raise RuntimeError(
- f'server {self!r} is already being awaited on serve_forever()')
+ f"server {self!r} is already being awaited on serve_forever()")
if self._sockets is None:
- raise RuntimeError(f'server {self!r} is closed')
+ raise RuntimeError(f"server {self!r} is closed")
self._start_serving()
self._serving_forever_fut = self._loop.create_future()
@@ -399,7 +399,7 @@ def __init__(self):
# Identifier of the thread running the event loop, or None if the
# event loop is not running
self._thread_id = None
- self._clock_resolution = time.get_clock_info('monotonic').resolution
+ self._clock_resolution = time.get_clock_info("monotonic").resolution
self._exception_handler = None
self.set_debug(coroutines._is_debug_mode())
# In debug mode, if the execution of a callback or a step of a task
@@ -420,8 +420,8 @@ def __init__(self):
def __repr__(self):
return (
- f'<{self.__class__.__name__} running={self.is_running()} '
- f'closed={self.is_closed()} debug={self.get_debug()}>'
+ f"<{self.__class__.__name__} running={self.is_running()} "
+ f"closed={self.is_closed()} debug={self.get_debug()}>"
)
def create_future(self):
@@ -455,7 +455,7 @@ def set_task_factory(self, factory):
must return a Future.
"""
if factory is not None and not callable(factory):
- raise TypeError('task factory must be a callable or None')
+ raise TypeError("task factory must be a callable or None")
self._task_factory = factory
def get_task_factory(self):
@@ -512,11 +512,11 @@ def _process_events(self, event_list):
def _check_closed(self):
if self._closed:
- raise RuntimeError('Event loop is closed')
+ raise RuntimeError("Event loop is closed")
def _check_default_executor(self):
if self._executor_shutdown_called:
- raise RuntimeError('Executor shutdown has been called')
+ raise RuntimeError("Executor shutdown has been called")
def _asyncgen_finalizer_hook(self, agen):
self._asyncgens.discard(agen)
@@ -551,10 +551,10 @@ async def shutdown_asyncgens(self):
for result, agen in zip(results, closing_agens):
if isinstance(result, Exception):
self.call_exception_handler({
- 'message': f'an error occurred during closing of '
- f'asynchronous generator {agen!r}',
- 'exception': result,
- 'asyncgen': agen
+ "message": f"an error occurred during closing of "
+ f"asynchronous generator {agen!r}",
+ "exception": result,
+ "asyncgen": agen
})
async def shutdown_default_executor(self):
@@ -581,10 +581,10 @@ def _do_shutdown(self, future):
def _check_running(self):
if self.is_running():
- raise RuntimeError('This event loop is already running')
+ raise RuntimeError("This event loop is already running")
if events._get_running_loop() is not None:
raise RuntimeError(
- 'Cannot run the event loop while another loop is running')
+ "Cannot run the event loop while another loop is running")
def run_forever(self):
"""Run until stop() is called."""
@@ -644,7 +644,7 @@ def run_until_complete(self, future):
finally:
future.remove_done_callback(_run_until_complete_cb)
if not future.done():
- raise RuntimeError('Event loop stopped before Future completed.')
+ raise RuntimeError("Event loop stopped before Future completed.")
return future.result()
@@ -732,7 +732,7 @@ def call_at(self, when, callback, *args, context=None):
self._check_closed()
if self._debug:
self._check_thread()
- self._check_callback(callback, 'call_at')
+ self._check_callback(callback, "call_at")
timer = events.TimerHandle(when, callback, args, self, context)
if timer._source_traceback:
del timer._source_traceback[-1]
@@ -753,7 +753,7 @@ def call_soon(self, callback, *args, context=None):
self._check_closed()
if self._debug:
self._check_thread()
- self._check_callback(callback, 'call_soon')
+ self._check_callback(callback, "call_soon")
handle = self._call_soon(callback, args, context)
if handle._source_traceback:
del handle._source_traceback[-1]
@@ -766,8 +766,8 @@ def _check_callback(self, callback, method):
f"coroutines cannot be used with {method}()")
if not callable(callback):
raise TypeError(
- f'a callable object was expected by {method}(), '
- f'got {callback!r}')
+ f"a callable object was expected by {method}(), "
+ f"got {callback!r}")
def _call_soon(self, callback, args, context):
handle = events.Handle(callback, args, self, context)
@@ -797,7 +797,7 @@ def call_soon_threadsafe(self, callback, *args, context=None):
"""Like call_soon(), but thread-safe."""
self._check_closed()
if self._debug:
- self._check_callback(callback, 'call_soon_threadsafe')
+ self._check_callback(callback, "call_soon_threadsafe")
handle = self._call_soon(callback, args, context)
if handle._source_traceback:
del handle._source_traceback[-1]
@@ -807,14 +807,14 @@ def call_soon_threadsafe(self, callback, *args, context=None):
def run_in_executor(self, executor, func, *args):
self._check_closed()
if self._debug:
- self._check_callback(func, 'run_in_executor')
+ self._check_callback(func, "run_in_executor")
if executor is None:
executor = self._default_executor
# Only check when the default executor is being used
self._check_default_executor()
if executor is None:
executor = concurrent.futures.ThreadPoolExecutor(
- thread_name_prefix='asyncio'
+ thread_name_prefix="asyncio"
)
self._default_executor = executor
return futures.wrap_future(
@@ -823,30 +823,30 @@ def run_in_executor(self, executor, func, *args):
def set_default_executor(self, executor):
if not isinstance(executor, concurrent.futures.ThreadPoolExecutor):
warnings.warn(
- 'Using the default executor that is not an instance of '
- 'ThreadPoolExecutor is deprecated and will be prohibited '
- 'in Python 3.9',
+ "Using the default executor that is not an instance of "
+ "ThreadPoolExecutor is deprecated and will be prohibited "
+ "in Python 3.9",
DeprecationWarning, 2)
self._default_executor = executor
def _getaddrinfo_debug(self, host, port, family, type, proto, flags):
msg = [f"{host}:{port!r}"]
if family:
- msg.append(f'family={family!r}')
+ msg.append(f"family={family!r}")
if type:
- msg.append(f'type={type!r}')
+ msg.append(f"type={type!r}")
if proto:
- msg.append(f'proto={proto!r}')
+ msg.append(f"proto={proto!r}")
if flags:
- msg.append(f'flags={flags!r}')
- msg = ', '.join(msg)
- logger.debug('Get address info %s', msg)
+ msg.append(f"flags={flags!r}")
+ msg = ", ".join(msg)
+ logger.debug("Get address info %s", msg)
t0 = self.time()
addrinfo = socket.getaddrinfo(host, port, family, type, proto, flags)
dt = self.time() - t0
- msg = f'Getting address info {msg} took {dt * 1e3:.3f}ms: {addrinfo!r}'
+ msg = f"Getting address info {msg} took {dt * 1e3:.3f}ms: {addrinfo!r}"
if dt >= self.slow_callback_duration:
logger.info(msg)
else:
@@ -876,7 +876,7 @@ async def sock_sendfile(self, sock, file, offset=0, count=None,
try:
return await self._sock_sendfile_native(sock, file,
offset, count)
- except exceptions.SendfileNotAvailableError as exc:
+ except exceptions.SendfileNotAvailableError:
if not fallback:
raise
return await self._sock_sendfile_fallback(sock, file,
@@ -912,11 +912,11 @@ async def _sock_sendfile_fallback(self, sock, file, offset, count):
total_sent += read
return total_sent
finally:
- if total_sent > 0 and hasattr(file, 'seek'):
+ if total_sent > 0 and hasattr(file, "seek"):
file.seek(offset + total_sent)
def _check_sendfile_params(self, sock, file, offset, count):
- if 'b' not in getattr(file, 'mode', 'b'):
+ if "b" not in getattr(file, "mode", "b"):
raise ValueError("file should be opened in binary mode")
if not sock.type == socket.SOCK_STREAM:
raise ValueError("only SOCK_STREAM type sockets are supported")
@@ -955,9 +955,9 @@ async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None):
break
except OSError as exc:
msg = (
- f'error while attempting to bind on '
- f'address {laddr!r}: '
- f'{exc.strerror.lower()}'
+ f"error while attempting to bind on "
+ f"address {laddr!r}: "
+ f"{exc.strerror.lower()}"
)
exc = OSError(exc.errno, msg)
my_exceptions.append(exc)
@@ -999,7 +999,7 @@ async def create_connection(
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
- raise ValueError('server_hostname is only meaningful with ssl')
+ raise ValueError("server_hostname is only meaningful with ssl")
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
@@ -1013,13 +1013,13 @@ async def create_connection(
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
- raise ValueError('You must set server_hostname '
- 'when using ssl without a host')
+ raise ValueError("You must set server_hostname "
+ "when using ssl without a host")
server_hostname = host
if ssl_handshake_timeout is not None and not ssl:
raise ValueError(
- 'ssl_handshake_timeout is only meaningful with ssl')
+ "ssl_handshake_timeout is only meaningful with ssl")
if sock is not None:
_check_ssl_socket(sock)
@@ -1031,13 +1031,13 @@ async def create_connection(
if host is not None or port is not None:
if sock is not None:
raise ValueError(
- 'host/port and sock can not be specified at the same time')
+ "host/port and sock can not be specified at the same time")
infos = await self._ensure_resolved(
(host, port), family=family,
type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self)
if not infos:
- raise OSError('getaddrinfo() returned empty list')
+ raise OSError("getaddrinfo() returned empty list")
if local_addr is not None:
laddr_infos = await self._ensure_resolved(
@@ -1045,7 +1045,7 @@ async def create_connection(
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
if not laddr_infos:
- raise OSError('getaddrinfo() returned empty list')
+ raise OSError("getaddrinfo() returned empty list")
else:
laddr_infos = None
@@ -1081,15 +1081,15 @@ async def create_connection(
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
- raise OSError('Multiple exceptions: {}'.format(
- ', '.join(str(exc) for exc in exceptions)))
+ raise OSError("Multiple exceptions: {}".format(
+ ", ".join(str(exc) for exc in exceptions)))
finally:
exceptions = None
else:
if sock is None:
raise ValueError(
- 'host and port was not specified and no sock specified')
+ "host and port was not specified and no sock specified")
if sock.type != socket.SOCK_STREAM:
# We allow AF_INET, AF_INET6, AF_UNIX as long as they
# are SOCK_STREAM.
@@ -1098,7 +1098,7 @@ async def create_connection(
# Disallowing AF_UNIX in this method, breaks backwards
# compatibility.
raise ValueError(
- f'A Stream Socket was expected, got {sock!r}')
+ f"A Stream Socket was expected, got {sock!r}")
transport, protocol = await self._create_connection_transport(
sock, protocol_factory, ssl, server_hostname,
@@ -1106,7 +1106,7 @@ async def create_connection(
if self._debug:
# Get the socket from the transport because SSL transport closes
# the old socket and creates a new SSL socket
- sock = transport.get_extra_info('socket')
+ sock = transport.get_extra_info("socket")
logger.debug("%r connected to %s:%r: (%r, %r)",
sock, host, port, transport, protocol)
return transport, protocol
@@ -1163,7 +1163,7 @@ async def sendfile(self, transport, file, offset=0, count=None,
"""
if transport.is_closing():
raise RuntimeError("Transport is closing")
- mode = getattr(transport, '_sendfile_compatible',
+ mode = getattr(transport, "_sendfile_compatible",
constants._SendfileMode.UNSUPPORTED)
if mode is constants._SendfileMode.UNSUPPORTED:
raise RuntimeError(
@@ -1172,7 +1172,7 @@ async def sendfile(self, transport, file, offset=0, count=None,
try:
return await self._sendfile_native(transport, file,
offset, count)
- except exceptions.SendfileNotAvailableError as exc:
+ except exceptions.SendfileNotAvailableError:
if not fallback:
raise
@@ -1209,7 +1209,7 @@ async def _sendfile_fallback(self, transp, file, offset, count):
transp.write(view[:read])
total_sent += read
finally:
- if total_sent > 0 and hasattr(file, 'seek'):
+ if total_sent > 0 and hasattr(file, "seek"):
file.seek(offset + total_sent)
await proto.restore()
@@ -1223,16 +1223,16 @@ async def start_tls(self, transport, protocol, sslcontext, *,
immediately.
"""
if ssl is None:
- raise RuntimeError('Python ssl module is not available')
+ raise RuntimeError("Python ssl module is not available")
if not isinstance(sslcontext, ssl.SSLContext):
raise TypeError(
- f'sslcontext is expected to be an instance of ssl.SSLContext, '
- f'got {sslcontext!r}')
+ f"sslcontext is expected to be an instance of ssl.SSLContext, "
+ f"got {sslcontext!r}")
- if not getattr(transport, '_start_tls_compatible', False):
+ if not getattr(transport, "_start_tls_compatible", False):
raise TypeError(
- f'transport {transport!r} is not supported by start_tls()')
+ f"transport {transport!r} is not supported by start_tls()")
waiter = self.create_future()
ssl_protocol = sslproto.SSLProtocol(
@@ -1268,7 +1268,7 @@ async def create_datagram_endpoint(self, protocol_factory,
if sock is not None:
if sock.type != socket.SOCK_DGRAM:
raise ValueError(
- f'A UDP Socket was expected, got {sock!r}')
+ f"A UDP Socket was expected, got {sock!r}")
if (local_addr or remote_addr or
family or proto or flags or
reuse_port or allow_broadcast):
@@ -1277,23 +1277,23 @@ async def create_datagram_endpoint(self, protocol_factory,
family=family, proto=proto, flags=flags,
reuse_address=reuse_address, reuse_port=reuse_port,
allow_broadcast=allow_broadcast)
- problems = ', '.join(f'{k}={v}' for k, v in opts.items() if v)
+ problems = ", ".join(f"{k}={v}" for k, v in opts.items() if v)
raise ValueError(
- f'socket modifier keyword arguments can not be used '
- f'when sock is specified. ({problems})')
+ f"socket modifier keyword arguments can not be used "
+ f"when sock is specified. ({problems})")
sock.setblocking(False)
r_addr = None
else:
if not (local_addr or remote_addr):
if family == 0:
- raise ValueError('unexpected address family')
+ raise ValueError("unexpected address family")
addr_pairs_info = (((family, proto), (None, None)),)
- elif hasattr(socket, 'AF_UNIX') and family == socket.AF_UNIX:
+ elif hasattr(socket, "AF_UNIX") and family == socket.AF_UNIX:
for addr in (local_addr, remote_addr):
if addr is not None and not isinstance(addr, str):
- raise TypeError('string is expected')
+ raise TypeError("string is expected")
- if local_addr and local_addr[0] not in (0, '\x00'):
+ if local_addr and local_addr[0] not in (0, "\x00"):
try:
if stat.S_ISSOCK(os.stat(local_addr).st_mode):
os.remove(local_addr)
@@ -1301,8 +1301,8 @@ async def create_datagram_endpoint(self, protocol_factory,
pass
except OSError as err:
# Directory may have permissions only to create socket.
- logger.error('Unable to check or remove stale UNIX '
- 'socket %r: %r',
+ logger.error("Unable to check or remove stale UNIX "
+ "socket %r: %r",
local_addr, err)
addr_pairs_info = (((family, proto),
@@ -1313,13 +1313,13 @@ async def create_datagram_endpoint(self, protocol_factory,
for idx, addr in ((0, local_addr), (1, remote_addr)):
if addr is not None:
assert isinstance(addr, tuple) and len(addr) == 2, (
- '2-tuple is expected')
+ "2-tuple is expected")
infos = await self._ensure_resolved(
addr, family=family, type=socket.SOCK_DGRAM,
proto=proto, flags=flags, loop=self)
if not infos:
- raise OSError('getaddrinfo() returned empty list')
+ raise OSError("getaddrinfo() returned empty list")
for fam, _, pro, _, address in infos:
key = (fam, pro)
@@ -1334,7 +1334,7 @@ async def create_datagram_endpoint(self, protocol_factory,
(remote_addr and addr_pair[1] is None))]
if not addr_pairs_info:
- raise ValueError('can not get address information')
+ raise ValueError("can not get address information")
exceptions = []
@@ -1423,7 +1423,7 @@ async def _create_server_getaddrinfo(self, host, port, family, flags):
type=socket.SOCK_STREAM,
flags=flags, loop=self)
if not infos:
- raise OSError(f'getaddrinfo({host!r}) returned empty list')
+ raise OSError(f"getaddrinfo({host!r}) returned empty list")
return infos
async def create_server(
@@ -1454,11 +1454,11 @@ async def create_server(
This method is a coroutine.
"""
if isinstance(ssl, bool):
- raise TypeError('ssl argument must be an SSLContext or None')
+ raise TypeError("ssl argument must be an SSLContext or None")
if ssl_handshake_timeout is not None and ssl is None:
raise ValueError(
- 'ssl_handshake_timeout is only meaningful with ssl')
+ "ssl_handshake_timeout is only meaningful with ssl")
if sock is not None:
_check_ssl_socket(sock)
@@ -1466,12 +1466,12 @@ async def create_server(
if host is not None or port is not None:
if sock is not None:
raise ValueError(
- 'host/port and sock can not be specified at the same time')
+ "host/port and sock can not be specified at the same time")
if reuse_address is None:
- reuse_address = os.name == 'posix' and sys.platform != 'cygwin'
+ reuse_address = os.name == "posix" and sys.platform != "cygwin"
sockets = []
- if host == '':
+ if host == "":
hosts = [None]
elif (isinstance(host, str) or
not isinstance(host, collections.abc.Iterable)):
@@ -1494,8 +1494,8 @@ async def create_server(
except socket.error:
# Assume it's a bad family/type/protocol combination.
if self._debug:
- logger.warning('create_server() failed to create '
- 'socket.socket(%r, %r, %r)',
+ logger.warning("create_server() failed to create "
+ "socket.socket(%r, %r, %r)",
af, socktype, proto, exc_info=True)
continue
sockets.append(sock)
@@ -1509,15 +1509,15 @@ async def create_server(
# listen on both address families.
if (_HAS_IPv6 and
af == socket.AF_INET6 and
- hasattr(socket, 'IPPROTO_IPV6')):
+ hasattr(socket, "IPPROTO_IPV6")):
sock.setsockopt(socket.IPPROTO_IPV6,
socket.IPV6_V6ONLY,
True)
try:
sock.bind(sa)
except OSError as err:
- raise OSError(err.errno, 'error while attempting '
- 'to bind on address %r: %s'
+ raise OSError(err.errno, "error while attempting "
+ "to bind on address %r: %s"
% (sa, err.strerror.lower())) from None
completed = True
finally:
@@ -1526,9 +1526,9 @@ async def create_server(
sock.close()
else:
if sock is None:
- raise ValueError('Neither host/port nor sock were specified')
+ raise ValueError("Neither host/port nor sock were specified")
if sock.type != socket.SOCK_STREAM:
- raise ValueError(f'A Stream Socket was expected, got {sock!r}')
+ raise ValueError(f"A Stream Socket was expected, got {sock!r}")
sockets = [sock]
for sock in sockets:
@@ -1551,22 +1551,22 @@ async def connect_accepted_socket(
*, ssl=None,
ssl_handshake_timeout=None):
if sock.type != socket.SOCK_STREAM:
- raise ValueError(f'A Stream Socket was expected, got {sock!r}')
+ raise ValueError(f"A Stream Socket was expected, got {sock!r}")
if ssl_handshake_timeout is not None and not ssl:
raise ValueError(
- 'ssl_handshake_timeout is only meaningful with ssl')
+ "ssl_handshake_timeout is only meaningful with ssl")
if sock is not None:
_check_ssl_socket(sock)
transport, protocol = await self._create_connection_transport(
- sock, protocol_factory, ssl, '', server_side=True,
+ sock, protocol_factory, ssl, "", server_side=True,
ssl_handshake_timeout=ssl_handshake_timeout)
if self._debug:
# Get the socket from the transport because SSL transport closes
# the old socket and creates a new SSL socket
- sock = transport.get_extra_info('socket')
+ sock = transport.get_extra_info("socket")
logger.debug("%r handled: (%r, %r)", sock, transport, protocol)
return transport, protocol
@@ -1582,7 +1582,7 @@ async def connect_read_pipe(self, protocol_factory, pipe):
raise
if self._debug:
- logger.debug('Read pipe %r connected: (%r, %r)',
+ logger.debug("Read pipe %r connected: (%r, %r)",
pipe.fileno(), transport, protocol)
return transport, protocol
@@ -1598,22 +1598,22 @@ async def connect_write_pipe(self, protocol_factory, pipe):
raise
if self._debug:
- logger.debug('Write pipe %r connected: (%r, %r)',
+ logger.debug("Write pipe %r connected: (%r, %r)",
pipe.fileno(), transport, protocol)
return transport, protocol
def _log_subprocess(self, msg, stdin, stdout, stderr):
info = [msg]
if stdin is not None:
- info.append(f'stdin={_format_pipe(stdin)}')
+ info.append(f"stdin={_format_pipe(stdin)}")
if stdout is not None and stderr == subprocess.STDOUT:
- info.append(f'stdout=stderr={_format_pipe(stdout)}')
+ info.append(f"stdout=stderr={_format_pipe(stdout)}")
else:
if stdout is not None:
- info.append(f'stdout={_format_pipe(stdout)}')
+ info.append(f"stdout={_format_pipe(stdout)}")
if stderr is not None:
- info.append(f'stderr={_format_pipe(stderr)}')
- logger.debug(' '.join(info))
+ info.append(f"stderr={_format_pipe(stderr)}")
+ logger.debug(" ".join(info))
async def subprocess_shell(self, protocol_factory, cmd, *,
stdin=subprocess.PIPE,
@@ -1643,12 +1643,12 @@ async def subprocess_shell(self, protocol_factory, cmd, *,
if self._debug:
# don't log parameters: they may contain sensitive information
# (password) and may be too long
- debug_log = 'run shell command %r' % cmd
+ debug_log = "run shell command %r" % cmd
self._log_subprocess(debug_log, stdin, stdout, stderr)
transport = await self._make_subprocess_transport(
protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs)
if self._debug and debug_log is not None:
- logger.info('%s: %r', debug_log, transport)
+ logger.info("%s: %r", debug_log, transport)
return transport, protocol
async def subprocess_exec(self, protocol_factory, program, *args,
@@ -1676,13 +1676,13 @@ async def subprocess_exec(self, protocol_factory, program, *args,
if self._debug:
# don't log parameters: they may contain sensitive information
# (password) and may be too long
- debug_log = f'execute program {program!r}'
+ debug_log = f"execute program {program!r}"
self._log_subprocess(debug_log, stdin, stdout, stderr)
transport = await self._make_subprocess_transport(
protocol, popen_args, False, stdin, stdout, stderr,
bufsize, **kwargs)
if self._debug and debug_log is not None:
- logger.info('%s: %r', debug_log, transport)
+ logger.info("%s: %r", debug_log, transport)
return transport, protocol
def get_exception_handler(self):
@@ -1703,8 +1703,8 @@ def set_exception_handler(self, handler):
documentation for details about context).
"""
if handler is not None and not callable(handler):
- raise TypeError(f'A callable object or None is expected, '
- f'got {handler!r}')
+ raise TypeError(f"A callable object or None is expected, "
+ f"got {handler!r}")
self._exception_handler = handler
def default_exception_handler(self, context):
@@ -1722,40 +1722,40 @@ def default_exception_handler(self, context):
The context parameter has the same meaning as in
`call_exception_handler()`.
"""
- message = context.get('message')
+ message = context.get("message")
if not message:
- message = 'Unhandled exception in event loop'
+ message = "Unhandled exception in event loop"
- exception = context.get('exception')
+ exception = context.get("exception")
if exception is not None:
exc_info = (type(exception), exception, exception.__traceback__)
else:
exc_info = False
- if ('source_traceback' not in context and
+ if ("source_traceback" not in context and
self._current_handle is not None and
self._current_handle._source_traceback):
- context['handle_traceback'] = \
+ context["handle_traceback"] = \
self._current_handle._source_traceback
log_lines = [message]
for key in sorted(context):
- if key in {'message', 'exception'}:
+ if key in {"message", "exception"}:
continue
value = context[key]
- if key == 'source_traceback':
- tb = ''.join(traceback.format_list(value))
- value = 'Object created at (most recent call last):\n'
+ if key == "source_traceback":
+ tb = "".join(traceback.format_list(value))
+ value = "Object created at (most recent call last):\n"
value += tb.rstrip()
- elif key == 'handle_traceback':
- tb = ''.join(traceback.format_list(value))
- value = 'Handle created at (most recent call last):\n'
+ elif key == "handle_traceback":
+ tb = "".join(traceback.format_list(value))
+ value = "Handle created at (most recent call last):\n"
value += tb.rstrip()
else:
value = repr(value)
- log_lines.append(f'{key}: {value}')
+ log_lines.append(f"{key}: {value}")
- logger.error('\n'.join(log_lines), exc_info=exc_info)
+ logger.error("\n".join(log_lines), exc_info=exc_info)
def call_exception_handler(self, context):
"""Call the current event loop's exception handler.
@@ -1788,7 +1788,7 @@ def call_exception_handler(self, context):
# Second protection layer for unexpected errors
# in the default implementation, as well as for subclassed
# event loops with overloaded "default_exception_handler".
- logger.error('Exception in default exception handler',
+ logger.error("Exception in default exception handler",
exc_info=True)
else:
try:
@@ -1800,18 +1800,18 @@ def call_exception_handler(self, context):
try:
# Let's try default handler.
self.default_exception_handler({
- 'message': 'Unhandled error in exception handler',
- 'exception': exc,
- 'context': context,
+ "message": "Unhandled error in exception handler",
+ "exception": exc,
+ "context": context,
})
except (SystemExit, KeyboardInterrupt):
raise
except BaseException:
# Guard 'default_exception_handler' in case it is
# overloaded.
- logger.error('Exception in default exception handler '
- 'while handling an unexpected error '
- 'in custom exception handler',
+ logger.error("Exception in default exception handler "
+ "while handling an unexpected error "
+ "in custom exception handler",
exc_info=True)
def _add_callback(self, handle):
@@ -1901,7 +1901,7 @@ def _run_once(self):
handle._run()
dt = self.time() - t0
if dt >= self.slow_callback_duration:
- logger.warning('Executing %s took %.3f seconds',
+ logger.warning("Executing %s took %.3f seconds",
_format_handle(handle), dt)
finally:
self._current_handle = None
diff --git a/.venv3.10/Lib/asyncio/base_futures.py b/.venv3.10/Lib/asyncio/base_futures.py
index 2c01ac98..6c926f03 100644
--- a/.venv3.10/Lib/asyncio/base_futures.py
+++ b/.venv3.10/Lib/asyncio/base_futures.py
@@ -6,9 +6,9 @@
from . import format_helpers
# States for Future.
-_PENDING = 'PENDING'
-_CANCELLED = 'CANCELLED'
-_FINISHED = 'FINISHED'
+_PENDING = "PENDING"
+_CANCELLED = "CANCELLED"
+_FINISHED = "FINISHED"
def isfuture(obj):
@@ -18,7 +18,7 @@ def isfuture(obj):
itself as duck-type compatible by setting _asyncio_future_blocking.
See comment in Future for more details.
"""
- return (hasattr(obj.__class__, '_asyncio_future_blocking') and
+ return (hasattr(obj.__class__, "_asyncio_future_blocking") and
obj._asyncio_future_blocking is not None)
@@ -26,7 +26,7 @@ def _format_callbacks(cb):
"""helper function for Future.__repr__"""
size = len(cb)
if not size:
- cb = ''
+ cb = ""
def format_cb(callback):
return format_helpers._format_callback_source(callback, ())
@@ -34,12 +34,12 @@ def format_cb(callback):
if size == 1:
cb = format_cb(cb[0][0])
elif size == 2:
- cb = '{}, {}'.format(format_cb(cb[0][0]), format_cb(cb[1][0]))
+ cb = "{}, {}".format(format_cb(cb[0][0]), format_cb(cb[1][0]))
elif size > 2:
- cb = '{}, <{} more>, {}'.format(format_cb(cb[0][0]),
+ cb = "{}, <{} more>, {}".format(format_cb(cb[0][0]),
size - 2,
format_cb(cb[-1][0]))
- return f'cb=[{cb}]'
+ return f"cb=[{cb}]"
# bpo-42183: _repr_running is needed for repr protection
@@ -58,11 +58,11 @@ def _future_repr_info(future):
info = [future._state.lower()]
if future._state == _FINISHED:
if future._exception is not None:
- info.append(f'exception={future._exception!r}')
+ info.append(f"exception={future._exception!r}")
else:
key = id(future), get_ident()
if key in _repr_running:
- result = '...'
+ result = "..."
else:
_repr_running.add(key)
try:
@@ -71,10 +71,10 @@ def _future_repr_info(future):
result = reprlib.repr(future._result)
finally:
_repr_running.discard(key)
- info.append(f'result={result}')
+ info.append(f"result={result}")
if future._callbacks:
info.append(_format_callbacks(future._callbacks))
if future._source_traceback:
frame = future._source_traceback[-1]
- info.append(f'created at {frame[0]}:{frame[1]}')
+ info.append(f"created at {frame[0]}:{frame[1]}")
return info
diff --git a/.venv3.10/Lib/asyncio/base_subprocess.py b/.venv3.10/Lib/asyncio/base_subprocess.py
index 14d50519..6d7dfadd 100644
--- a/.venv3.10/Lib/asyncio/base_subprocess.py
+++ b/.venv3.10/Lib/asyncio/base_subprocess.py
@@ -40,14 +40,14 @@ def __init__(self, loop, protocol, args, shell,
raise
self._pid = self._proc.pid
- self._extra['subprocess'] = self._proc
+ self._extra["subprocess"] = self._proc
if self._loop.get_debug():
if isinstance(args, (bytes, str)):
program = args
else:
program = args[0]
- logger.debug('process %r created: pid %s',
+ logger.debug("process %r created: pid %s",
program, self._pid)
self._loop.create_task(self._connect_pipes(waiter))
@@ -55,31 +55,31 @@ def __init__(self, loop, protocol, args, shell,
def __repr__(self):
info = [self.__class__.__name__]
if self._closed:
- info.append('closed')
+ info.append("closed")
if self._pid is not None:
- info.append(f'pid={self._pid}')
+ info.append(f"pid={self._pid}")
if self._returncode is not None:
- info.append(f'returncode={self._returncode}')
+ info.append(f"returncode={self._returncode}")
elif self._pid is not None:
- info.append('running')
+ info.append("running")
else:
- info.append('not started')
+ info.append("not started")
stdin = self._pipes.get(0)
if stdin is not None:
- info.append(f'stdin={stdin.pipe}')
+ info.append(f"stdin={stdin.pipe}")
stdout = self._pipes.get(1)
stderr = self._pipes.get(2)
if stdout is not None and stderr is stdout:
- info.append(f'stdout=stderr={stdout.pipe}')
+ info.append(f"stdout=stderr={stdout.pipe}")
else:
if stdout is not None:
- info.append(f'stdout={stdout.pipe}')
+ info.append(f"stdout={stdout.pipe}")
if stderr is not None:
- info.append(f'stderr={stderr.pipe}')
+ info.append(f"stderr={stderr.pipe}")
- return '<{}>'.format(' '.join(info))
+ return "<{}>".format(" ".join(info))
def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
raise NotImplementedError
@@ -111,7 +111,7 @@ def close(self):
self._proc.poll() is None):
if self._loop.get_debug():
- logger.warning('Close running child process: kill %r', self)
+ logger.warning("Close running child process: kill %r", self)
try:
self._proc.kill()
@@ -208,7 +208,7 @@ def _process_exited(self, returncode):
assert returncode is not None, returncode
assert self._returncode is None, self._returncode
if self._loop.get_debug():
- logger.info('%r exited with return code %r', self, returncode)
+ logger.info("%r exited with return code %r", self, returncode)
self._returncode = returncode
if self._proc.returncode is None:
# asyncio uses a child watcher: copy the status into the Popen
@@ -264,7 +264,7 @@ def connection_made(self, transport):
self.pipe = transport
def __repr__(self):
- return f'<{self.__class__.__name__} fd={self.fd} pipe={self.pipe!r}>'
+ return f"<{self.__class__.__name__} fd={self.fd} pipe={self.pipe!r}>"
def connection_lost(self, exc):
self.disconnected = True
diff --git a/.venv3.10/Lib/asyncio/base_tasks.py b/.venv3.10/Lib/asyncio/base_tasks.py
index 09bb171a..51b365db 100644
--- a/.venv3.10/Lib/asyncio/base_tasks.py
+++ b/.venv3.10/Lib/asyncio/base_tasks.py
@@ -10,27 +10,27 @@ def _task_repr_info(task):
if task._must_cancel:
# replace status
- info[0] = 'cancelling'
+ info[0] = "cancelling"
- info.insert(1, 'name=%r' % task.get_name())
+ info.insert(1, "name=%r" % task.get_name())
coro = coroutines._format_coroutine(task._coro)
- info.insert(2, f'coro=<{coro}>')
+ info.insert(2, f"coro=<{coro}>")
if task._fut_waiter is not None:
- info.insert(3, f'wait_for={task._fut_waiter!r}')
+ info.insert(3, f"wait_for={task._fut_waiter!r}")
return info
def _task_get_stack(task, limit):
frames = []
- if hasattr(task._coro, 'cr_frame'):
+ if hasattr(task._coro, "cr_frame"):
# case 1: 'async def' coroutines
f = task._coro.cr_frame
- elif hasattr(task._coro, 'gi_frame'):
+ elif hasattr(task._coro, "gi_frame"):
# case 2: legacy coroutines
f = task._coro.gi_frame
- elif hasattr(task._coro, 'ag_frame'):
+ elif hasattr(task._coro, "ag_frame"):
# case 3: async generators
f = task._coro.ag_frame
else:
@@ -73,13 +73,13 @@ def _task_print_stack(task, limit, file):
exc = task._exception
if not extracted_list:
- print(f'No stack for {task!r}', file=file)
+ print(f"No stack for {task!r}", file=file)
elif exc is not None:
- print(f'Traceback for {task!r} (most recent call last):', file=file)
+ print(f"Traceback for {task!r} (most recent call last):", file=file)
else:
- print(f'Stack for {task!r} (most recent call last):', file=file)
+ print(f"Stack for {task!r} (most recent call last):", file=file)
traceback.print_list(extracted_list, file=file)
if exc is not None:
for line in traceback.format_exception_only(exc.__class__, exc):
- print(line, file=file, end='')
+ print(line, file=file, end="")
diff --git a/.venv3.10/Lib/asyncio/coroutines.py b/.venv3.10/Lib/asyncio/coroutines.py
index 9664ea74..1eafd37e 100644
--- a/.venv3.10/Lib/asyncio/coroutines.py
+++ b/.venv3.10/Lib/asyncio/coroutines.py
@@ -1,4 +1,4 @@
-__all__ = 'coroutine', 'iscoroutinefunction', 'iscoroutine'
+__all__ = "coroutine", "iscoroutinefunction", "iscoroutine"
import collections.abc
import functools
@@ -27,7 +27,7 @@ def _is_debug_mode():
# is that tracebacks show entries for the CoroWrapper.__next__ method
# when _DEBUG is true.
return sys.flags.dev_mode or (not sys.flags.ignore_environment and
- bool(os.environ.get('PYTHONASYNCIODEBUG')))
+ bool(os.environ.get("PYTHONASYNCIODEBUG")))
_DEBUG = _is_debug_mode()
@@ -41,16 +41,16 @@ def __init__(self, gen, func=None):
self.gen = gen
self.func = func # Used to unwrap @coroutine decorator
self._source_traceback = format_helpers.extract_stack(sys._getframe(1))
- self.__name__ = getattr(gen, '__name__', None)
- self.__qualname__ = getattr(gen, '__qualname__', None)
+ self.__name__ = getattr(gen, "__name__", None)
+ self.__qualname__ = getattr(gen, "__qualname__", None)
def __repr__(self):
coro_repr = _format_coroutine(self)
if self._source_traceback:
frame = self._source_traceback[-1]
- coro_repr += f', created at {frame[0]}:{frame[1]}'
+ coro_repr += f", created at {frame[0]}:{frame[1]}"
- return f'<{self.__class__.__name__} {coro_repr}>'
+ return f"<{self.__class__.__name__} {coro_repr}>"
def __iter__(self):
return self
@@ -88,16 +88,16 @@ def gi_yieldfrom(self):
def __del__(self):
# Be careful accessing self.gen.frame -- self.gen might not exist.
- gen = getattr(self, 'gen', None)
- frame = getattr(gen, 'gi_frame', None)
+ gen = getattr(self, "gen", None)
+ frame = getattr(gen, "gi_frame", None)
if frame is not None and frame.f_lasti == -1:
- msg = f'{self!r} was never yielded from'
- tb = getattr(self, '_source_traceback', ())
+ msg = f"{self!r} was never yielded from"
+ tb = getattr(self, "_source_traceback", ())
if tb:
- tb = ''.join(traceback.format_list(tb))
- msg += (f'\nCoroutine object created at '
- f'(most recent call last, truncated to '
- f'{constants.DEBUG_STACK_DEPTH} last lines):\n')
+ tb = "".join(traceback.format_list(tb))
+ msg += (f"\nCoroutine object created at "
+ f"(most recent call last, truncated to "
+ f"{constants.DEBUG_STACK_DEPTH} last lines):\n")
msg += tb.rstrip()
logger.error(msg)
@@ -149,8 +149,8 @@ def wrapper(*args, **kwds):
# on generator objects, so we set it manually.
# We use getattr as some callables (such as
# functools.partial may lack __qualname__).
- w.__name__ = getattr(func, '__name__', None)
- w.__qualname__ = getattr(func, '__qualname__', None)
+ w.__name__ = getattr(func, "__name__", None)
+ w.__qualname__ = getattr(func, "__qualname__", None)
return w
wrapper._is_coroutine = _is_coroutine # For iscoroutinefunction().
@@ -164,7 +164,7 @@ def wrapper(*args, **kwds):
def iscoroutinefunction(func):
"""Return True if func is a decorated coroutine function."""
return (inspect.iscoroutinefunction(func) or
- getattr(func, '_is_coroutine', None) is _is_coroutine)
+ getattr(func, "_is_coroutine", None) is _is_coroutine)
# Prioritize native coroutine check to speed-up
@@ -203,14 +203,14 @@ def get_name(coro):
if is_corowrapper:
return format_helpers._format_callback(coro.func, (), {})
- if hasattr(coro, '__qualname__') and coro.__qualname__:
+ if hasattr(coro, "__qualname__") and coro.__qualname__:
coro_name = coro.__qualname__
- elif hasattr(coro, '__name__') and coro.__name__:
+ elif hasattr(coro, "__name__") and coro.__name__:
coro_name = coro.__name__
else:
# Stop masking Cython bugs, expose them in a friendly way.
- coro_name = f'<{type(coro).__name__} without __name__>'
- return f'{coro_name}()'
+ coro_name = f"<{type(coro).__name__} without __name__>"
+ return f"{coro_name}()"
def is_running(coro):
try:
@@ -222,9 +222,9 @@ def is_running(coro):
return False
coro_code = None
- if hasattr(coro, 'cr_code') and coro.cr_code:
+ if hasattr(coro, "cr_code") and coro.cr_code:
coro_code = coro.cr_code
- elif hasattr(coro, 'gi_code') and coro.gi_code:
+ elif hasattr(coro, "gi_code") and coro.gi_code:
coro_code = coro.gi_code
coro_name = get_name(coro)
@@ -232,19 +232,19 @@ def is_running(coro):
if not coro_code:
# Built-in types might not have __qualname__ or __name__.
if is_running(coro):
- return f'{coro_name} running'
+ return f"{coro_name} running"
else:
return coro_name
coro_frame = None
- if hasattr(coro, 'gi_frame') and coro.gi_frame:
+ if hasattr(coro, "gi_frame") and coro.gi_frame:
coro_frame = coro.gi_frame
- elif hasattr(coro, 'cr_frame') and coro.cr_frame:
+ elif hasattr(coro, "cr_frame") and coro.cr_frame:
coro_frame = coro.cr_frame
# If Cython's coroutine has a fake code object without proper
# co_filename -- expose that.
- filename = coro_code.co_filename or ''
+ filename = coro_code.co_filename or ""
lineno = 0
if (is_corowrapper and
@@ -254,16 +254,16 @@ def is_running(coro):
if source is not None:
filename, lineno = source
if coro_frame is None:
- coro_repr = f'{coro_name} done, defined at {filename}:{lineno}'
+ coro_repr = f"{coro_name} done, defined at {filename}:{lineno}"
else:
- coro_repr = f'{coro_name} running, defined at {filename}:{lineno}'
+ coro_repr = f"{coro_name} running, defined at {filename}:{lineno}"
elif coro_frame is not None:
lineno = coro_frame.f_lineno
- coro_repr = f'{coro_name} running at {filename}:{lineno}'
+ coro_repr = f"{coro_name} running at {filename}:{lineno}"
else:
lineno = coro_code.co_firstlineno
- coro_repr = f'{coro_name} done, defined at {filename}:{lineno}'
+ coro_repr = f"{coro_name} done, defined at {filename}:{lineno}"
return coro_repr
diff --git a/.venv3.10/Lib/asyncio/events.py b/.venv3.10/Lib/asyncio/events.py
index e0882309..280a48c0 100644
--- a/.venv3.10/Lib/asyncio/events.py
+++ b/.venv3.10/Lib/asyncio/events.py
@@ -1,14 +1,14 @@
"""Event loop and event loop policy."""
__all__ = (
- 'AbstractEventLoopPolicy',
- 'AbstractEventLoop', 'AbstractServer',
- 'Handle', 'TimerHandle',
- 'get_event_loop_policy', 'set_event_loop_policy',
- 'get_event_loop', 'set_event_loop', 'new_event_loop',
- 'get_child_watcher', 'set_child_watcher',
- '_set_running_loop', 'get_running_loop',
- '_get_running_loop',
+ "AbstractEventLoopPolicy",
+ "AbstractEventLoop", "AbstractServer",
+ "Handle", "TimerHandle",
+ "get_event_loop_policy", "set_event_loop_policy",
+ "get_event_loop", "set_event_loop", "new_event_loop",
+ "get_child_watcher", "set_child_watcher",
+ "_set_running_loop", "get_running_loop",
+ "_get_running_loop",
)
import contextvars
@@ -24,9 +24,9 @@
class Handle:
"""Object returned by callback registration methods."""
- __slots__ = ('_callback', '_args', '_cancelled', '_loop',
- '_source_traceback', '_repr', '__weakref__',
- '_context')
+ __slots__ = ("_callback", "_args", "_cancelled", "_loop",
+ "_source_traceback", "_repr", "__weakref__",
+ "_context")
def __init__(self, callback, args, loop, context=None):
if context is None:
@@ -46,20 +46,20 @@ def __init__(self, callback, args, loop, context=None):
def _repr_info(self):
info = [self.__class__.__name__]
if self._cancelled:
- info.append('cancelled')
+ info.append("cancelled")
if self._callback is not None:
info.append(format_helpers._format_callback_source(
self._callback, self._args))
if self._source_traceback:
frame = self._source_traceback[-1]
- info.append(f'created at {frame[0]}:{frame[1]}')
+ info.append(f"created at {frame[0]}:{frame[1]}")
return info
def __repr__(self):
if self._repr is not None:
return self._repr
info = self._repr_info()
- return '<{}>'.format(' '.join(info))
+ return "<{}>".format(" ".join(info))
def cancel(self):
if not self._cancelled:
@@ -83,14 +83,14 @@ def _run(self):
except BaseException as exc:
cb = format_helpers._format_callback_source(
self._callback, self._args)
- msg = f'Exception in callback {cb}'
+ msg = f"Exception in callback {cb}"
context = {
- 'message': msg,
- 'exception': exc,
- 'handle': self,
+ "message": msg,
+ "exception": exc,
+ "handle": self,
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
self = None # Needed to break cycles when an exception occurs.
@@ -98,7 +98,7 @@ def _run(self):
class TimerHandle(Handle):
"""Object returned by timed callback registration methods."""
- __slots__ = ['_scheduled', '_when']
+ __slots__ = ["_scheduled", "_when"]
def __init__(self, when, callback, args, loop, context=None):
assert when is not None
@@ -111,7 +111,7 @@ def __init__(self, when, callback, args, loop, context=None):
def _repr_info(self):
info = super()._repr_info()
pos = 2 if self._cancelled else 1
- info.insert(pos, f'when={self._when}')
+ info.insert(pos, f"when={self._when}")
return info
def __hash__(self):
@@ -653,7 +653,7 @@ def get_event_loop(self):
self.set_event_loop(self.new_event_loop())
if self._local._loop is None:
- raise RuntimeError('There is no current event loop in thread %r.'
+ raise RuntimeError("There is no current event loop in thread %r."
% threading.current_thread().name)
return self._local._loop
@@ -699,7 +699,7 @@ def get_running_loop():
# NOTE: this function is implemented in C (see _asynciomodule.c)
loop = _get_running_loop()
if loop is None:
- raise RuntimeError('no running event loop')
+ raise RuntimeError("no running event loop")
return loop
diff --git a/.venv3.10/Lib/asyncio/exceptions.py b/.venv3.10/Lib/asyncio/exceptions.py
index f07e4486..315112a2 100644
--- a/.venv3.10/Lib/asyncio/exceptions.py
+++ b/.venv3.10/Lib/asyncio/exceptions.py
@@ -1,9 +1,9 @@
"""asyncio exceptions."""
-__all__ = ('CancelledError', 'InvalidStateError', 'TimeoutError',
- 'IncompleteReadError', 'LimitOverrunError',
- 'SendfileNotAvailableError')
+__all__ = ("CancelledError", "InvalidStateError", "TimeoutError",
+ "IncompleteReadError", "LimitOverrunError",
+ "SendfileNotAvailableError")
class CancelledError(BaseException):
@@ -34,9 +34,9 @@ class IncompleteReadError(EOFError):
- expected: total number of expected bytes (or None if unknown)
"""
def __init__(self, partial, expected):
- r_expected = 'undefined' if expected is None else repr(expected)
- super().__init__(f'{len(partial)} bytes read on a total of '
- f'{r_expected} expected bytes')
+ r_expected = "undefined" if expected is None else repr(expected)
+ super().__init__(f"{len(partial)} bytes read on a total of "
+ f"{r_expected} expected bytes")
self.partial = partial
self.expected = expected
diff --git a/.venv3.10/Lib/asyncio/format_helpers.py b/.venv3.10/Lib/asyncio/format_helpers.py
index 27d11fd4..577651fd 100644
--- a/.venv3.10/Lib/asyncio/format_helpers.py
+++ b/.venv3.10/Lib/asyncio/format_helpers.py
@@ -23,7 +23,7 @@ def _format_callback_source(func, args):
func_repr = _format_callback(func, args, None)
source = _get_function_source(func)
if source:
- func_repr += f' at {source[0]}:{source[1]}'
+ func_repr += f" at {source[0]}:{source[1]}"
return func_repr
@@ -37,18 +37,18 @@ def _format_args_and_kwargs(args, kwargs):
if args:
items.extend(reprlib.repr(arg) for arg in args)
if kwargs:
- items.extend(f'{k}={reprlib.repr(v)}' for k, v in kwargs.items())
- return '({})'.format(', '.join(items))
+ items.extend(f"{k}={reprlib.repr(v)}" for k, v in kwargs.items())
+ return "({})".format(", ".join(items))
-def _format_callback(func, args, kwargs, suffix=''):
+def _format_callback(func, args, kwargs, suffix=""):
if isinstance(func, functools.partial):
suffix = _format_args_and_kwargs(args, kwargs) + suffix
return _format_callback(func.func, func.args, func.keywords, suffix)
- if hasattr(func, '__qualname__') and func.__qualname__:
+ if hasattr(func, "__qualname__") and func.__qualname__:
func_repr = func.__qualname__
- elif hasattr(func, '__name__') and func.__name__:
+ elif hasattr(func, "__name__") and func.__name__:
func_repr = func.__name__
else:
func_repr = repr(func)
diff --git a/.venv3.10/Lib/asyncio/futures.py b/.venv3.10/Lib/asyncio/futures.py
index 5d00ab4c..e43a9ccf 100644
--- a/.venv3.10/Lib/asyncio/futures.py
+++ b/.venv3.10/Lib/asyncio/futures.py
@@ -1,7 +1,7 @@
"""A Future class similar to the one in PEP 3148."""
__all__ = (
- 'Future', 'wrap_future', 'isfuture',
+ "Future", "wrap_future", "isfuture",
)
import concurrent.futures
@@ -88,8 +88,8 @@ def __init__(self, *, loop=None):
_repr_info = base_futures._future_repr_info
def __repr__(self):
- return '<{} {}>'.format(self.__class__.__name__,
- ' '.join(self._repr_info()))
+ return "<{} {}>".format(self.__class__.__name__,
+ " ".join(self._repr_info()))
def __del__(self):
if not self.__log_traceback:
@@ -98,13 +98,13 @@ def __del__(self):
return
exc = self._exception
context = {
- 'message':
- f'{self.__class__.__name__} exception was never retrieved',
- 'exception': exc,
- 'future': self,
+ "message":
+ f"{self.__class__.__name__} exception was never retrieved",
+ "exception": exc,
+ "future": self,
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
__class_getitem__ = classmethod(GenericAlias)
@@ -116,7 +116,7 @@ def _log_traceback(self):
@_log_traceback.setter
def _log_traceback(self, val):
if val:
- raise ValueError('_log_traceback can only be set to False')
+ raise ValueError("_log_traceback can only be set to False")
self.__log_traceback = False
def get_loop(self):
@@ -195,7 +195,7 @@ def result(self):
exc = self._make_cancelled_error()
raise exc
if self._state != _FINISHED:
- raise exceptions.InvalidStateError('Result is not ready.')
+ raise exceptions.InvalidStateError("Result is not ready.")
self.__log_traceback = False
if self._exception is not None:
raise self._exception.with_traceback(self._exception_tb)
@@ -213,7 +213,7 @@ def exception(self):
exc = self._make_cancelled_error()
raise exc
if self._state != _FINISHED:
- raise exceptions.InvalidStateError('Exception is not set.')
+ raise exceptions.InvalidStateError("Exception is not set.")
self.__log_traceback = False
return self._exception
@@ -255,7 +255,7 @@ def set_result(self, result):
InvalidStateError.
"""
if self._state != _PENDING:
- raise exceptions.InvalidStateError(f'{self._state}: {self!r}')
+ raise exceptions.InvalidStateError(f"{self._state}: {self!r}")
self._result = result
self._state = _FINISHED
self.__schedule_callbacks()
@@ -267,7 +267,7 @@ def set_exception(self, exception):
InvalidStateError.
"""
if self._state != _PENDING:
- raise exceptions.InvalidStateError(f'{self._state}: {self!r}')
+ raise exceptions.InvalidStateError(f"{self._state}: {self!r}")
if isinstance(exception, type):
exception = exception()
if type(exception) is StopIteration:
@@ -369,10 +369,10 @@ def _chain_future(source, destination):
"""
if not isfuture(source) and not isinstance(source,
concurrent.futures.Future):
- raise TypeError('A future is required for source argument')
+ raise TypeError("A future is required for source argument")
if not isfuture(destination) and not isinstance(destination,
concurrent.futures.Future):
- raise TypeError('A future is required for destination argument')
+ raise TypeError("A future is required for destination argument")
source_loop = _get_loop(source) if isfuture(source) else None
dest_loop = _get_loop(destination) if isfuture(destination) else None
@@ -409,7 +409,7 @@ def wrap_future(future, *, loop=None):
if isfuture(future):
return future
assert isinstance(future, concurrent.futures.Future), \
- f'concurrent.futures.Future is expected, got {future!r}'
+ f"concurrent.futures.Future is expected, got {future!r}"
if loop is None:
loop = events._get_event_loop()
new_future = loop.create_future()
diff --git a/.venv3.10/Lib/asyncio/locks.py b/.venv3.10/Lib/asyncio/locks.py
index e1921591..1c9ea2e7 100644
--- a/.venv3.10/Lib/asyncio/locks.py
+++ b/.venv3.10/Lib/asyncio/locks.py
@@ -1,12 +1,11 @@
"""Synchronization primitives."""
-__all__ = ('Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore')
+__all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore")
import collections
from . import exceptions
from . import mixins
-from . import tasks
class _ContextManagerMixin:
@@ -81,10 +80,10 @@ def __init__(self, *, loop=mixins._marker):
def __repr__(self):
res = super().__repr__()
- extra = 'locked' if self._locked else 'unlocked'
+ extra = "locked" if self._locked else "unlocked"
if self._waiters:
- extra = f'{extra}, waiters:{len(self._waiters)}'
- return f'<{res[1:-1]} [{extra}]>'
+ extra = f"{extra}, waiters:{len(self._waiters)}"
+ return f"<{res[1:-1]} [{extra}]>"
def locked(self):
"""Return True if lock is acquired."""
@@ -137,7 +136,7 @@ def release(self):
self._locked = False
self._wake_up_first()
else:
- raise RuntimeError('Lock is not acquired.')
+ raise RuntimeError("Lock is not acquired.")
def _wake_up_first(self):
"""Wake up the first waiter if it isn't done."""
@@ -171,10 +170,10 @@ def __init__(self, *, loop=mixins._marker):
def __repr__(self):
res = super().__repr__()
- extra = 'set' if self._value else 'unset'
+ extra = "set" if self._value else "unset"
if self._waiters:
- extra = f'{extra}, waiters:{len(self._waiters)}'
- return f'<{res[1:-1]} [{extra}]>'
+ extra = f"{extra}, waiters:{len(self._waiters)}"
+ return f"<{res[1:-1]} [{extra}]>"
def is_set(self):
"""Return True if and only if the internal flag is true."""
@@ -242,10 +241,10 @@ def __init__(self, lock=None, *, loop=mixins._marker):
def __repr__(self):
res = super().__repr__()
- extra = 'locked' if self.locked() else 'unlocked'
+ extra = "locked" if self.locked() else "unlocked"
if self._waiters:
- extra = f'{extra}, waiters:{len(self._waiters)}'
- return f'<{res[1:-1]} [{extra}]>'
+ extra = f"{extra}, waiters:{len(self._waiters)}"
+ return f"<{res[1:-1]} [{extra}]>"
async def wait(self):
"""Wait until notified.
@@ -259,7 +258,7 @@ async def wait(self):
awakened, it re-acquires the lock and returns True.
"""
if not self.locked():
- raise RuntimeError('cannot wait on un-acquired lock')
+ raise RuntimeError("cannot wait on un-acquired lock")
self.release()
try:
@@ -310,7 +309,7 @@ def notify(self, n=1):
not release the lock, its caller should.
"""
if not self.locked():
- raise RuntimeError('cannot notify on un-acquired lock')
+ raise RuntimeError("cannot notify on un-acquired lock")
idx = 0
for fut in self._waiters:
@@ -354,10 +353,10 @@ def __init__(self, value=1, *, loop=mixins._marker):
def __repr__(self):
res = super().__repr__()
- extra = 'locked' if self.locked() else f'unlocked, value:{self._value}'
+ extra = "locked" if self.locked() else f"unlocked, value:{self._value}"
if self._waiters:
- extra = f'{extra}, waiters:{len(self._waiters)}'
- return f'<{res[1:-1]} [{extra}]>'
+ extra = f"{extra}, waiters:{len(self._waiters)}"
+ return f"<{res[1:-1]} [{extra}]>"
def locked(self):
"""Returns True if semaphore cannot be acquired immediately."""
@@ -434,5 +433,5 @@ def __init__(self, value=1, *, loop=mixins._marker):
def release(self):
if self._value >= self._bound_value:
- raise ValueError('BoundedSemaphore released too many times')
+ raise ValueError("BoundedSemaphore released too many times")
super().release()
diff --git a/.venv3.10/Lib/asyncio/mixins.py b/.venv3.10/Lib/asyncio/mixins.py
index 650df05c..c6132c08 100644
--- a/.venv3.10/Lib/asyncio/mixins.py
+++ b/.venv3.10/Lib/asyncio/mixins.py
@@ -15,8 +15,8 @@ class _LoopBoundMixin:
def __init__(self, *, loop=_marker):
if loop is not _marker:
raise TypeError(
- f'As of 3.10, the *loop* parameter was removed from '
- f'{type(self).__name__}() since it is no longer necessary'
+ f"As of 3.10, the *loop* parameter was removed from "
+ f"{type(self).__name__}() since it is no longer necessary"
)
def _get_loop(self):
@@ -27,5 +27,5 @@ def _get_loop(self):
if self._loop is None:
self._loop = loop
if loop is not self._loop:
- raise RuntimeError(f'{self!r} is bound to a different event loop')
+ raise RuntimeError(f"{self!r} is bound to a different event loop")
return loop
diff --git a/.venv3.10/Lib/asyncio/proactor_events.py b/.venv3.10/Lib/asyncio/proactor_events.py
index 0916d9eb..0e010f66 100644
--- a/.venv3.10/Lib/asyncio/proactor_events.py
+++ b/.venv3.10/Lib/asyncio/proactor_events.py
@@ -4,7 +4,7 @@
proactor is only implemented on Windows with IOCP.
"""
-__all__ = 'BaseProactorEventLoop',
+__all__ = "BaseProactorEventLoop",
import io
import os
@@ -26,21 +26,21 @@
def _set_socket_extra(transport, sock):
- transport._extra['socket'] = trsock.TransportSocket(sock)
+ transport._extra["socket"] = trsock.TransportSocket(sock)
try:
- transport._extra['sockname'] = sock.getsockname()
+ transport._extra["sockname"] = sock.getsockname()
except socket.error:
if transport._loop.get_debug():
logger.warning(
"getsockname() failed on %r", sock, exc_info=True)
- if 'peername' not in transport._extra:
+ if "peername" not in transport._extra:
try:
- transport._extra['peername'] = sock.getpeername()
+ transport._extra["peername"] = sock.getpeername()
except socket.error:
# UDP sockets may not have a peer name
- transport._extra['peername'] = None
+ transport._extra["peername"] = None
class _ProactorBasePipeTransport(transports._FlowControlMixin,
@@ -73,23 +73,23 @@ def __init__(self, loop, sock, protocol, waiter=None,
def __repr__(self):
info = [self.__class__.__name__]
if self._sock is None:
- info.append('closed')
+ info.append("closed")
elif self._closing:
- info.append('closing')
+ info.append("closing")
if self._sock is not None:
- info.append(f'fd={self._sock.fileno()}')
+ info.append(f"fd={self._sock.fileno()}")
if self._read_fut is not None:
- info.append(f'read={self._read_fut!r}')
+ info.append(f"read={self._read_fut!r}")
if self._write_fut is not None:
- info.append(f'write={self._write_fut!r}')
+ info.append(f"write={self._write_fut!r}")
if self._buffer:
- info.append(f'write_bufsize={len(self._buffer)}')
+ info.append(f"write_bufsize={len(self._buffer)}")
if self._eof_written:
- info.append('EOF written')
- return '<{}>'.format(' '.join(info))
+ info.append("EOF written")
+ return "<{}>".format(" ".join(info))
def _set_extra(self, sock):
- self._extra['pipe'] = sock
+ self._extra["pipe"] = sock
def set_protocol(self, protocol):
self._protocol = protocol
@@ -116,17 +116,17 @@ def __del__(self, _warn=warnings.warn):
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
self._sock.close()
- def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+ def _fatal_error(self, exc, message="Fatal error on pipe transport"):
try:
if isinstance(exc, OSError):
if self._loop.get_debug():
logger.debug("%r: %s", self, message, exc_info=True)
else:
self._loop.call_exception_handler({
- 'message': message,
- 'exception': exc,
- 'transport': self,
- 'protocol': self._protocol,
+ "message": message,
+ "exception": exc,
+ "transport": self,
+ "protocol": self._protocol,
})
finally:
self._force_close(exc)
@@ -161,7 +161,7 @@ def _call_connection_lost(self, exc):
# end then it may fail with ERROR_NETNAME_DELETED if we
# just close our end. First calling shutdown() seems to
# cure it, but maybe using DisconnectEx() would be better.
- if hasattr(self._sock, 'shutdown') and self._sock.fileno() != -1:
+ if hasattr(self._sock, "shutdown") and self._sock.fileno() != -1:
self._sock.shutdown(socket.SHUT_RDWR)
self._sock.close()
self._sock = None
@@ -242,7 +242,7 @@ def _eof_received(self):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal error: protocol.eof_received() call failed.')
+ exc, "Fatal error: protocol.eof_received() call failed.")
return
if not keep_open:
@@ -267,8 +267,8 @@ def _data_received(self, data, length):
raise
except BaseException as exc:
self._fatal_error(exc,
- 'Fatal error: protocol.buffer_updated() '
- 'call failed.')
+ "Fatal error: protocol.buffer_updated() "
+ "call failed.")
return
else:
self._protocol.data_received(data)
@@ -305,14 +305,14 @@ def _loop_reading(self, fut=None):
self._read_fut = self._loop._proactor.recv_into(self._sock, self._data)
except ConnectionAbortedError as exc:
if not self._closing:
- self._fatal_error(exc, 'Fatal read error on pipe transport')
+ self._fatal_error(exc, "Fatal read error on pipe transport")
elif self._loop.get_debug():
logger.debug("Read error on pipe transport while closing",
exc_info=True)
except ConnectionResetError as exc:
self._force_close(exc)
except OSError as exc:
- self._fatal_error(exc, 'Fatal read error on pipe transport')
+ self._fatal_error(exc, "Fatal read error on pipe transport")
except exceptions.CancelledError:
if not self._closing:
raise
@@ -340,16 +340,16 @@ def write(self, data):
f"data argument must be a bytes-like object, "
f"not {type(data).__name__}")
if self._eof_written:
- raise RuntimeError('write_eof() already called')
+ raise RuntimeError("write_eof() already called")
if self._empty_waiter is not None:
- raise RuntimeError('unable to write; sendfile is in progress')
+ raise RuntimeError("unable to write; sendfile is in progress")
if not data:
return
if self._conn_lost:
if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
- logger.warning('socket.send() raised exception.')
+ logger.warning("socket.send() raised exception.")
self._conn_lost += 1
return
@@ -411,7 +411,7 @@ def _loop_writing(self, f=None, data=None):
except ConnectionResetError as exc:
self._force_close(exc)
except OSError as exc:
- self._fatal_error(exc, 'Fatal write error on pipe transport')
+ self._fatal_error(exc, "Fatal write error on pipe transport")
def can_write_eof(self):
return True
@@ -444,7 +444,7 @@ def _pipe_closed(self, fut):
if fut.cancelled():
# the transport has been closed
return
- assert fut.result() == b''
+ assert fut.result() == b""
if self._closing:
assert self._read_fut is None
return
@@ -482,7 +482,7 @@ def abort(self):
def sendto(self, data, addr=None):
if not isinstance(data, (bytes, bytearray, memoryview)):
- raise TypeError('data argument must be bytes-like object (%r)',
+ raise TypeError("data argument must be bytes-like object (%r)",
type(data))
if not data:
@@ -490,11 +490,11 @@ def sendto(self, data, addr=None):
if self._address is not None and addr not in (None, self._address):
raise ValueError(
- f'Invalid address: must be None or {self._address}')
+ f"Invalid address: must be None or {self._address}")
if self._conn_lost and self._address:
if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
- logger.warning('socket.sendto() raised exception.')
+ logger.warning("socket.sendto() raised exception.")
self._conn_lost += 1
return
@@ -536,7 +536,7 @@ def _loop_writing(self, fut=None):
except OSError as exc:
self._protocol.error_received(exc)
except Exception as exc:
- self._fatal_error(exc, 'Fatal write error on datagram transport')
+ self._fatal_error(exc, "Fatal write error on datagram transport")
else:
self._write_fut.add_done_callback(self._loop_writing)
self._maybe_resume_protocol()
@@ -627,7 +627,7 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
def __init__(self, proactor):
super().__init__()
- logger.debug('Using proactor: %s', proactor.__class__.__name__)
+ logger.debug("Using proactor: %s", proactor.__class__.__name__)
self._proactor = proactor
self._selector = proactor # convenient alias
self._self_reading_future = None
@@ -714,7 +714,7 @@ async def sock_accept(self, sock):
async def _sock_sendfile_native(self, sock, file, offset, count):
try:
fileno = file.fileno()
- except (AttributeError, io.UnsupportedOperation) as err:
+ except (AttributeError, io.UnsupportedOperation):
raise exceptions.SendfileNotAvailableError("not a regular file")
try:
fsize = os.fstat(fileno).st_size
@@ -789,9 +789,9 @@ def _loop_self_reading(self, f=None):
raise
except BaseException as exc:
self.call_exception_handler({
- 'message': 'Error on reading from the event loop self pipe',
- 'exception': exc,
- 'loop': self,
+ "message": "Error on reading from the event loop self pipe",
+ "exception": exc,
+ "loop": self,
})
else:
self._self_reading_future = f
@@ -808,7 +808,7 @@ def _write_to_self(self):
return
try:
- csock.send(b'\0')
+ csock.send(b"\0")
except OSError:
if self._debug:
logger.debug("Fail to write a null byte into the "
@@ -830,21 +830,21 @@ def loop(f=None):
if sslcontext is not None:
self._make_ssl_transport(
conn, protocol, sslcontext, server_side=True,
- extra={'peername': addr}, server=server,
+ extra={"peername": addr}, server=server,
ssl_handshake_timeout=ssl_handshake_timeout)
else:
self._make_socket_transport(
conn, protocol,
- extra={'peername': addr}, server=server)
+ extra={"peername": addr}, server=server)
if self.is_closed():
return
f = self._proactor.accept(sock)
except OSError as exc:
if sock.fileno() != -1:
self.call_exception_handler({
- 'message': 'Accept failed on a socket',
- 'exception': exc,
- 'socket': trsock.TransportSocket(sock),
+ "message": "Accept failed on a socket",
+ "exception": exc,
+ "socket": trsock.TransportSocket(sock),
})
sock.close()
elif self._debug:
diff --git a/.venv3.10/Lib/asyncio/protocols.py b/.venv3.10/Lib/asyncio/protocols.py
index 09987b16..9d227e37 100644
--- a/.venv3.10/Lib/asyncio/protocols.py
+++ b/.venv3.10/Lib/asyncio/protocols.py
@@ -1,8 +1,8 @@
"""Abstract Protocol base classes."""
__all__ = (
- 'BaseProtocol', 'Protocol', 'DatagramProtocol',
- 'SubprocessProtocol', 'BufferedProtocol',
+ "BaseProtocol", "Protocol", "DatagramProtocol",
+ "SubprocessProtocol", "BufferedProtocol",
)
@@ -203,7 +203,7 @@ def _feed_data_to_buffered_proto(proto, data):
buf = proto.get_buffer(data_len)
buf_len = len(buf)
if not buf_len:
- raise RuntimeError('get_buffer() returned an empty buffer')
+ raise RuntimeError("get_buffer() returned an empty buffer")
if buf_len >= data_len:
buf[:data_len] = data
diff --git a/.venv3.10/Lib/asyncio/queues.py b/.venv3.10/Lib/asyncio/queues.py
index 10dd689b..47097fe2 100644
--- a/.venv3.10/Lib/asyncio/queues.py
+++ b/.venv3.10/Lib/asyncio/queues.py
@@ -1,4 +1,4 @@
-__all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty')
+__all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty")
import collections
import heapq
@@ -65,23 +65,23 @@ def _wakeup_next(self, waiters):
break
def __repr__(self):
- return f'<{type(self).__name__} at {id(self):#x} {self._format()}>'
+ return f"<{type(self).__name__} at {id(self):#x} {self._format()}>"
def __str__(self):
- return f'<{type(self).__name__} {self._format()}>'
+ return f"<{type(self).__name__} {self._format()}>"
__class_getitem__ = classmethod(GenericAlias)
def _format(self):
- result = f'maxsize={self._maxsize!r}'
- if getattr(self, '_queue', None):
- result += f' _queue={list(self._queue)!r}'
+ result = f"maxsize={self._maxsize!r}"
+ if getattr(self, "_queue", None):
+ result += f" _queue={list(self._queue)!r}"
if self._getters:
- result += f' _getters[{len(self._getters)}]'
+ result += f" _getters[{len(self._getters)}]"
if self._putters:
- result += f' _putters[{len(self._putters)}]'
+ result += f" _putters[{len(self._putters)}]"
if self._unfinished_tasks:
- result += f' tasks={self._unfinished_tasks}'
+ result += f" tasks={self._unfinished_tasks}"
return result
def qsize(self):
@@ -199,7 +199,7 @@ def task_done(self):
the queue.
"""
if self._unfinished_tasks <= 0:
- raise ValueError('task_done() called too many times')
+ raise ValueError("task_done() called too many times")
self._unfinished_tasks -= 1
if self._unfinished_tasks == 0:
self._finished.set()
diff --git a/.venv3.10/Lib/asyncio/runners.py b/.venv3.10/Lib/asyncio/runners.py
index 9a5e9a48..1f41555b 100644
--- a/.venv3.10/Lib/asyncio/runners.py
+++ b/.venv3.10/Lib/asyncio/runners.py
@@ -1,4 +1,4 @@
-__all__ = 'run',
+__all__ = "run",
from . import coroutines
from . import events
@@ -67,7 +67,7 @@ def _cancel_all_tasks(loop):
continue
if task.exception() is not None:
loop.call_exception_handler({
- 'message': 'unhandled exception during asyncio.run() shutdown',
- 'exception': task.exception(),
- 'task': task,
+ "message": "unhandled exception during asyncio.run() shutdown",
+ "exception": task.exception(),
+ "task": task,
})
diff --git a/.venv3.10/Lib/asyncio/selector_events.py b/.venv3.10/Lib/asyncio/selector_events.py
index 8282f280..4f981aba 100644
--- a/.venv3.10/Lib/asyncio/selector_events.py
+++ b/.venv3.10/Lib/asyncio/selector_events.py
@@ -4,7 +4,7 @@
also includes support for signal handling, see the unix_events sub-module.
"""
-__all__ = 'BaseSelectorEventLoop',
+__all__ = "BaseSelectorEventLoop",
import collections
import errno
@@ -51,7 +51,7 @@ def __init__(self, selector=None):
if selector is None:
selector = selectors.DefaultSelector()
- logger.debug('Using selector: %s', selector.__class__.__name__)
+ logger.debug("Using selector: %s", selector.__class__.__name__)
self._selector = selector
self._make_self_pipe()
self._transports = weakref.WeakValueDictionary()
@@ -132,7 +132,7 @@ def _write_to_self(self):
return
try:
- csock.send(b'\0')
+ csock.send(b"\0")
except OSError:
if self._debug:
logger.debug("Fail to write a null byte into the "
@@ -172,9 +172,9 @@ def _accept_connection(
# ready, so we remove the read handler temporarily.
# We'll try again in a while.
self.call_exception_handler({
- 'message': 'socket.accept() out of system resource',
- 'exception': exc,
- 'socket': trsock.TransportSocket(sock),
+ "message": "socket.accept() out of system resource",
+ "exception": exc,
+ "socket": trsock.TransportSocket(sock),
})
self._remove_reader(sock.fileno())
self.call_later(constants.ACCEPT_RETRY_DELAY,
@@ -184,7 +184,7 @@ def _accept_connection(
else:
raise # The event loop will catch, log and ignore it.
else:
- extra = {'peername': addr}
+ extra = {"peername": addr}
accept = self._accept_connection2(
protocol_factory, conn, extra, sslcontext, server,
ssl_handshake_timeout)
@@ -221,14 +221,14 @@ async def _accept_connection2(
except BaseException as exc:
if self._debug:
context = {
- 'message':
- 'Error on transport creation for incoming connection',
- 'exception': exc,
+ "message":
+ "Error on transport creation for incoming connection",
+ "exception": exc,
}
if protocol is not None:
- context['protocol'] = protocol
+ context["protocol"] = protocol
if transport is not None:
- context['transport'] = transport
+ context["transport"] = transport
self.call_exception_handler(context)
def _ensure_fd_no_transport(self, fd):
@@ -246,8 +246,8 @@ def _ensure_fd_no_transport(self, fd):
else:
if not transport.is_closing():
raise RuntimeError(
- f'File descriptor {fd!r} is used by transport '
- f'{transport!r}')
+ f"File descriptor {fd!r} is used by transport "
+ f"{transport!r}")
def _add_reader(self, fd, callback, *args):
self._check_closed()
@@ -538,7 +538,7 @@ def _sock_connect_cb(self, fut, sock, address):
err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
if err != 0:
# Jump to any except clause below.
- raise OSError(err, f'Connect call failed {address}')
+ raise OSError(err, f"Connect call failed {address}")
except (BlockingIOError, InterruptedError):
# socket is still registered, the callback will be retried later
pass
@@ -630,16 +630,16 @@ class _SelectorTransport(transports._FlowControlMixin,
def __init__(self, loop, sock, protocol, extra=None, server=None):
super().__init__(extra, loop)
- self._extra['socket'] = trsock.TransportSocket(sock)
+ self._extra["socket"] = trsock.TransportSocket(sock)
try:
- self._extra['sockname'] = sock.getsockname()
+ self._extra["sockname"] = sock.getsockname()
except OSError:
- self._extra['sockname'] = None
- if 'peername' not in self._extra:
+ self._extra["sockname"] = None
+ if "peername" not in self._extra:
try:
- self._extra['peername'] = sock.getpeername()
+ self._extra["peername"] = sock.getpeername()
except socket.error:
- self._extra['peername'] = None
+ self._extra["peername"] = None
self._sock = sock
self._sock_fd = sock.fileno()
@@ -657,30 +657,30 @@ def __init__(self, loop, sock, protocol, extra=None, server=None):
def __repr__(self):
info = [self.__class__.__name__]
if self._sock is None:
- info.append('closed')
+ info.append("closed")
elif self._closing:
- info.append('closing')
- info.append(f'fd={self._sock_fd}')
+ info.append("closing")
+ info.append(f"fd={self._sock_fd}")
# test if the transport was closed
if self._loop is not None and not self._loop.is_closed():
polling = _test_selector_event(self._loop._selector,
self._sock_fd, selectors.EVENT_READ)
if polling:
- info.append('read=polling')
+ info.append("read=polling")
else:
- info.append('read=idle')
+ info.append("read=idle")
polling = _test_selector_event(self._loop._selector,
self._sock_fd,
selectors.EVENT_WRITE)
if polling:
- state = 'polling'
+ state = "polling"
else:
- state = 'idle'
+ state = "idle"
bufsize = self.get_write_buffer_size()
- info.append(f'write=<{state}, bufsize={bufsize}>')
- return '<{}>'.format(' '.join(info))
+ info.append(f"write=<{state}, bufsize={bufsize}>")
+ return "<{}>".format(" ".join(info))
def abort(self):
self._force_close(None)
@@ -710,17 +710,17 @@ def __del__(self, _warn=warnings.warn):
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
self._sock.close()
- def _fatal_error(self, exc, message='Fatal error on transport'):
+ def _fatal_error(self, exc, message="Fatal error on transport"):
# Should be called from exception handler only.
if isinstance(exc, OSError):
if self._loop.get_debug():
logger.debug("%r: %s", self, message, exc_info=True)
else:
self._loop.call_exception_handler({
- 'message': message,
- 'exception': exc,
- 'transport': self,
- 'protocol': self._protocol,
+ "message": message,
+ "exception": exc,
+ "transport": self,
+ "protocol": self._protocol,
})
self._force_close(exc)
@@ -825,12 +825,12 @@ def _read_ready__get_buffer(self):
try:
buf = self._protocol.get_buffer(-1)
if not len(buf):
- raise RuntimeError('get_buffer() returned an empty buffer')
+ raise RuntimeError("get_buffer() returned an empty buffer")
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal error: protocol.get_buffer() call failed.')
+ exc, "Fatal error: protocol.get_buffer() call failed.")
return
try:
@@ -840,7 +840,7 @@ def _read_ready__get_buffer(self):
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as exc:
- self._fatal_error(exc, 'Fatal read error on socket transport')
+ self._fatal_error(exc, "Fatal read error on socket transport")
return
if not nbytes:
@@ -853,7 +853,7 @@ def _read_ready__get_buffer(self):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal error: protocol.buffer_updated() call failed.')
+ exc, "Fatal error: protocol.buffer_updated() call failed.")
def _read_ready__data_received(self):
if self._conn_lost:
@@ -865,7 +865,7 @@ def _read_ready__data_received(self):
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as exc:
- self._fatal_error(exc, 'Fatal read error on socket transport')
+ self._fatal_error(exc, "Fatal read error on socket transport")
return
if not data:
@@ -878,7 +878,7 @@ def _read_ready__data_received(self):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal error: protocol.data_received() call failed.')
+ exc, "Fatal error: protocol.data_received() call failed.")
def _read_ready__on_eof(self):
if self._loop.get_debug():
@@ -890,7 +890,7 @@ def _read_ready__on_eof(self):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal error: protocol.eof_received() call failed.')
+ exc, "Fatal error: protocol.eof_received() call failed.")
return
if keep_open:
@@ -903,18 +903,18 @@ def _read_ready__on_eof(self):
def write(self, data):
if not isinstance(data, (bytes, bytearray, memoryview)):
- raise TypeError(f'data argument must be a bytes-like object, '
- f'not {type(data).__name__!r}')
+ raise TypeError(f"data argument must be a bytes-like object, "
+ f"not {type(data).__name__!r}")
if self._eof:
- raise RuntimeError('Cannot call write() after write_eof()')
+ raise RuntimeError("Cannot call write() after write_eof()")
if self._empty_waiter is not None:
- raise RuntimeError('unable to write; sendfile is in progress')
+ raise RuntimeError("unable to write; sendfile is in progress")
if not data:
return
if self._conn_lost:
if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
- logger.warning('socket.send() raised exception.')
+ logger.warning("socket.send() raised exception.")
self._conn_lost += 1
return
@@ -927,7 +927,7 @@ def write(self, data):
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as exc:
- self._fatal_error(exc, 'Fatal write error on socket transport')
+ self._fatal_error(exc, "Fatal write error on socket transport")
return
else:
data = data[n:]
@@ -941,7 +941,7 @@ def write(self, data):
self._maybe_pause_protocol()
def _write_ready(self):
- assert self._buffer, 'Data should not be empty'
+ assert self._buffer, "Data should not be empty"
if self._conn_lost:
return
@@ -954,7 +954,7 @@ def _write_ready(self):
except BaseException as exc:
self._loop._remove_writer(self._sock_fd)
self._buffer.clear()
- self._fatal_error(exc, 'Fatal write error on socket transport')
+ self._fatal_error(exc, "Fatal write error on socket transport")
if self._empty_waiter is not None:
self._empty_waiter.set_exception(exc)
else:
@@ -1030,33 +1030,33 @@ def _read_ready(self):
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as exc:
- self._fatal_error(exc, 'Fatal read error on datagram transport')
+ self._fatal_error(exc, "Fatal read error on datagram transport")
else:
self._protocol.datagram_received(data, addr)
def sendto(self, data, addr=None):
if not isinstance(data, (bytes, bytearray, memoryview)):
- raise TypeError(f'data argument must be a bytes-like object, '
- f'not {type(data).__name__!r}')
+ raise TypeError(f"data argument must be a bytes-like object, "
+ f"not {type(data).__name__!r}")
if not data:
return
if self._address:
if addr not in (None, self._address):
raise ValueError(
- f'Invalid address: must be None or {self._address}')
+ f"Invalid address: must be None or {self._address}")
addr = self._address
if self._conn_lost and self._address:
if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
- logger.warning('socket.send() raised exception.')
+ logger.warning("socket.send() raised exception.")
self._conn_lost += 1
return
if not self._buffer:
# Attempt to send it right away first.
try:
- if self._extra['peername']:
+ if self._extra["peername"]:
self._sock.send(data)
else:
self._sock.sendto(data, addr)
@@ -1070,7 +1070,7 @@ def sendto(self, data, addr=None):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal write error on datagram transport')
+ exc, "Fatal write error on datagram transport")
return
# Ensure that what we buffer is immutable.
@@ -1081,7 +1081,7 @@ def _sendto_ready(self):
while self._buffer:
data, addr = self._buffer.popleft()
try:
- if self._extra['peername']:
+ if self._extra["peername"]:
self._sock.send(data)
else:
self._sock.sendto(data, addr)
@@ -1095,7 +1095,7 @@ def _sendto_ready(self):
raise
except BaseException as exc:
self._fatal_error(
- exc, 'Fatal write error on datagram transport')
+ exc, "Fatal write error on datagram transport")
return
self._maybe_resume_protocol() # May append to buffer.
diff --git a/.venv3.10/Lib/asyncio/sslproto.py b/.venv3.10/Lib/asyncio/sslproto.py
index 00fc16c0..a1c92ece 100644
--- a/.venv3.10/Lib/asyncio/sslproto.py
+++ b/.venv3.10/Lib/asyncio/sslproto.py
@@ -13,7 +13,7 @@
def _create_transport_context(server_side, server_hostname):
if server_side:
- raise ValueError('Server side SSL needs a valid SSLContext')
+ raise ValueError("Server side SSL needs a valid SSLContext")
# Client side may pass ssl=True to use a default
# context; in that case the sslcontext passed is None.
@@ -112,14 +112,14 @@ def do_handshake(self, callback=None):
called with None if successful, else an exception instance.
"""
if self._state != _UNWRAPPED:
- raise RuntimeError('handshake in progress or completed')
+ raise RuntimeError("handshake in progress or completed")
self._sslobj = self._context.wrap_bio(
self._incoming, self._outgoing,
server_side=self._server_side,
server_hostname=self._server_hostname)
self._state = _DO_HANDSHAKE
self._handshake_cb = callback
- ssldata, appdata = self.feed_ssldata(b'', only_handshake=True)
+ ssldata, appdata = self.feed_ssldata(b"", only_handshake=True)
assert len(appdata) == 0
return ssldata
@@ -133,14 +133,14 @@ def shutdown(self, callback=None):
called without arguments.
"""
if self._state == _UNWRAPPED:
- raise RuntimeError('no security layer present')
+ raise RuntimeError("no security layer present")
if self._state == _SHUTDOWN:
- raise RuntimeError('shutdown in progress')
+ raise RuntimeError("shutdown in progress")
assert self._state in (_WRAPPED, _DO_HANDSHAKE)
self._state = _SHUTDOWN
self._shutdown_cb = callback
- ssldata, appdata = self.feed_ssldata(b'')
- assert appdata == [] or appdata == [b'']
+ ssldata, appdata = self.feed_ssldata(b"")
+ assert appdata == [] or appdata == [b""]
return ssldata
def feed_eof(self):
@@ -150,8 +150,8 @@ def feed_eof(self):
unexpected.
"""
self._incoming.write_eof()
- ssldata, appdata = self.feed_ssldata(b'')
- assert appdata == [] or appdata == [b'']
+ ssldata, appdata = self.feed_ssldata(b"")
+ assert appdata == [] or appdata == [b""]
def feed_ssldata(self, data, only_handshake=False):
"""Feed SSL record level data into the pipe.
@@ -213,7 +213,7 @@ def feed_ssldata(self, data, only_handshake=False):
# Drain possible plaintext data after close_notify.
appdata.append(self._incoming.read())
except (ssl.SSLError, ssl.CertificateError) as exc:
- exc_errno = getattr(exc, 'errno', None)
+ exc_errno = getattr(exc, "errno", None)
if exc_errno not in (
ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE,
ssl.SSL_ERROR_SYSCALL):
@@ -263,8 +263,8 @@ def feed_appdata(self, data, offset=0):
# It is not allowed to call write() after unwrap() until the
# close_notify is acknowledged. We return the condition to the
# caller as a short write.
- exc_errno = getattr(exc, 'errno', None)
- if exc.reason == 'PROTOCOL_IS_SHUTDOWN':
+ exc_errno = getattr(exc, "errno", None)
+ if exc.reason == "PROTOCOL_IS_SHUTDOWN":
exc_errno = exc.errno = ssl.SSL_ERROR_WANT_READ
if exc_errno not in (ssl.SSL_ERROR_WANT_READ,
ssl.SSL_ERROR_WANT_WRITE,
@@ -323,7 +323,7 @@ def __del__(self, _warn=warnings.warn):
def is_reading(self):
tr = self._ssl_protocol._transport
if tr is None:
- raise RuntimeError('SSL transport has not been initialized yet')
+ raise RuntimeError("SSL transport has not been initialized yet")
return tr.is_reading()
def pause_reading(self):
@@ -418,7 +418,7 @@ def __init__(self, loop, app_protocol, sslcontext, waiter,
call_connection_made=True,
ssl_handshake_timeout=None):
if ssl is None:
- raise RuntimeError('stdlib ssl module not available')
+ raise RuntimeError("stdlib ssl module not available")
if ssl_handshake_timeout is None:
ssl_handshake_timeout = constants.SSL_HANDSHAKE_TIMEOUT
@@ -503,7 +503,7 @@ def connection_lost(self, exc):
self._app_transport._closed = True
self._transport = None
self._app_transport = None
- if getattr(self, '_handshake_timeout_handle', None):
+ if getattr(self, "_handshake_timeout_handle", None):
self._handshake_timeout_handle.cancel()
self._wakeup_waiter(exc)
self._app_protocol = None
@@ -535,7 +535,7 @@ def data_received(self, data):
except (SystemExit, KeyboardInterrupt):
raise
except BaseException as e:
- self._fatal_error(e, 'SSL error in data received')
+ self._fatal_error(e, "SSL error in data received")
return
for chunk in ssldata:
@@ -553,7 +553,7 @@ def data_received(self, data):
raise
except BaseException as ex:
self._fatal_error(
- ex, 'application protocol failed to receive SSL data')
+ ex, "application protocol failed to receive SSL data")
return
else:
self._start_shutdown()
@@ -576,8 +576,8 @@ def eof_received(self):
if not self._in_handshake:
keep_open = self._app_protocol.eof_received()
if keep_open:
- logger.warning('returning true from eof_received() '
- 'has no effect when using ssl')
+ logger.warning("returning true from eof_received() "
+ "has no effect when using ssl")
finally:
self._transport.close()
@@ -596,7 +596,7 @@ def _start_shutdown(self):
self._abort()
else:
self._in_shutdown = True
- self._write_appdata(b'')
+ self._write_appdata(b"")
def _write_appdata(self, data):
self._write_backlog.append((data, 0))
@@ -612,7 +612,7 @@ def _start_handshake(self):
self._in_handshake = True
# (b'', 1) is a special value in _process_write_backlog() to do
# the SSL handshake
- self._write_backlog.append((b'', 1))
+ self._write_backlog.append((b"", 1))
self._handshake_timeout_handle = \
self._loop.call_later(self._ssl_handshake_timeout,
self._check_handshake_timeout)
@@ -641,9 +641,9 @@ def _on_handshake_complete(self, handshake_exc):
raise
except BaseException as exc:
if isinstance(exc, ssl.CertificateError):
- msg = 'SSL handshake failed on verifying the certificate'
+ msg = "SSL handshake failed on verifying the certificate"
else:
- msg = 'SSL handshake failed'
+ msg = "SSL handshake failed"
self._fatal_error(exc, msg)
return
@@ -709,18 +709,18 @@ def _process_write_backlog(self):
# Exceptions will be re-raised in _on_handshake_complete.
self._on_handshake_complete(exc)
else:
- self._fatal_error(exc, 'Fatal error on SSL transport')
+ self._fatal_error(exc, "Fatal error on SSL transport")
- def _fatal_error(self, exc, message='Fatal error on transport'):
+ def _fatal_error(self, exc, message="Fatal error on transport"):
if isinstance(exc, OSError):
if self._loop.get_debug():
logger.debug("%r: %s", self, message, exc_info=True)
else:
self._loop.call_exception_handler({
- 'message': message,
- 'exception': exc,
- 'transport': self._transport,
- 'protocol': self,
+ "message": message,
+ "exception": exc,
+ "transport": self._transport,
+ "protocol": self,
})
if self._transport:
self._transport._force_close(exc)
diff --git a/.venv3.10/Lib/asyncio/staggered.py b/.venv3.10/Lib/asyncio/staggered.py
index 451a53a1..2110ab6e 100644
--- a/.venv3.10/Lib/asyncio/staggered.py
+++ b/.venv3.10/Lib/asyncio/staggered.py
@@ -1,6 +1,6 @@
"""Support for running coroutines in parallel with staggered start times."""
-__all__ = 'staggered_race',
+__all__ = "staggered_race",
import contextlib
import typing
diff --git a/.venv3.10/Lib/asyncio/streams.py b/.venv3.10/Lib/asyncio/streams.py
index 37fa7dca..73aaa63f 100644
--- a/.venv3.10/Lib/asyncio/streams.py
+++ b/.venv3.10/Lib/asyncio/streams.py
@@ -1,15 +1,14 @@
__all__ = (
- 'StreamReader', 'StreamWriter', 'StreamReaderProtocol',
- 'open_connection', 'start_server')
+ "StreamReader", "StreamWriter", "StreamReaderProtocol",
+ "open_connection", "start_server")
import collections
import socket
import sys
-import warnings
import weakref
-if hasattr(socket, 'AF_UNIX'):
- __all__ += ('open_unix_connection', 'start_unix_server')
+if hasattr(socket, "AF_UNIX"):
+ __all__ += ("open_unix_connection", "start_unix_server")
from . import coroutines
from . import events
@@ -85,7 +84,7 @@ def factory():
return await loop.create_server(factory, host, port, **kwds)
-if hasattr(socket, 'AF_UNIX'):
+if hasattr(socket, "AF_UNIX"):
# UNIX Domain Sockets are supported on this platform
async def open_unix_connection(path=None, *,
@@ -164,7 +163,7 @@ def connection_lost(self, exc):
async def _drain_helper(self):
if self._connection_lost:
- raise ConnectionResetError('Connection lost')
+ raise ConnectionResetError("Connection lost")
if not self._paused:
return
waiter = self._loop.create_future()
@@ -218,12 +217,12 @@ def _stream_reader(self):
def connection_made(self, transport):
if self._reject_connection:
context = {
- 'message': ('An open stream was garbage collected prior to '
+ "message": ('An open stream was garbage collected prior to '
'establishing network connection; '
'call "stream.close()" explicitly.')
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
transport.abort()
return
@@ -231,7 +230,7 @@ def connection_made(self, transport):
reader = self._stream_reader
if reader is not None:
reader.set_transport(transport)
- self._over_ssl = transport.get_extra_info('sslcontext') is not None
+ self._over_ssl = transport.get_extra_info("sslcontext") is not None
if self._client_connected_cb is not None:
self._stream_writer = StreamWriter(transport, self,
reader,
@@ -312,10 +311,10 @@ def __init__(self, transport, protocol, reader, loop):
self._complete_fut.set_result(None)
def __repr__(self):
- info = [self.__class__.__name__, f'transport={self._transport!r}']
+ info = [self.__class__.__name__, f"transport={self._transport!r}"]
if self._reader is not None:
- info.append(f'reader={self._reader!r}')
- return '<{}>'.format(' '.join(info))
+ info.append(f"reader={self._reader!r}")
+ return "<{}>".format(" ".join(info))
@property
def transport(self):
@@ -380,7 +379,7 @@ def __init__(self, limit=_DEFAULT_LIMIT, loop=None):
# it also doubles as half the buffer limit.
if limit <= 0:
- raise ValueError('Limit cannot be <= 0')
+ raise ValueError("Limit cannot be <= 0")
self._limit = limit
if loop is None:
@@ -398,22 +397,22 @@ def __init__(self, limit=_DEFAULT_LIMIT, loop=None):
sys._getframe(1))
def __repr__(self):
- info = ['StreamReader']
+ info = ["StreamReader"]
if self._buffer:
- info.append(f'{len(self._buffer)} bytes')
+ info.append(f"{len(self._buffer)} bytes")
if self._eof:
- info.append('eof')
+ info.append("eof")
if self._limit != _DEFAULT_LIMIT:
- info.append(f'limit={self._limit}')
+ info.append(f"limit={self._limit}")
if self._waiter:
- info.append(f'waiter={self._waiter!r}')
+ info.append(f"waiter={self._waiter!r}")
if self._exception:
- info.append(f'exception={self._exception!r}')
+ info.append(f"exception={self._exception!r}")
if self._transport:
- info.append(f'transport={self._transport!r}')
+ info.append(f"transport={self._transport!r}")
if self._paused:
- info.append('paused')
- return '<{}>'.format(' '.join(info))
+ info.append("paused")
+ return "<{}>".format(" ".join(info))
def exception(self):
return self._exception
@@ -436,7 +435,7 @@ def _wakeup_waiter(self):
waiter.set_result(None)
def set_transport(self, transport):
- assert self._transport is None, 'Transport already set'
+ assert self._transport is None, "Transport already set"
self._transport = transport
def _maybe_resume_transport(self):
@@ -453,7 +452,7 @@ def at_eof(self):
return self._eof and not self._buffer
def feed_data(self, data):
- assert not self._eof, 'feed_data after feed_eof'
+ assert not self._eof, "feed_data after feed_eof"
if not data:
return
@@ -485,10 +484,10 @@ async def _wait_for_data(self, func_name):
# which coroutine would get the next data.
if self._waiter is not None:
raise RuntimeError(
- f'{func_name}() called while another coroutine is '
- f'already waiting for incoming data')
+ f"{func_name}() called while another coroutine is "
+ f"already waiting for incoming data")
- assert not self._eof, '_wait_for_data after EOF'
+ assert not self._eof, "_wait_for_data after EOF"
# Waiting for data while paused will make deadlock, so prevent it.
# This is essential for readexactly(n) for case when n > self._limit.
@@ -518,7 +517,7 @@ async def readline(self):
If stream was paused, this function will automatically resume it if
needed.
"""
- sep = b'\n'
+ sep = b"\n"
seplen = len(sep)
try:
line = await self.readuntil(sep)
@@ -533,7 +532,7 @@ async def readline(self):
raise ValueError(e.args[0])
return line
- async def readuntil(self, separator=b'\n'):
+ async def readuntil(self, separator=b"\n"):
"""Read data from the stream until ``separator`` is found.
On success, the data and separator will be removed from the
@@ -555,7 +554,7 @@ async def readuntil(self, separator=b'\n'):
"""
seplen = len(separator)
if seplen == 0:
- raise ValueError('Separator should be at least one-byte string')
+ raise ValueError("Separator should be at least one-byte string")
if self._exception is not None:
raise self._exception
@@ -600,7 +599,7 @@ async def readuntil(self, separator=b'\n'):
offset = buflen + 1 - seplen
if offset > self._limit:
raise exceptions.LimitOverrunError(
- 'Separator is not found, and chunk exceed the limit',
+ "Separator is not found, and chunk exceed the limit",
offset)
# Complete message (with full separator) may be present in buffer
@@ -613,11 +612,11 @@ async def readuntil(self, separator=b'\n'):
raise exceptions.IncompleteReadError(chunk, None)
# _wait_for_data() will resume reading if stream was paused.
- await self._wait_for_data('readuntil')
+ await self._wait_for_data("readuntil")
if isep > self._limit:
raise exceptions.LimitOverrunError(
- 'Separator is found, but chunk is longer than limit', isep)
+ "Separator is found, but chunk is longer than limit", isep)
chunk = self._buffer[:isep + seplen]
del self._buffer[:isep + seplen]
@@ -650,7 +649,7 @@ async def read(self, n=-1):
raise self._exception
if n == 0:
- return b''
+ return b""
if n < 0:
# This used to just loop creating a new waiter hoping to
@@ -663,10 +662,10 @@ async def read(self, n=-1):
if not block:
break
blocks.append(block)
- return b''.join(blocks)
+ return b"".join(blocks)
if not self._buffer and not self._eof:
- await self._wait_for_data('read')
+ await self._wait_for_data("read")
# This will work right even if buffer is less than n bytes
data = bytes(self._buffer[:n])
@@ -691,13 +690,13 @@ async def readexactly(self, n):
needed.
"""
if n < 0:
- raise ValueError('readexactly size can not be less than zero')
+ raise ValueError("readexactly size can not be less than zero")
if self._exception is not None:
raise self._exception
if n == 0:
- return b''
+ return b""
while len(self._buffer) < n:
if self._eof:
@@ -705,7 +704,7 @@ async def readexactly(self, n):
self._buffer.clear()
raise exceptions.IncompleteReadError(incomplete, n)
- await self._wait_for_data('readexactly')
+ await self._wait_for_data("readexactly")
if len(self._buffer) == n:
data = bytes(self._buffer)
@@ -721,6 +720,6 @@ def __aiter__(self):
async def __anext__(self):
val = await self.readline()
- if val == b'':
+ if val == b"":
raise StopAsyncIteration
return val
diff --git a/.venv3.10/Lib/asyncio/subprocess.py b/.venv3.10/Lib/asyncio/subprocess.py
index cd10231f..fd920460 100644
--- a/.venv3.10/Lib/asyncio/subprocess.py
+++ b/.venv3.10/Lib/asyncio/subprocess.py
@@ -1,4 +1,4 @@
-__all__ = 'create_subprocess_exec', 'create_subprocess_shell'
+__all__ = "create_subprocess_exec", "create_subprocess_shell"
import subprocess
@@ -30,12 +30,12 @@ def __init__(self, limit, loop):
def __repr__(self):
info = [self.__class__.__name__]
if self.stdin is not None:
- info.append(f'stdin={self.stdin!r}')
+ info.append(f"stdin={self.stdin!r}")
if self.stdout is not None:
- info.append(f'stdout={self.stdout!r}')
+ info.append(f"stdout={self.stdout!r}")
if self.stderr is not None:
- info.append(f'stderr={self.stderr!r}')
- return '<{}>'.format(' '.join(info))
+ info.append(f"stderr={self.stderr!r}")
+ return "<{}>".format(" ".join(info))
def connection_made(self, transport):
self._transport = transport
@@ -123,7 +123,7 @@ def __init__(self, transport, protocol, loop):
self.pid = transport.get_pid()
def __repr__(self):
- return f'<{self.__class__.__name__} {self.pid}>'
+ return f"<{self.__class__.__name__} {self.pid}>"
@property
def returncode(self):
@@ -147,16 +147,16 @@ async def _feed_stdin(self, input):
self.stdin.write(input)
if debug:
logger.debug(
- '%r communicate: feed stdin (%s bytes)', self, len(input))
+ "%r communicate: feed stdin (%s bytes)", self, len(input))
try:
await self.stdin.drain()
except (BrokenPipeError, ConnectionResetError) as exc:
# communicate() ignores BrokenPipeError and ConnectionResetError
if debug:
- logger.debug('%r communicate: stdin got %r', self, exc)
+ logger.debug("%r communicate: stdin got %r", self, exc)
if debug:
- logger.debug('%r communicate: close stdin', self)
+ logger.debug("%r communicate: close stdin", self)
self.stdin.close()
async def _noop(self):
@@ -170,12 +170,12 @@ async def _read_stream(self, fd):
assert fd == 1
stream = self.stdout
if self._loop.get_debug():
- name = 'stdout' if fd == 1 else 'stderr'
- logger.debug('%r communicate: read %s', self, name)
+ name = "stdout" if fd == 1 else "stderr"
+ logger.debug("%r communicate: read %s", self, name)
output = await stream.read()
if self._loop.get_debug():
- name = 'stdout' if fd == 1 else 'stderr'
- logger.debug('%r communicate: close %s', self, name)
+ name = "stdout" if fd == 1 else "stderr"
+ logger.debug("%r communicate: close %s", self, name)
transport.close()
return output
diff --git a/.venv3.10/Lib/asyncio/tasks.py b/.venv3.10/Lib/asyncio/tasks.py
index f391586d..c4617137 100644
--- a/.venv3.10/Lib/asyncio/tasks.py
+++ b/.venv3.10/Lib/asyncio/tasks.py
@@ -1,12 +1,12 @@
"""Support for tasks, coroutines and the scheduler."""
__all__ = (
- 'Task', 'create_task',
- 'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED',
- 'wait', 'wait_for', 'as_completed', 'sleep',
- 'gather', 'shield', 'ensure_future', 'run_coroutine_threadsafe',
- 'current_task', 'all_tasks',
- '_register_task', '_unregister_task', '_enter_task', '_leave_task',
+ "Task", "create_task",
+ "FIRST_COMPLETED", "FIRST_EXCEPTION", "ALL_COMPLETED",
+ "wait", "wait_for", "as_completed", "sleep",
+ "gather", "shield", "ensure_future", "run_coroutine_threadsafe",
+ "current_task", "all_tasks",
+ "_register_task", "_unregister_task", "_enter_task", "_leave_task",
)
import concurrent.futures
@@ -101,7 +101,7 @@ def __init__(self, coro, *, loop=None, name=None):
raise TypeError(f"a coroutine was expected, got {coro!r}")
if name is None:
- self._name = f'Task-{_task_name_counter()}'
+ self._name = f"Task-{_task_name_counter()}"
else:
self._name = str(name)
@@ -116,11 +116,11 @@ def __init__(self, coro, *, loop=None, name=None):
def __del__(self):
if self._state == futures._PENDING and self._log_destroy_pending:
context = {
- 'task': self,
- 'message': 'Task was destroyed but it is pending!',
+ "task": self,
+ "message": "Task was destroyed but it is pending!",
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
super().__del__()
@@ -139,10 +139,10 @@ def set_name(self, value):
self._name = str(value)
def set_result(self, result):
- raise RuntimeError('Task does not support set_result operation')
+ raise RuntimeError("Task does not support set_result operation")
def set_exception(self, exception):
- raise RuntimeError('Task does not support set_exception operation')
+ raise RuntimeError("Task does not support set_exception operation")
def get_stack(self, *, limit=None):
"""Return the list of stack frames for this task's coroutine.
@@ -215,7 +215,7 @@ def cancel(self, msg=None):
def __step(self, exc=None):
if self.done():
raise exceptions.InvalidStateError(
- f'_step(): already done: {self!r}, {exc!r}')
+ f"_step(): already done: {self!r}, {exc!r}")
if self._must_cancel:
if not isinstance(exc, exceptions.CancelledError):
exc = self._make_cancelled_error()
@@ -249,19 +249,19 @@ def __step(self, exc=None):
except BaseException as exc:
super().set_exception(exc)
else:
- blocking = getattr(result, '_asyncio_future_blocking', None)
+ blocking = getattr(result, "_asyncio_future_blocking", None)
if blocking is not None:
# Yielded Future must come from Future.__iter__().
if futures._get_loop(result) is not self._loop:
new_exc = RuntimeError(
- f'Task {self!r} got Future '
- f'{result!r} attached to a different loop')
+ f"Task {self!r} got Future "
+ f"{result!r} attached to a different loop")
self._loop.call_soon(
self.__step, new_exc, context=self._context)
elif blocking:
if result is self:
new_exc = RuntimeError(
- f'Task cannot await on itself: {self!r}')
+ f"Task cannot await on itself: {self!r}")
self._loop.call_soon(
self.__step, new_exc, context=self._context)
else:
@@ -275,8 +275,8 @@ def __step(self, exc=None):
self._must_cancel = False
else:
new_exc = RuntimeError(
- f'yield was used instead of yield from '
- f'in task {self!r} with {result!r}')
+ f"yield was used instead of yield from "
+ f"in task {self!r} with {result!r}")
self._loop.call_soon(
self.__step, new_exc, context=self._context)
@@ -286,13 +286,13 @@ def __step(self, exc=None):
elif inspect.isgenerator(result):
# Yielding a generator is just wrong.
new_exc = RuntimeError(
- f'yield was used instead of yield from for '
- f'generator in task {self!r} with {result!r}')
+ f"yield was used instead of yield from for "
+ f"generator in task {self!r} with {result!r}")
self._loop.call_soon(
self.__step, new_exc, context=self._context)
else:
# Yielding something else is an error.
- new_exc = RuntimeError(f'Task got bad yield: {result!r}')
+ new_exc = RuntimeError(f"Task got bad yield: {result!r}")
self._loop.call_soon(
self.__step, new_exc, context=self._context)
finally:
@@ -365,9 +365,9 @@ async def wait(fs, *, timeout=None, return_when=ALL_COMPLETED):
if futures.isfuture(fs) or coroutines.iscoroutine(fs):
raise TypeError(f"expect a list of futures, not {type(fs).__name__}")
if not fs:
- raise ValueError('Set of coroutines/Futures is empty.')
+ raise ValueError("Set of coroutines/Futures is empty.")
if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED):
- raise ValueError(f'Invalid return_when value: {return_when}')
+ raise ValueError(f"Invalid return_when value: {return_when}")
loop = events.get_running_loop()
@@ -465,7 +465,7 @@ async def _wait(fs, timeout, return_when, loop):
The fs argument must be a collection of Futures.
"""
- assert fs, 'Set of Futures is empty.'
+ assert fs, "Set of Futures is empty."
waiter = loop.create_future()
timeout_handle = None
if timeout is not None:
@@ -618,8 +618,8 @@ def ensure_future(coro_or_future, *, loop=None):
def _ensure_future(coro_or_future, *, loop=None):
if futures.isfuture(coro_or_future):
if loop is not None and loop is not futures._get_loop(coro_or_future):
- raise ValueError('The future belongs to a different loop than '
- 'the one specified as the loop argument')
+ raise ValueError("The future belongs to a different loop than "
+ "the one specified as the loop argument")
return coro_or_future
called_wrap_awaitable = False
if not coroutines.iscoroutine(coro_or_future):
@@ -627,14 +627,14 @@ def _ensure_future(coro_or_future, *, loop=None):
coro_or_future = _wrap_awaitable(coro_or_future)
called_wrap_awaitable = True
else:
- raise TypeError('An asyncio.Future, a coroutine or an awaitable '
- 'is required')
+ raise TypeError("An asyncio.Future, a coroutine or an awaitable "
+ "is required")
if loop is None:
loop = events._get_event_loop(stacklevel=4)
try:
return loop.create_task(coro_or_future)
- except RuntimeError:
+ except RuntimeError:
if not called_wrap_awaitable:
coro_or_future.close()
raise
@@ -755,7 +755,7 @@ def _done_callback(fut):
# setting __context__. This also lets us preserve
# calling '_make_cancelled_error()' at most once.
res = exceptions.CancelledError(
- '' if fut._cancel_message is None else
+ "" if fut._cancel_message is None else
fut._cancel_message)
else:
res = fut.exception()
@@ -876,7 +876,7 @@ def run_coroutine_threadsafe(coro, loop):
Return a concurrent.futures.Future to access the result.
"""
if not coroutines.iscoroutine(coro):
- raise TypeError('A coroutine object is required')
+ raise TypeError("A coroutine object is required")
future = concurrent.futures.Future()
def callback():
diff --git a/.venv3.10/Lib/asyncio/transports.py b/.venv3.10/Lib/asyncio/transports.py
index 73b1fa2d..7ed6af8c 100644
--- a/.venv3.10/Lib/asyncio/transports.py
+++ b/.venv3.10/Lib/asyncio/transports.py
@@ -1,15 +1,15 @@
"""Abstract Transport class."""
__all__ = (
- 'BaseTransport', 'ReadTransport', 'WriteTransport',
- 'Transport', 'DatagramTransport', 'SubprocessTransport',
+ "BaseTransport", "ReadTransport", "WriteTransport",
+ "Transport", "DatagramTransport", "SubprocessTransport",
)
class BaseTransport:
"""Base class for transports."""
- __slots__ = ('_extra',)
+ __slots__ = ("_extra",)
def __init__(self, extra=None):
if extra is None:
@@ -119,7 +119,7 @@ def writelines(self, list_of_data):
The default implementation concatenates the arguments and
calls write() on the result.
"""
- data = b''.join(list_of_data)
+ data = b"".join(list_of_data)
self.write(data)
def write_eof(self):
@@ -265,7 +265,7 @@ class _FlowControlMixin(Transport):
resume_writing() may be called.
"""
- __slots__ = ('_loop', '_protocol_paused', '_high_water', '_low_water')
+ __slots__ = ("_loop", "_protocol_paused", "_high_water", "_low_water")
def __init__(self, extra=None, loop=None):
super().__init__(extra)
@@ -286,10 +286,10 @@ def _maybe_pause_protocol(self):
raise
except BaseException as exc:
self._loop.call_exception_handler({
- 'message': 'protocol.pause_writing() failed',
- 'exception': exc,
- 'transport': self,
- 'protocol': self._protocol,
+ "message": "protocol.pause_writing() failed",
+ "exception": exc,
+ "transport": self,
+ "protocol": self._protocol,
})
def _maybe_resume_protocol(self):
@@ -302,10 +302,10 @@ def _maybe_resume_protocol(self):
raise
except BaseException as exc:
self._loop.call_exception_handler({
- 'message': 'protocol.resume_writing() failed',
- 'exception': exc,
- 'transport': self,
- 'protocol': self._protocol,
+ "message": "protocol.resume_writing() failed",
+ "exception": exc,
+ "transport": self,
+ "protocol": self._protocol,
})
def get_write_buffer_limits(self):
@@ -322,7 +322,7 @@ def _set_write_buffer_limits(self, high=None, low=None):
if not high >= low >= 0:
raise ValueError(
- f'high ({high!r}) must be >= low ({low!r}) must be >= 0')
+ f"high ({high!r}) must be >= low ({low!r}) must be >= 0")
self._high_water = high
self._low_water = low
diff --git a/.venv3.10/Lib/asyncio/trsock.py b/.venv3.10/Lib/asyncio/trsock.py
index e9ebcc32..1da4492b 100644
--- a/.venv3.10/Lib/asyncio/trsock.py
+++ b/.venv3.10/Lib/asyncio/trsock.py
@@ -11,7 +11,7 @@ class TransportSocket:
operations (like "socket.close()") are banned.
"""
- __slots__ = ('_sock',)
+ __slots__ = ("_sock",)
def __init__(self, sock: socket.socket):
self._sock = sock
@@ -91,102 +91,102 @@ def getsockbyname(self):
return self._sock.getsockbyname()
def accept(self):
- self._na('accept() method')
+ self._na("accept() method")
return self._sock.accept()
def connect(self, *args, **kwargs):
- self._na('connect() method')
+ self._na("connect() method")
return self._sock.connect(*args, **kwargs)
def connect_ex(self, *args, **kwargs):
- self._na('connect_ex() method')
+ self._na("connect_ex() method")
return self._sock.connect_ex(*args, **kwargs)
def bind(self, *args, **kwargs):
- self._na('bind() method')
+ self._na("bind() method")
return self._sock.bind(*args, **kwargs)
def ioctl(self, *args, **kwargs):
- self._na('ioctl() method')
+ self._na("ioctl() method")
return self._sock.ioctl(*args, **kwargs)
def listen(self, *args, **kwargs):
- self._na('listen() method')
+ self._na("listen() method")
return self._sock.listen(*args, **kwargs)
def makefile(self):
- self._na('makefile() method')
+ self._na("makefile() method")
return self._sock.makefile()
def sendfile(self, *args, **kwargs):
- self._na('sendfile() method')
+ self._na("sendfile() method")
return self._sock.sendfile(*args, **kwargs)
def close(self):
- self._na('close() method')
+ self._na("close() method")
return self._sock.close()
def detach(self):
- self._na('detach() method')
+ self._na("detach() method")
return self._sock.detach()
def sendmsg_afalg(self, *args, **kwargs):
- self._na('sendmsg_afalg() method')
+ self._na("sendmsg_afalg() method")
return self._sock.sendmsg_afalg(*args, **kwargs)
def sendmsg(self, *args, **kwargs):
- self._na('sendmsg() method')
+ self._na("sendmsg() method")
return self._sock.sendmsg(*args, **kwargs)
def sendto(self, *args, **kwargs):
- self._na('sendto() method')
+ self._na("sendto() method")
return self._sock.sendto(*args, **kwargs)
def send(self, *args, **kwargs):
- self._na('send() method')
+ self._na("send() method")
return self._sock.send(*args, **kwargs)
def sendall(self, *args, **kwargs):
- self._na('sendall() method')
+ self._na("sendall() method")
return self._sock.sendall(*args, **kwargs)
def set_inheritable(self, *args, **kwargs):
- self._na('set_inheritable() method')
+ self._na("set_inheritable() method")
return self._sock.set_inheritable(*args, **kwargs)
def share(self, process_id):
- self._na('share() method')
+ self._na("share() method")
return self._sock.share(process_id)
def recv_into(self, *args, **kwargs):
- self._na('recv_into() method')
+ self._na("recv_into() method")
return self._sock.recv_into(*args, **kwargs)
def recvfrom_into(self, *args, **kwargs):
- self._na('recvfrom_into() method')
+ self._na("recvfrom_into() method")
return self._sock.recvfrom_into(*args, **kwargs)
def recvmsg_into(self, *args, **kwargs):
- self._na('recvmsg_into() method')
+ self._na("recvmsg_into() method")
return self._sock.recvmsg_into(*args, **kwargs)
def recvmsg(self, *args, **kwargs):
- self._na('recvmsg() method')
+ self._na("recvmsg() method")
return self._sock.recvmsg(*args, **kwargs)
def recvfrom(self, *args, **kwargs):
- self._na('recvfrom() method')
+ self._na("recvfrom() method")
return self._sock.recvfrom(*args, **kwargs)
def recv(self, *args, **kwargs):
- self._na('recv() method')
+ self._na("recv() method")
return self._sock.recv(*args, **kwargs)
def settimeout(self, value):
if value == 0:
return
raise ValueError(
- 'settimeout(): only 0 timeout is allowed on transport sockets')
+ "settimeout(): only 0 timeout is allowed on transport sockets")
def gettimeout(self):
return 0
@@ -195,12 +195,12 @@ def setblocking(self, flag):
if not flag:
return
raise ValueError(
- 'setblocking(): transport sockets cannot be blocking')
+ "setblocking(): transport sockets cannot be blocking")
def __enter__(self):
- self._na('context manager protocol')
+ self._na("context manager protocol")
return self._sock.__enter__()
def __exit__(self, *err):
- self._na('context manager protocol')
+ self._na("context manager protocol")
return self._sock.__exit__(*err)
diff --git a/.venv3.10/Lib/asyncio/unix_events.py b/.venv3.10/Lib/asyncio/unix_events.py
index faaca305..73483a00 100644
--- a/.venv3.10/Lib/asyncio/unix_events.py
+++ b/.venv3.10/Lib/asyncio/unix_events.py
@@ -27,16 +27,16 @@
__all__ = (
- 'SelectorEventLoop',
- 'AbstractChildWatcher', 'SafeChildWatcher',
- 'FastChildWatcher', 'PidfdChildWatcher',
- 'MultiLoopChildWatcher', 'ThreadedChildWatcher',
- 'DefaultEventLoopPolicy',
+ "SelectorEventLoop",
+ "AbstractChildWatcher", "SafeChildWatcher",
+ "FastChildWatcher", "PidfdChildWatcher",
+ "MultiLoopChildWatcher", "ThreadedChildWatcher",
+ "DefaultEventLoopPolicy",
)
-if sys.platform == 'win32': # pragma: no cover
- raise ImportError('Signals are not really supported on Windows')
+if sys.platform == "win32": # pragma: no cover
+ raise ImportError("Signals are not really supported on Windows")
def _sighandler_noop(signum, frame):
@@ -123,10 +123,10 @@ def add_signal_handler(self, sig, callback, *args):
try:
signal.set_wakeup_fd(-1)
except (ValueError, OSError) as nexc:
- logger.info('set_wakeup_fd(-1) failed: %s', nexc)
+ logger.info("set_wakeup_fd(-1) failed: %s", nexc)
if exc.errno == errno.EINVAL:
- raise RuntimeError(f'sig {sig} cannot be caught')
+ raise RuntimeError(f"sig {sig} cannot be caught")
else:
raise
@@ -160,7 +160,7 @@ def remove_signal_handler(self, sig):
signal.signal(sig, handler)
except OSError as exc:
if exc.errno == errno.EINVAL:
- raise RuntimeError(f'sig {sig} cannot be caught')
+ raise RuntimeError(f"sig {sig} cannot be caught")
else:
raise
@@ -168,7 +168,7 @@ def remove_signal_handler(self, sig):
try:
signal.set_wakeup_fd(-1)
except (ValueError, OSError) as exc:
- logger.info('set_wakeup_fd(-1) failed: %s', exc)
+ logger.info("set_wakeup_fd(-1) failed: %s", exc)
return True
@@ -179,10 +179,10 @@ def _check_signal(self, sig):
Raise RuntimeError if there is a problem setting up the handler.
"""
if not isinstance(sig, int):
- raise TypeError(f'sig must be an int, not {sig!r}')
+ raise TypeError(f"sig must be an int, not {sig!r}")
if sig not in signal.valid_signals():
- raise ValueError(f'invalid signal number {sig}')
+ raise ValueError(f"invalid signal number {sig}")
def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
extra=None):
@@ -235,18 +235,18 @@ async def create_unix_connection(
if ssl:
if server_hostname is None:
raise ValueError(
- 'you have to pass server_hostname when using ssl')
+ "you have to pass server_hostname when using ssl")
else:
if server_hostname is not None:
- raise ValueError('server_hostname is only meaningful with ssl')
+ raise ValueError("server_hostname is only meaningful with ssl")
if ssl_handshake_timeout is not None:
raise ValueError(
- 'ssl_handshake_timeout is only meaningful with ssl')
+ "ssl_handshake_timeout is only meaningful with ssl")
if path is not None:
if sock is not None:
raise ValueError(
- 'path and sock can not be specified at the same time')
+ "path and sock can not be specified at the same time")
path = os.fspath(path)
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
@@ -259,11 +259,11 @@ async def create_unix_connection(
else:
if sock is None:
- raise ValueError('no path and sock were specified')
+ raise ValueError("no path and sock were specified")
if (sock.family != socket.AF_UNIX or
sock.type != socket.SOCK_STREAM):
raise ValueError(
- f'A UNIX Domain Stream Socket was expected, got {sock!r}')
+ f"A UNIX Domain Stream Socket was expected, got {sock!r}")
sock.setblocking(False)
transport, protocol = await self._create_connection_transport(
@@ -277,22 +277,22 @@ async def create_unix_server(
ssl_handshake_timeout=None,
start_serving=True):
if isinstance(ssl, bool):
- raise TypeError('ssl argument must be an SSLContext or None')
+ raise TypeError("ssl argument must be an SSLContext or None")
if ssl_handshake_timeout is not None and not ssl:
raise ValueError(
- 'ssl_handshake_timeout is only meaningful with ssl')
+ "ssl_handshake_timeout is only meaningful with ssl")
if path is not None:
if sock is not None:
raise ValueError(
- 'path and sock can not be specified at the same time')
+ "path and sock can not be specified at the same time")
path = os.fspath(path)
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
# Check for abstract socket. `str` and `bytes` paths are supported.
- if path[0] not in (0, '\x00'):
+ if path[0] not in (0, "\x00"):
try:
if stat.S_ISSOCK(os.stat(path).st_mode):
os.remove(path)
@@ -300,8 +300,8 @@ async def create_unix_server(
pass
except OSError as err:
# Directory may have permissions only to create socket.
- logger.error('Unable to check or remove stale UNIX socket '
- '%r: %r', path, err)
+ logger.error("Unable to check or remove stale UNIX socket "
+ "%r: %r", path, err)
try:
sock.bind(path)
@@ -310,7 +310,7 @@ async def create_unix_server(
if exc.errno == errno.EADDRINUSE:
# Let's improve the error message by adding
# with what exact address it occurs.
- msg = f'Address {path!r} is already in use'
+ msg = f"Address {path!r} is already in use"
raise OSError(errno.EADDRINUSE, msg) from None
else:
raise
@@ -320,12 +320,12 @@ async def create_unix_server(
else:
if sock is None:
raise ValueError(
- 'path was not specified, and no sock specified')
+ "path was not specified, and no sock specified")
if (sock.family != socket.AF_UNIX or
sock.type != socket.SOCK_STREAM):
raise ValueError(
- f'A UNIX Domain Stream Socket was expected, got {sock!r}')
+ f"A UNIX Domain Stream Socket was expected, got {sock!r}")
sock.setblocking(False)
server = base_events.Server(self, [sock], protocol_factory,
@@ -346,7 +346,7 @@ async def _sock_sendfile_native(self, sock, file, offset, count):
"os.sendfile() is not available")
try:
fileno = file.fileno()
- except (AttributeError, io.UnsupportedOperation) as err:
+ except (AttributeError, io.UnsupportedOperation):
raise exceptions.SendfileNotAvailableError("not a regular file")
try:
fsize = os.fstat(fileno).st_size
@@ -450,7 +450,7 @@ class _UnixReadPipeTransport(transports.ReadTransport):
def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
super().__init__(extra)
- self._extra['pipe'] = pipe
+ self._extra["pipe"] = pipe
self._loop = loop
self._pipe = pipe
self._fileno = pipe.fileno()
@@ -481,23 +481,23 @@ def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
def __repr__(self):
info = [self.__class__.__name__]
if self._pipe is None:
- info.append('closed')
+ info.append("closed")
elif self._closing:
- info.append('closing')
- info.append(f'fd={self._fileno}')
- selector = getattr(self._loop, '_selector', None)
+ info.append("closing")
+ info.append(f"fd={self._fileno}")
+ selector = getattr(self._loop, "_selector", None)
if self._pipe is not None and selector is not None:
polling = selector_events._test_selector_event(
selector, self._fileno, selectors.EVENT_READ)
if polling:
- info.append('polling')
+ info.append("polling")
else:
- info.append('idle')
+ info.append("idle")
elif self._pipe is not None:
- info.append('open')
+ info.append("open")
else:
- info.append('closed')
- return '<{}>'.format(' '.join(info))
+ info.append("closed")
+ return "<{}>".format(" ".join(info))
def _read_ready(self):
try:
@@ -505,7 +505,7 @@ def _read_ready(self):
except (BlockingIOError, InterruptedError):
pass
except OSError as exc:
- self._fatal_error(exc, 'Fatal read error on pipe transport')
+ self._fatal_error(exc, "Fatal read error on pipe transport")
else:
if data:
self._protocol.data_received(data)
@@ -551,17 +551,17 @@ def __del__(self, _warn=warnings.warn):
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
self._pipe.close()
- def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+ def _fatal_error(self, exc, message="Fatal error on pipe transport"):
# should be called by exception handler only
if (isinstance(exc, OSError) and exc.errno == errno.EIO):
if self._loop.get_debug():
logger.debug("%r: %s", self, message, exc_info=True)
else:
self._loop.call_exception_handler({
- 'message': message,
- 'exception': exc,
- 'transport': self,
- 'protocol': self._protocol,
+ "message": message,
+ "exception": exc,
+ "transport": self,
+ "protocol": self._protocol,
})
self._close(exc)
@@ -585,7 +585,7 @@ class _UnixWritePipeTransport(transports._FlowControlMixin,
def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
super().__init__(extra, loop)
- self._extra['pipe'] = pipe
+ self._extra["pipe"] = pipe
self._pipe = pipe
self._fileno = pipe.fileno()
self._protocol = protocol
@@ -623,26 +623,26 @@ def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
def __repr__(self):
info = [self.__class__.__name__]
if self._pipe is None:
- info.append('closed')
+ info.append("closed")
elif self._closing:
- info.append('closing')
- info.append(f'fd={self._fileno}')
- selector = getattr(self._loop, '_selector', None)
+ info.append("closing")
+ info.append(f"fd={self._fileno}")
+ selector = getattr(self._loop, "_selector", None)
if self._pipe is not None and selector is not None:
polling = selector_events._test_selector_event(
selector, self._fileno, selectors.EVENT_WRITE)
if polling:
- info.append('polling')
+ info.append("polling")
else:
- info.append('idle')
+ info.append("idle")
bufsize = self.get_write_buffer_size()
- info.append(f'bufsize={bufsize}')
+ info.append(f"bufsize={bufsize}")
elif self._pipe is not None:
- info.append('open')
+ info.append("open")
else:
- info.append('closed')
- return '<{}>'.format(' '.join(info))
+ info.append("closed")
+ return "<{}>".format(" ".join(info))
def get_write_buffer_size(self):
return len(self._buffer)
@@ -665,8 +665,8 @@ def write(self, data):
if self._conn_lost or self._closing:
if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
- logger.warning('pipe closed by peer or '
- 'os.write(pipe, data) raised exception.')
+ logger.warning("pipe closed by peer or "
+ "os.write(pipe, data) raised exception.")
self._conn_lost += 1
return
@@ -680,7 +680,7 @@ def write(self, data):
raise
except BaseException as exc:
self._conn_lost += 1
- self._fatal_error(exc, 'Fatal write error on pipe transport')
+ self._fatal_error(exc, "Fatal write error on pipe transport")
return
if n == len(data):
return
@@ -692,7 +692,7 @@ def write(self, data):
self._maybe_pause_protocol()
def _write_ready(self):
- assert self._buffer, 'Data should not be empty'
+ assert self._buffer, "Data should not be empty"
try:
n = os.write(self._fileno, self._buffer)
@@ -706,7 +706,7 @@ def _write_ready(self):
# Remove writer here, _fatal_error() doesn't it
# because _buffer is empty.
self._loop._remove_writer(self._fileno)
- self._fatal_error(exc, 'Fatal write error on pipe transport')
+ self._fatal_error(exc, "Fatal write error on pipe transport")
else:
if n == len(self._buffer):
self._buffer.clear()
@@ -753,17 +753,17 @@ def __del__(self, _warn=warnings.warn):
def abort(self):
self._close(None)
- def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+ def _fatal_error(self, exc, message="Fatal error on pipe transport"):
# should be called by exception handler only
if isinstance(exc, OSError):
if self._loop.get_debug():
logger.debug("%r: %s", self, message, exc_info=True)
else:
self._loop.call_exception_handler({
- 'message': message,
- 'exception': exc,
- 'transport': self,
- 'protocol': self._protocol,
+ "message": message,
+ "exception": exc,
+ "transport": self,
+ "protocol": self._protocol,
})
self._close(exc)
@@ -789,7 +789,7 @@ class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport):
def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
stdin_w = None
- if stdin == subprocess.PIPE and sys.platform.startswith('aix'):
+ if stdin == subprocess.PIPE and sys.platform.startswith("aix"):
# Use a socket pair for stdin on AIX, since it does not
# support selecting read events on the write end of a
# socket (which we use in order to detect closing of the
@@ -801,7 +801,7 @@ def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
universal_newlines=False, bufsize=bufsize, **kwargs)
if stdin_w is not None:
stdin.close()
- self._proc.stdin = open(stdin_w.detach(), 'wb', buffering=bufsize)
+ self._proc.stdin = open(stdin_w.detach(), "wb", buffering=bufsize)
stdin_w = None
finally:
if stdin_w is not None:
@@ -919,8 +919,8 @@ def close(self):
def attach_loop(self, loop):
if self._loop is not None and loop is None and self._callbacks:
warnings.warn(
- 'A loop is being detached '
- 'from a child watcher with pending handlers',
+ "A loop is being detached "
+ "from a child watcher with pending handlers",
RuntimeWarning)
for pidfd, _, _ in self._callbacks.values():
self._loop._remove_reader(pidfd)
@@ -989,8 +989,8 @@ def attach_loop(self, loop):
if self._loop is not None and loop is None and self._callbacks:
warnings.warn(
- 'A loop is being detached '
- 'from a child watcher with pending handlers',
+ "A loop is being detached "
+ "from a child watcher with pending handlers",
RuntimeWarning)
if self._loop is not None:
@@ -1014,8 +1014,8 @@ def _sig_chld(self):
# as '_sig_chld' is added as a signal handler
# in 'attach_loop'
self._loop.call_exception_handler({
- 'message': 'Unknown exception in SIGCHLD handler',
- 'exception': exc,
+ "message": "Unknown exception in SIGCHLD handler",
+ "exception": exc,
})
@@ -1078,7 +1078,7 @@ def _do_waitpid(self, expected_pid):
returncode = waitstatus_to_exitcode(status)
if self._loop.get_debug():
- logger.debug('process %s exited with returncode %s',
+ logger.debug("process %s exited with returncode %s",
expected_pid, returncode)
try:
@@ -1180,14 +1180,14 @@ def _do_waitpid_all(self):
# It may not be registered yet.
self._zombies[pid] = returncode
if self._loop.get_debug():
- logger.debug('unknown process %s exited '
- 'with returncode %s',
+ logger.debug("unknown process %s exited "
+ "with returncode %s",
pid, returncode)
continue
callback = None
else:
if self._loop.get_debug():
- logger.debug('process %s exited with returncode %s',
+ logger.debug("process %s exited with returncode %s",
pid, returncode)
if callback is None:
@@ -1310,7 +1310,7 @@ def _do_waitpid(self, expected_pid):
logger.warning("Loop %r that handles pid %r is closed", loop, pid)
else:
if debug_log and loop.get_debug():
- logger.debug('process %s exited with returncode %s',
+ logger.debug("process %s exited with returncode %s",
expected_pid, returncode)
loop.call_soon_threadsafe(callback, pid, returncode, *args)
@@ -1320,7 +1320,7 @@ def _sig_chld(self, signum, frame):
except (SystemExit, KeyboardInterrupt):
raise
except BaseException:
- logger.warning('Unknown exception in SIGCHLD handler', exc_info=True)
+ logger.warning("Unknown exception in SIGCHLD handler", exc_info=True)
class ThreadedChildWatcher(AbstractChildWatcher):
@@ -1401,7 +1401,7 @@ def _do_waitpid(self, loop, expected_pid, callback, args):
else:
returncode = waitstatus_to_exitcode(status)
if loop.get_debug():
- logger.debug('process %s exited with returncode %s',
+ logger.debug("process %s exited with returncode %s",
expected_pid, returncode)
if loop.is_closed():
diff --git a/.venv3.10/Lib/asyncio/windows_events.py b/.venv3.10/Lib/asyncio/windows_events.py
index 5aed8255..1bbf73cb 100644
--- a/.venv3.10/Lib/asyncio/windows_events.py
+++ b/.venv3.10/Lib/asyncio/windows_events.py
@@ -2,8 +2,8 @@
import sys
-if sys.platform != 'win32': # pragma: no cover
- raise ImportError('win32 only')
+if sys.platform != "win32": # pragma: no cover
+ raise ImportError("win32 only")
import _overlapped
import _winapi
@@ -27,9 +27,9 @@
__all__ = (
- 'SelectorEventLoop', 'ProactorEventLoop', 'IocpProactor',
- 'DefaultEventLoopPolicy', 'WindowsSelectorEventLoopPolicy',
- 'WindowsProactorEventLoopPolicy',
+ "SelectorEventLoop", "ProactorEventLoop", "IocpProactor",
+ "DefaultEventLoopPolicy", "WindowsSelectorEventLoopPolicy",
+ "WindowsProactorEventLoopPolicy",
)
@@ -60,8 +60,8 @@ def __init__(self, ov, *, loop=None):
def _repr_info(self):
info = super()._repr_info()
if self._ov is not None:
- state = 'pending' if self._ov.pending else 'completed'
- info.insert(1, f'overlapped=<{state}, {self._ov.address:#x}>')
+ state = "pending" if self._ov.pending else "completed"
+ info.insert(1, f"overlapped=<{state}, {self._ov.address:#x}>")
return info
def _cancel_overlapped(self):
@@ -71,12 +71,12 @@ def _cancel_overlapped(self):
self._ov.cancel()
except OSError as exc:
context = {
- 'message': 'Cancelling an overlapped future failed',
- 'exception': exc,
- 'future': self,
+ "message": "Cancelling an overlapped future failed",
+ "exception": exc,
+ "future": self,
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
self._ov = None
@@ -117,12 +117,12 @@ def _poll(self):
def _repr_info(self):
info = super()._repr_info()
- info.append(f'handle={self._handle:#x}')
+ info.append(f"handle={self._handle:#x}")
if self._handle is not None:
- state = 'signaled' if self._poll() else 'waiting'
+ state = "signaled" if self._poll() else "waiting"
info.append(state)
if self._wait_handle is not None:
- info.append(f'wait_handle={self._wait_handle:#x}')
+ info.append(f"wait_handle={self._wait_handle:#x}")
return info
def _unregister_wait_cb(self, fut):
@@ -142,12 +142,12 @@ def _unregister_wait(self):
except OSError as exc:
if exc.winerror != _overlapped.ERROR_IO_PENDING:
context = {
- 'message': 'Failed to unregister the wait handle',
- 'exception': exc,
- 'future': self,
+ "message": "Failed to unregister the wait handle",
+ "exception": exc,
+ "future": self,
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
return
# ERROR_IO_PENDING means that the unregister is pending
@@ -229,12 +229,12 @@ def _unregister_wait(self):
except OSError as exc:
if exc.winerror != _overlapped.ERROR_IO_PENDING:
context = {
- 'message': 'Failed to unregister the wait handle',
- 'exception': exc,
- 'future': self,
+ "message": "Failed to unregister the wait handle",
+ "exception": exc,
+ "future": self,
}
if self._source_traceback:
- context['source_traceback'] = self._source_traceback
+ context["source_traceback"] = self._source_traceback
self._loop.call_exception_handler(context)
return
# ERROR_IO_PENDING is not an error, the wait was unregistered
@@ -338,7 +338,7 @@ async def create_pipe_connection(self, protocol_factory, address):
pipe = await f
protocol = protocol_factory()
trans = self._make_duplex_pipe_transport(pipe, protocol,
- extra={'addr': address})
+ extra={"addr": address})
return trans, protocol
async def start_serving_pipe(self, protocol_factory, address):
@@ -359,7 +359,7 @@ def loop_accept_pipe(f=None):
protocol = protocol_factory()
self._make_duplex_pipe_transport(
- pipe, protocol, extra={'addr': address})
+ pipe, protocol, extra={"addr": address})
pipe = server._get_unconnected_pipe()
if pipe is None:
@@ -373,9 +373,9 @@ def loop_accept_pipe(f=None):
except OSError as exc:
if pipe and pipe.fileno() != -1:
self.call_exception_handler({
- 'message': 'Pipe accept failed',
- 'exception': exc,
- 'pipe': pipe,
+ "message": "Pipe accept failed",
+ "exception": exc,
+ "pipe": pipe,
})
pipe.close()
elif self._debug:
@@ -427,14 +427,14 @@ def __init__(self, concurrency=0xffffffff):
def _check_closed(self):
if self._iocp is None:
- raise RuntimeError('IocpProactor is closed')
+ raise RuntimeError("IocpProactor is closed")
def __repr__(self):
- info = ['overlapped#=%s' % len(self._cache),
- 'result#=%s' % len(self._results)]
+ info = ["overlapped#=%s" % len(self._cache),
+ "result#=%s" % len(self._results)]
if self._iocp is None:
- info.append('closed')
- return '<%s %s>' % (self.__class__.__name__, " ".join(info))
+ info.append("closed")
+ return "<%s %s>" % (self.__class__.__name__, " ".join(info))
def set_loop(self, loop):
self._loop = loop
@@ -464,7 +464,7 @@ def recv(self, conn, nbytes, flags=0):
else:
ov.ReadFile(conn.fileno(), nbytes)
except BrokenPipeError:
- return self._result(b'')
+ return self._result(b"")
def finish_recv(trans, key, ov):
try:
@@ -507,7 +507,7 @@ def recvfrom(self, conn, nbytes, flags=0):
try:
ov.WSARecvFrom(conn.fileno(), nbytes, flags)
except BrokenPipeError:
- return self._result((b'', None))
+ return self._result((b"", None))
def finish_recv(trans, key, ov):
try:
@@ -568,7 +568,7 @@ def accept(self, listener):
def finish_accept(trans, key, ov):
ov.getresult()
# Use SO_UPDATE_ACCEPT_CONTEXT so getsockname() etc work.
- buf = struct.pack('@P', listener.fileno())
+ buf = struct.pack("@P", listener.fileno())
conn.setsockopt(socket.SOL_SOCKET,
_overlapped.SO_UPDATE_ACCEPT_CONTEXT, buf)
conn.settimeout(listener.gettimeout())
@@ -805,9 +805,9 @@ def _poll(self, timeout=None):
except KeyError:
if self._loop.get_debug():
self._loop.call_exception_handler({
- 'message': ('GetQueuedCompletionStatus() returned an '
- 'unexpected event'),
- 'status': ('err=%s transferred=%s key=%#x address=%#x'
+ "message": ("GetQueuedCompletionStatus() returned an "
+ "unexpected event"),
+ "status": ("err=%s transferred=%s key=%#x address=%#x"
% (err, transferred, key, address)),
})
@@ -863,12 +863,12 @@ def close(self):
except OSError as exc:
if self._loop is not None:
context = {
- 'message': 'Cancelling a future failed',
- 'exception': exc,
- 'future': fut,
+ "message": "Cancelling a future failed",
+ "exception": exc,
+ "future": fut,
}
if fut._source_traceback:
- context['source_traceback'] = fut._source_traceback
+ context["source_traceback"] = fut._source_traceback
self._loop.call_exception_handler(context)
# Wait until all cancelled overlapped complete: don't exit with running
@@ -879,7 +879,7 @@ def close(self):
next_msg = start_time + msg_update
while self._cache:
if next_msg <= time.monotonic():
- logger.debug('%r is running after closing for %.1f seconds',
+ logger.debug("%r is running after closing for %.1f seconds",
self, time.monotonic() - start_time)
next_msg = time.monotonic() + msg_update
diff --git a/.venv3.10/Lib/asyncio/windows_utils.py b/.venv3.10/Lib/asyncio/windows_utils.py
index ef277fac..44d241e3 100644
--- a/.venv3.10/Lib/asyncio/windows_utils.py
+++ b/.venv3.10/Lib/asyncio/windows_utils.py
@@ -2,8 +2,8 @@
import sys
-if sys.platform != 'win32': # pragma: no cover
- raise ImportError('win32 only')
+if sys.platform != "win32": # pragma: no cover
+ raise ImportError("win32 only")
import _winapi
import itertools
@@ -14,7 +14,7 @@
import warnings
-__all__ = 'pipe', 'Popen', 'PIPE', 'PipeHandle'
+__all__ = "pipe", "Popen", "PIPE", "PipeHandle"
# Constants/globals
@@ -32,7 +32,7 @@
def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE):
"""Like os.pipe() but with overlapped support and using handles not fds."""
address = tempfile.mktemp(
- prefix=r'\\.\pipe\python-pipe-{:d}-{:d}-'.format(
+ prefix=r"\\.\pipe\python-pipe-{:d}-{:d}-".format(
os.getpid(), next(_mmap_counter)))
if duplex:
@@ -88,10 +88,10 @@ def __init__(self, handle):
def __repr__(self):
if self._handle is not None:
- handle = f'handle={self._handle!r}'
+ handle = f"handle={self._handle!r}"
else:
- handle = 'closed'
- return f'<{self.__class__.__name__} {handle}>'
+ handle = "closed"
+ return f"<{self.__class__.__name__} {handle}>"
@property
def handle(self):
@@ -128,8 +128,8 @@ class Popen(subprocess.Popen):
The stdin, stdout, stderr are None or instances of PipeHandle.
"""
def __init__(self, args, stdin=None, stdout=None, stderr=None, **kwds):
- assert not kwds.get('universal_newlines')
- assert kwds.get('bufsize', 0) == 0
+ assert not kwds.get("universal_newlines")
+ assert kwds.get("bufsize", 0) == 0
stdin_rfd = stdout_wfd = stderr_wfd = None
stdin_wh = stdout_rh = stderr_rh = None
if stdin == PIPE:
diff --git a/.venv3.10/Lib/asyncore.py b/.venv3.10/Lib/asyncore.py
index a360d404..972515c4 100644
--- a/.venv3.10/Lib/asyncore.py
+++ b/.venv3.10/Lib/asyncore.py
@@ -58,8 +58,8 @@
errorcode
warnings.warn(
- 'The asyncore module is deprecated and will be removed in Python 3.12. '
- 'The recommended replacement is asyncio',
+ "The asyncore module is deprecated and will be removed in Python 3.12. "
+ "The recommended replacement is asyncio",
DeprecationWarning,
stacklevel=2)
@@ -200,7 +200,7 @@ def loop(timeout=30.0, use_poll=False, map=None, count=None):
if map is None:
map = socket_map
- if use_poll and hasattr(select, 'poll'):
+ if use_poll and hasattr(select, "poll"):
poll_fun = poll2
else:
poll_fun = poll
@@ -222,7 +222,7 @@ class dispatcher:
connecting = False
closing = False
addr = None
- ignore_log_types = frozenset({'warning'})
+ ignore_log_types = frozenset({"warning"})
def __init__(self, sock=None, map=None):
if map is None:
@@ -259,15 +259,15 @@ def __init__(self, sock=None, map=None):
def __repr__(self):
status = [self.__class__.__module__+"."+self.__class__.__qualname__]
if self.accepting and self.addr:
- status.append('listening')
+ status.append("listening")
elif self.connected:
- status.append('connected')
+ status.append("connected")
if self.addr is not None:
try:
- status.append('%s:%d' % self.addr)
+ status.append("%s:%d" % self.addr)
except TypeError:
status.append(repr(self.addr))
- return '<%s at %#x>' % (' '.join(status), id(self))
+ return "<%s at %#x>" % (" ".join(status), id(self))
def add_channel(self, map=None):
#self.log_info('adding channel %s' % self)
@@ -324,7 +324,7 @@ def writable(self):
def listen(self, num):
self.accepting = True
- if os.name == 'nt' and num > 5:
+ if os.name == "nt" and num > 5:
num = 5
return self.socket.listen(num)
@@ -337,7 +337,7 @@ def connect(self, address):
self.connecting = True
err = self.socket.connect_ex(address)
if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
- or err == EINVAL and os.name == 'nt':
+ or err == EINVAL and os.name == "nt":
self.addr = address
return
if err in (0, EISCONN):
@@ -380,14 +380,14 @@ def recv(self, buffer_size):
# a closed connection is indicated by signaling
# a read condition, and having recv() return 0.
self.handle_close()
- return b''
+ return b""
else:
return data
except OSError as why:
# winsock sometimes raises ENOTCONN
if why.errno in _DISCONNECTED:
self.handle_close()
- return b''
+ return b""
else:
raise
@@ -408,11 +408,11 @@ def close(self):
# and 'log_info' is for informational, warning and error logging.
def log(self, message):
- sys.stderr.write('log: %s\n' % str(message))
+ sys.stderr.write("log: %s\n" % str(message))
- def log_info(self, message, type='info'):
+ def log_info(self, message, type="info"):
if type not in self.ignore_log_types:
- print('%s: %s' % (type, message))
+ print("%s: %s" % (type, message))
def handle_read_event(self):
if self.accepting:
@@ -467,30 +467,30 @@ def handle_error(self):
try:
self_repr = repr(self)
except:
- self_repr = '<__repr__(self) failed for object at %0x>' % id(self)
+ self_repr = "<__repr__(self) failed for object at %0x>" % id(self)
self.log_info(
- 'uncaptured python exception, closing channel %s (%s:%s %s)' % (
+ "uncaptured python exception, closing channel %s (%s:%s %s)" % (
self_repr,
t,
v,
tbinfo
),
- 'error'
+ "error"
)
self.handle_close()
def handle_expt(self):
- self.log_info('unhandled incoming priority event', 'warning')
+ self.log_info("unhandled incoming priority event", "warning")
def handle_read(self):
- self.log_info('unhandled read event', 'warning')
+ self.log_info("unhandled read event", "warning")
def handle_write(self):
- self.log_info('unhandled write event', 'warning')
+ self.log_info("unhandled write event", "warning")
def handle_connect(self):
- self.log_info('unhandled connect event', 'warning')
+ self.log_info("unhandled connect event", "warning")
def handle_accept(self):
pair = self.accept()
@@ -499,10 +499,10 @@ def handle_accept(self):
def handle_accepted(self, sock, addr):
sock.close()
- self.log_info('unhandled accepted event', 'warning')
+ self.log_info("unhandled accepted event", "warning")
def handle_close(self):
- self.log_info('unhandled close event', 'warning')
+ self.log_info("unhandled close event", "warning")
self.close()
# ---------------------------------------------------------------------------
@@ -514,7 +514,7 @@ class dispatcher_with_send(dispatcher):
def __init__(self, sock=None, map=None):
dispatcher.__init__(self, sock, map)
- self.out_buffer = b''
+ self.out_buffer = b""
def initiate_send(self):
num_sent = 0
@@ -529,7 +529,7 @@ def writable(self):
def send(self, data):
if self.debug:
- self.log_info('sending %s' % repr(data))
+ self.log_info("sending %s" % repr(data))
self.out_buffer = self.out_buffer + data
self.initiate_send()
@@ -554,7 +554,7 @@ def compact_traceback():
del tb
file, function, line = tbinfo[-1]
- info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo])
+ info = " ".join(["[%s|%s|%s]" % x for x in tbinfo])
return (file, function, line), t, v, info
def close_all(map=None, ignore_all=False):
@@ -588,7 +588,7 @@ def close_all(map=None, ignore_all=False):
#
# Regardless, this is useful for pipes, and stdin/stdout...
-if os.name == 'posix':
+if os.name == "posix":
class file_wrapper:
# Here we override just enough to make a file
# look like a socket for the purposes of asyncore.
diff --git a/.venv3.10/Lib/base64.py b/.venv3.10/Lib/base64.py
index e1256ad9..9fb168cc 100644
--- a/.venv3.10/Lib/base64.py
+++ b/.venv3.10/Lib/base64.py
@@ -13,19 +13,19 @@
__all__ = [
# Legacy interface exports traditional RFC 2045 Base64 encodings
- 'encode', 'decode', 'encodebytes', 'decodebytes',
+ "encode", "decode", "encodebytes", "decodebytes",
# Generalized interface for other encodings
- 'b64encode', 'b64decode', 'b32encode', 'b32decode',
- 'b32hexencode', 'b32hexdecode', 'b16encode', 'b16decode',
+ "b64encode", "b64decode", "b32encode", "b32decode",
+ "b32hexencode", "b32hexdecode", "b16encode", "b16decode",
# Base85 and Ascii85 encodings
- 'b85encode', 'b85decode', 'a85encode', 'a85decode',
+ "b85encode", "b85decode", "a85encode", "a85decode",
# Standard Base64 encoding
- 'standard_b64encode', 'standard_b64decode',
+ "standard_b64encode", "standard_b64decode",
# Some common Base64 alternatives. As referenced by RFC 3458, see thread
# starting at:
#
# http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html
- 'urlsafe_b64encode', 'urlsafe_b64decode',
+ "urlsafe_b64encode", "urlsafe_b64decode",
]
@@ -34,9 +34,9 @@
def _bytes_from_decode_data(s):
if isinstance(s, str):
try:
- return s.encode('ascii')
+ return s.encode("ascii")
except UnicodeEncodeError:
- raise ValueError('string argument should contain only ASCII characters')
+ raise ValueError("string argument should contain only ASCII characters")
if isinstance(s, bytes_types):
return s
try:
@@ -58,7 +58,7 @@ def b64encode(s, altchars=None):
encoded = binascii.b2a_base64(s, newline=False)
if altchars is not None:
assert len(altchars) == 2, repr(altchars)
- return encoded.translate(bytes.maketrans(b'+/', altchars))
+ return encoded.translate(bytes.maketrans(b"+/", altchars))
return encoded
@@ -81,9 +81,9 @@ def b64decode(s, altchars=None, validate=False):
if altchars is not None:
altchars = _bytes_from_decode_data(altchars)
assert len(altchars) == 2, repr(altchars)
- s = s.translate(bytes.maketrans(altchars, b'+/'))
- if validate and not re.fullmatch(b'[A-Za-z0-9+/]*={0,2}', s):
- raise binascii.Error('Non-base64 digit found')
+ s = s.translate(bytes.maketrans(altchars, b"+/"))
+ if validate and not re.fullmatch(b"[A-Za-z0-9+/]*={0,2}", s):
+ raise binascii.Error("Non-base64 digit found")
return binascii.a2b_base64(s)
@@ -105,8 +105,8 @@ def standard_b64decode(s):
return b64decode(s)
-_urlsafe_encode_translation = bytes.maketrans(b'+/', b'-_')
-_urlsafe_decode_translation = bytes.maketrans(b'-_', b'+/')
+_urlsafe_encode_translation = bytes.maketrans(b"+/", b"-_")
+_urlsafe_decode_translation = bytes.maketrans(b"-_", b"+/")
def urlsafe_b64encode(s):
"""Encode bytes using the URL- and filesystem-safe Base64 alphabet.
@@ -135,10 +135,10 @@ def urlsafe_b64decode(s):
# Base32 encoding/decoding must be done in Python
-_B32_ENCODE_DOCSTRING = '''
+_B32_ENCODE_DOCSTRING = """
Encode the bytes-like objects using {encoding} and return a bytes object.
-'''
-_B32_DECODE_DOCSTRING = '''
+"""
+_B32_DECODE_DOCSTRING = """
Decode the {encoding} encoded bytes-like object or ASCII string s.
Optional casefold is a flag specifying whether a lowercase alphabet is
@@ -147,8 +147,8 @@ def urlsafe_b64decode(s):
The result is returned as a bytes object. A binascii.Error is raised if
the input is incorrectly padded or if there are non-alphabet
characters present in the input.
-'''
-_B32_DECODE_MAP01_DOCSTRING = '''
+"""
+_B32_DECODE_MAP01_DOCSTRING = """
RFC 3548 allows for optional mapping of the digit 0 (zero) to the
letter O (oh), and for optional mapping of the digit 1 (one) to
either the letter I (eye) or letter L (el). The optional argument
@@ -156,9 +156,9 @@ def urlsafe_b64decode(s):
mapped to (when map01 is not None, the digit 0 is always mapped to
the letter O). For security purposes the default is None, so that
0 and 1 are not allowed in the input.
-'''
-_b32alphabet = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
-_b32hexalphabet = b'0123456789ABCDEFGHIJKLMNOPQRSTUV'
+"""
+_b32alphabet = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"
+_b32hexalphabet = b"0123456789ABCDEFGHIJKLMNOPQRSTUV"
_b32tab2 = {}
_b32rev = {}
@@ -176,12 +176,12 @@ def _b32encode(alphabet, s):
leftover = len(s) % 5
# Pad the last quantum with zero bits if necessary
if leftover:
- s = s + b'\0' * (5 - leftover) # Don't use += !
+ s = s + b"\0" * (5 - leftover) # Don't use += !
encoded = bytearray()
from_bytes = int.from_bytes
b32tab2 = _b32tab2[alphabet]
for i in range(0, len(s), 5):
- c = from_bytes(s[i: i + 5], 'big')
+ c = from_bytes(s[i: i + 5], "big")
encoded += (b32tab2[c >> 30] + # bits 1 - 10
b32tab2[(c >> 20) & 0x3ff] + # bits 11 - 20
b32tab2[(c >> 10) & 0x3ff] + # bits 21 - 30
@@ -189,13 +189,13 @@ def _b32encode(alphabet, s):
)
# Adjust for any leftover partial quanta
if leftover == 1:
- encoded[-6:] = b'======'
+ encoded[-6:] = b"======"
elif leftover == 2:
- encoded[-4:] = b'===='
+ encoded[-4:] = b"===="
elif leftover == 3:
- encoded[-3:] = b'==='
+ encoded[-3:] = b"==="
elif leftover == 4:
- encoded[-1:] = b'='
+ encoded[-1:] = b"="
return bytes(encoded)
def _b32decode(alphabet, s, casefold=False, map01=None):
@@ -206,21 +206,21 @@ def _b32decode(alphabet, s, casefold=False, map01=None):
_b32rev[alphabet] = {v: k for k, v in enumerate(alphabet)}
s = _bytes_from_decode_data(s)
if len(s) % 8:
- raise binascii.Error('Incorrect padding')
+ raise binascii.Error("Incorrect padding")
# Handle section 2.4 zero and one mapping. The flag map01 will be either
# False, or the character to map the digit 1 (one) to. It should be
# either L (el) or I (eye).
if map01 is not None:
map01 = _bytes_from_decode_data(map01)
assert len(map01) == 1, repr(map01)
- s = s.translate(bytes.maketrans(b'01', b'O' + map01))
+ s = s.translate(bytes.maketrans(b"01", b"O" + map01))
if casefold:
s = s.upper()
# Strip off pad characters from the right. We need to count the pad
# characters because this will tell us how many null bytes to remove from
# the end of the decoded string.
l = len(s)
- s = s.rstrip(b'=')
+ s = s.rstrip(b"=")
padchars = l - len(s)
# Now decode the full quanta
decoded = bytearray()
@@ -232,14 +232,14 @@ def _b32decode(alphabet, s, casefold=False, map01=None):
for c in quanta:
acc = (acc << 5) + b32rev[c]
except KeyError:
- raise binascii.Error('Non-base32 digit found') from None
- decoded += acc.to_bytes(5, 'big')
+ raise binascii.Error("Non-base32 digit found") from None
+ decoded += acc.to_bytes(5, "big")
# Process the last, partial quanta
if l % 8 or padchars not in {0, 1, 3, 4, 6}:
- raise binascii.Error('Incorrect padding')
+ raise binascii.Error("Incorrect padding")
if padchars and decoded:
acc <<= 5 * padchars
- last = acc.to_bytes(5, 'big')
+ last = acc.to_bytes(5, "big")
leftover = (43 - 5 * padchars) // 8 # 1: 4, 3: 3, 4: 2, 6: 1
decoded[-5:] = last[:leftover]
return bytes(decoded)
@@ -247,22 +247,22 @@ def _b32decode(alphabet, s, casefold=False, map01=None):
def b32encode(s):
return _b32encode(_b32alphabet, s)
-b32encode.__doc__ = _B32_ENCODE_DOCSTRING.format(encoding='base32')
+b32encode.__doc__ = _B32_ENCODE_DOCSTRING.format(encoding="base32")
def b32decode(s, casefold=False, map01=None):
return _b32decode(_b32alphabet, s, casefold, map01)
-b32decode.__doc__ = _B32_DECODE_DOCSTRING.format(encoding='base32',
+b32decode.__doc__ = _B32_DECODE_DOCSTRING.format(encoding="base32",
extra_args=_B32_DECODE_MAP01_DOCSTRING)
def b32hexencode(s):
return _b32encode(_b32hexalphabet, s)
-b32hexencode.__doc__ = _B32_ENCODE_DOCSTRING.format(encoding='base32hex')
+b32hexencode.__doc__ = _B32_ENCODE_DOCSTRING.format(encoding="base32hex")
def b32hexdecode(s, casefold=False):
# base32hex does not have the 01 mapping
return _b32decode(_b32hexalphabet, s, casefold)
-b32hexdecode.__doc__ = _B32_DECODE_DOCSTRING.format(encoding='base32hex',
- extra_args='')
+b32hexdecode.__doc__ = _B32_DECODE_DOCSTRING.format(encoding="base32hex",
+ extra_args="")
# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns
@@ -287,8 +287,8 @@ def b16decode(s, casefold=False):
s = _bytes_from_decode_data(s)
if casefold:
s = s.upper()
- if re.search(b'[^0-9A-F]', s):
- raise binascii.Error('Non-base16 digit found')
+ if re.search(b"[^0-9A-F]", s):
+ raise binascii.Error("Non-base16 digit found")
return binascii.unhexlify(s)
#
@@ -307,22 +307,22 @@ def _85encode(b, chars, chars2, pad=False, foldnuls=False, foldspaces=False):
padding = (-len(b)) % 4
if padding:
- b = b + b'\0' * padding
- words = struct.Struct('!%dI' % (len(b) // 4)).unpack(b)
+ b = b + b"\0" * padding
+ words = struct.Struct("!%dI" % (len(b) // 4)).unpack(b)
- chunks = [b'z' if foldnuls and not word else
- b'y' if foldspaces and word == 0x20202020 else
+ chunks = [b"z" if foldnuls and not word else
+ b"y" if foldspaces and word == 0x20202020 else
(chars2[word // 614125] +
chars2[word // 85 % 7225] +
chars[word % 85])
for word in words]
if padding and not pad:
- if chunks[-1] == b'z':
+ if chunks[-1] == b"z":
chunks[-1] = chars[0] * 5
chunks[-1] = chunks[-1][:-padding]
- return b''.join(chunks)
+ return b"".join(chunks)
def a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False):
"""Encode bytes-like object b using Ascii85 and return a bytes object.
@@ -358,14 +358,14 @@ def a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False):
for i in range(0, len(result), wrapcol)]
if adobe:
if len(chunks[-1]) + 2 > wrapcol:
- chunks.append(b'')
- result = b'\n'.join(chunks)
+ chunks.append(b"")
+ result = b"\n".join(chunks)
if adobe:
result += _A85END
return result
-def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
+def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b" \t\n\r\v"):
"""Decode the Ascii85 encoded bytes-like object or ASCII string b.
foldspaces is a flag that specifies whether the 'y' short sequence should be
@@ -396,14 +396,14 @@ def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
# We have to go through this stepwise, so as to ignore spaces and handle
# special short sequences
#
- packI = struct.Struct('!I').pack
+ packI = struct.Struct("!I").pack
decoded = []
decoded_append = decoded.append
curr = []
curr_append = curr.append
curr_clear = curr.clear
- for x in b + b'u' * 4:
- if b'!'[0] <= x <= b'u'[0]:
+ for x in b + b"u" * 4:
+ if b"!"[0] <= x <= b"u"[0]:
curr_append(x)
if len(curr) == 5:
acc = 0
@@ -412,23 +412,23 @@ def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
try:
decoded_append(packI(acc))
except struct.error:
- raise ValueError('Ascii85 overflow') from None
+ raise ValueError("Ascii85 overflow") from None
curr_clear()
- elif x == b'z'[0]:
+ elif x == b"z"[0]:
if curr:
- raise ValueError('z inside Ascii85 5-tuple')
- decoded_append(b'\0\0\0\0')
- elif foldspaces and x == b'y'[0]:
+ raise ValueError("z inside Ascii85 5-tuple")
+ decoded_append(b"\0\0\0\0")
+ elif foldspaces and x == b"y"[0]:
if curr:
- raise ValueError('y inside Ascii85 5-tuple')
- decoded_append(b'\x20\x20\x20\x20')
+ raise ValueError("y inside Ascii85 5-tuple")
+ decoded_append(b"\x20\x20\x20\x20")
elif x in ignorechars:
# Skip whitespace
continue
else:
- raise ValueError('Non-Ascii85 digit found: %c' % x)
+ raise ValueError("Non-Ascii85 digit found: %c" % x)
- result = b''.join(decoded)
+ result = b"".join(decoded)
padding = 4 - len(curr)
if padding:
# Throw away the extra padding
@@ -472,9 +472,9 @@ def b85decode(b):
b = _bytes_from_decode_data(b)
padding = (-len(b)) % 5
- b = b + b'~' * padding
+ b = b + b"~" * padding
out = []
- packI = struct.Struct('!I').pack
+ packI = struct.Struct("!I").pack
for i in range(0, len(b), 5):
chunk = b[i:i + 5]
acc = 0
@@ -484,16 +484,16 @@ def b85decode(b):
except TypeError:
for j, c in enumerate(chunk):
if _b85dec[c] is None:
- raise ValueError('bad base85 character at position %d'
+ raise ValueError("bad base85 character at position %d"
% (i + j)) from None
raise
try:
out.append(packI(acc))
except struct.error:
- raise ValueError('base85 overflow in hunk starting at byte %d'
+ raise ValueError("base85 overflow in hunk starting at byte %d"
% i) from None
- result = b''.join(out)
+ result = b"".join(out)
if padding:
result = result[:-padding]
return result
@@ -535,7 +535,7 @@ def _input_type_check(s):
except TypeError as err:
msg = "expected bytes-like object, not %s" % s.__class__.__name__
raise TypeError(msg) from err
- if m.format not in ('c', 'b', 'B'):
+ if m.format not in ("c", "b", "B"):
msg = ("expected single byte elements, not %r from %s" %
(m.format, s.__class__.__name__))
raise TypeError(msg)
@@ -565,9 +565,10 @@ def decodebytes(s):
# Usable as a script...
def main():
"""Small main program"""
- import sys, getopt
+ import sys
+ import getopt
try:
- opts, args = getopt.getopt(sys.argv[1:], 'deut')
+ opts, args = getopt.getopt(sys.argv[1:], "deut")
except getopt.error as msg:
sys.stdout = sys.stderr
print(msg)
@@ -578,12 +579,12 @@ def main():
sys.exit(2)
func = encode
for o, a in opts:
- if o == '-e': func = encode
- if o == '-d': func = decode
- if o == '-u': func = decode
- if o == '-t': test(); return
- if args and args[0] != '-':
- with open(args[0], 'rb') as f:
+ if o == "-e": func = encode
+ if o == "-d": func = decode
+ if o == "-u": func = decode
+ if o == "-t": test(); return
+ if args and args[0] != "-":
+ with open(args[0], "rb") as f:
func(f, sys.stdout.buffer)
else:
func(sys.stdin.buffer, sys.stdout.buffer)
@@ -599,5 +600,5 @@ def test():
assert s0 == s2
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/.venv3.10/Lib/bdb.py b/.venv3.10/Lib/bdb.py
index 7f9b0951..f23300b3 100644
--- a/.venv3.10/Lib/bdb.py
+++ b/.venv3.10/Lib/bdb.py
@@ -86,21 +86,21 @@ def trace_dispatch(self, frame, event, arg):
"""
if self.quitting:
return # None
- if event == 'line':
+ if event == "line":
return self.dispatch_line(frame)
- if event == 'call':
+ if event == "call":
return self.dispatch_call(frame, arg)
- if event == 'return':
+ if event == "return":
return self.dispatch_return(frame, arg)
- if event == 'exception':
+ if event == "exception":
return self.dispatch_exception(frame, arg)
- if event == 'c_call':
+ if event == "c_call":
return self.trace_dispatch
- if event == 'c_exception':
+ if event == "c_exception":
return self.trace_dispatch
- if event == 'c_return':
+ if event == "c_return":
return self.trace_dispatch
- print('bdb.Bdb.dispatch: unknown debugging event:', repr(event))
+ print("bdb.Bdb.dispatch: unknown debugging event:", repr(event))
return self.trace_dispatch
def dispatch_line(self, frame):
@@ -204,7 +204,7 @@ def stop_here(self, frame):
# (CT) stopframe may now also be None, see dispatch_call.
# (CT) the former test for None is therefore removed from here.
if self.skip and \
- self.is_skipped_module(frame.f_globals.get('__name__')):
+ self.is_skipped_module(frame.f_globals.get("__name__")):
return False
if frame is self.stopframe:
if self.stoplineno == -1:
@@ -384,7 +384,7 @@ def set_break(self, filename, lineno, temporary=False, cond=None,
import linecache # Import as late as possible
line = linecache.getline(filename, lineno)
if not line:
- return 'Line %s:%d does not exist' % (filename, lineno)
+ return "Line %s:%d does not exist" % (filename, lineno)
self._add_to_breaks(filename, lineno)
bp = Breakpoint(filename, lineno, temporary, cond, funcname)
return None
@@ -420,9 +420,9 @@ def clear_break(self, filename, lineno):
"""
filename = self.canonic(filename)
if filename not in self.breaks:
- return 'There are no breakpoints in %s' % filename
+ return "There are no breakpoints in %s" % filename
if lineno not in self.breaks[filename]:
- return 'There is no breakpoint at %s:%d' % (filename, lineno)
+ return "There is no breakpoint at %s:%d" % (filename, lineno)
# If there's only one bp in the list for that file,line
# pair, then remove the breaks entry
for bp in Breakpoint.bplist[filename, lineno][:]:
@@ -450,7 +450,7 @@ def clear_all_file_breaks(self, filename):
"""
filename = self.canonic(filename)
if filename not in self.breaks:
- return 'There are no breakpoints in %s' % filename
+ return "There are no breakpoints in %s" % filename
for line in self.breaks[filename]:
blist = Breakpoint.bplist[filename, line]
for bp in blist:
@@ -464,7 +464,7 @@ def clear_all_breaks(self):
If none were set, return an error message.
"""
if not self.breaks:
- return 'There are no breakpoints'
+ return "There are no breakpoints"
for bp in Breakpoint.bpbynumber:
if bp:
bp.deleteMe()
@@ -478,17 +478,17 @@ def get_bpbynumber(self, arg):
raise a ValueError.
"""
if not arg:
- raise ValueError('Breakpoint number expected')
+ raise ValueError("Breakpoint number expected")
try:
number = int(arg)
except ValueError:
- raise ValueError('Non-numeric breakpoint number %s' % arg) from None
+ raise ValueError("Non-numeric breakpoint number %s" % arg) from None
try:
bp = Breakpoint.bpbynumber[number]
except IndexError:
- raise ValueError('Breakpoint number %d out of range' % number) from None
+ raise ValueError("Breakpoint number %d out of range" % number) from None
if bp is None:
- raise ValueError('Breakpoint %d already deleted' % number)
+ raise ValueError("Breakpoint %d already deleted" % number)
return bp
def get_break(self, filename, lineno):
@@ -548,7 +548,7 @@ def get_stack(self, f, t):
i = max(0, len(stack) - 1)
return stack, i
- def format_stack_entry(self, frame_lineno, lprefix=': '):
+ def format_stack_entry(self, frame_lineno, lprefix=": "):
"""Return a string with information about a stack entry.
The stack entry frame_lineno is a (frame, lineno) tuple. The
@@ -557,18 +557,19 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
line of code (if it exists).
"""
- import linecache, reprlib
+ import linecache
+ import reprlib
frame, lineno = frame_lineno
filename = self.canonic(frame.f_code.co_filename)
- s = '%s(%r)' % (filename, lineno)
+ s = "%s(%r)" % (filename, lineno)
if frame.f_code.co_name:
s += frame.f_code.co_name
else:
s += ""
- s += '()'
- if '__return__' in frame.f_locals:
- rv = frame.f_locals['__return__']
- s += '->'
+ s += "()"
+ if "__return__" in frame.f_locals:
+ rv = frame.f_locals["__return__"]
+ s += "->"
s += reprlib.repr(rv)
if lineno is not None:
line = linecache.getline(filename, lineno, frame.f_globals)
@@ -746,30 +747,30 @@ def bpformat(self):
"""
if self.temporary:
- disp = 'del '
+ disp = "del "
else:
- disp = 'keep '
+ disp = "keep "
if self.enabled:
- disp = disp + 'yes '
+ disp = disp + "yes "
else:
- disp = disp + 'no '
- ret = '%-4dbreakpoint %s at %s:%d' % (self.number, disp,
+ disp = disp + "no "
+ ret = "%-4dbreakpoint %s at %s:%d" % (self.number, disp,
self.file, self.line)
if self.cond:
- ret += '\n\tstop only if %s' % (self.cond,)
+ ret += "\n\tstop only if %s" % (self.cond,)
if self.ignore:
- ret += '\n\tignore next %d hits' % (self.ignore,)
+ ret += "\n\tignore next %d hits" % (self.ignore,)
if self.hits:
if self.hits > 1:
- ss = 's'
+ ss = "s"
else:
- ss = ''
- ret += '\n\tbreakpoint already hit %d time%s' % (self.hits, ss)
+ ss = ""
+ ret += "\n\tbreakpoint already hit %d time%s" % (self.hits, ss)
return ret
def __str__(self):
"Return a condensed description of the breakpoint."
- return 'breakpoint %s at %s:%s' % (self.number, self.file, self.line)
+ return "breakpoint %s at %s:%s" % (self.number, self.file, self.line)
# -----------end of Breakpoint class----------
@@ -862,30 +863,30 @@ def effective(file, line, frame):
class Tdb(Bdb):
def user_call(self, frame, args):
name = frame.f_code.co_name
- if not name: name = '???'
- print('+++ call', name, args)
+ if not name: name = "???"
+ print("+++ call", name, args)
def user_line(self, frame):
import linecache
name = frame.f_code.co_name
- if not name: name = '???'
+ if not name: name = "???"
fn = self.canonic(frame.f_code.co_filename)
line = linecache.getline(fn, frame.f_lineno, frame.f_globals)
- print('+++', fn, frame.f_lineno, name, ':', line.strip())
+ print("+++", fn, frame.f_lineno, name, ":", line.strip())
def user_return(self, frame, retval):
- print('+++ return', retval)
+ print("+++ return", retval)
def user_exception(self, frame, exc_stuff):
- print('+++ exception', exc_stuff)
+ print("+++ exception", exc_stuff)
self.set_continue()
def foo(n):
- print('foo(', n, ')')
+ print("foo(", n, ")")
x = bar(n*10)
- print('bar returned', x)
+ print("bar returned", x)
def bar(a):
- print('bar(', a, ')')
+ print("bar(", a, ")")
return a/2
def test():
t = Tdb()
- t.run('import bdb; bdb.foo(10)')
+ t.run("import bdb; bdb.foo(10)")
diff --git a/.venv3.10/Lib/binhex.py b/.venv3.10/Lib/binhex.py
index ace5217d..034a2d75 100644
--- a/.venv3.10/Lib/binhex.py
+++ b/.venv3.10/Lib/binhex.py
@@ -28,7 +28,7 @@
import struct
import warnings
-warnings.warn('the binhex module is deprecated', DeprecationWarning,
+warnings.warn("the binhex module is deprecated", DeprecationWarning,
stacklevel=2)
@@ -52,21 +52,21 @@ class Error(Exception):
class FInfo:
def __init__(self):
- self.Type = '????'
- self.Creator = '????'
+ self.Type = "????"
+ self.Creator = "????"
self.Flags = 0
def getfileinfo(name):
finfo = FInfo()
- with io.open(name, 'rb') as fp:
+ with io.open(name, "rb") as fp:
# Quick check for textfile
data = fp.read(512)
if 0 not in data:
- finfo.Type = 'TEXT'
+ finfo.Type = "TEXT"
fp.seek(0, 2)
dsize = fp.tell()
dir, file = os.path.split(name)
- file = file.replace(':', '-', 1)
+ file = file.replace(":", "-", 1)
return file, finfo, dsize, 0
class openrsrc:
@@ -74,7 +74,7 @@ def __init__(self, *args):
pass
def read(self, *args):
- return b''
+ return b""
def write(self, *args):
pass
@@ -88,7 +88,7 @@ def close(self):
@contextlib.contextmanager
def _ignore_deprecation_warning():
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', '', DeprecationWarning)
+ warnings.filterwarnings("ignore", "", DeprecationWarning)
yield
@@ -97,8 +97,8 @@ class _Hqxcoderengine:
def __init__(self, ofp):
self.ofp = ofp
- self.data = b''
- self.hqxdata = b''
+ self.data = b""
+ self.hqxdata = b""
self.linelen = LINELEN - 1
def write(self, data):
@@ -117,12 +117,12 @@ def _flush(self, force):
first = 0
while first <= len(self.hqxdata) - self.linelen:
last = first + self.linelen
- self.ofp.write(self.hqxdata[first:last] + b'\r')
+ self.ofp.write(self.hqxdata[first:last] + b"\r")
self.linelen = LINELEN
first = last
self.hqxdata = self.hqxdata[first:]
if force:
- self.ofp.write(self.hqxdata + b':\r')
+ self.ofp.write(self.hqxdata + b":\r")
def close(self):
if self.data:
@@ -137,7 +137,7 @@ class _Rlecoderengine:
def __init__(self, ofp):
self.ofp = ofp
- self.data = b''
+ self.data = b""
def write(self, data):
self.data = self.data + data
@@ -146,7 +146,7 @@ def write(self, data):
with _ignore_deprecation_warning():
rledata = binascii.rlecode_hqx(self.data)
self.ofp.write(rledata)
- self.data = b''
+ self.data = b""
def close(self):
if self.data:
@@ -162,10 +162,10 @@ def __init__(self, name_finfo_dlen_rlen, ofp):
close_on_error = False
if isinstance(ofp, str):
ofname = ofp
- ofp = io.open(ofname, 'wb')
+ ofp = io.open(ofname, "wb")
close_on_error = True
try:
- ofp.write(b'(This file must be converted with BinHex 4.0)\r\r:')
+ ofp.write(b"(This file must be converted with BinHex 4.0)\r\r:")
hqxer = _Hqxcoderengine(ofp)
self.ofp = _Rlecoderengine(hqxer)
self.crc = 0
@@ -183,8 +183,8 @@ def __init__(self, name_finfo_dlen_rlen, ofp):
def _writeinfo(self, name, finfo):
nl = len(name)
if nl > 63:
- raise Error('Filename too long')
- d = bytes([nl]) + name.encode("latin-1") + b'\0'
+ raise Error("Filename too long")
+ d = bytes([nl]) + name.encode("latin-1") + b"\0"
tp, cr = finfo.Type, finfo.Creator
if isinstance(tp, str):
tp = tp.encode("latin-1")
@@ -193,8 +193,8 @@ def _writeinfo(self, name, finfo):
d2 = tp + cr
# Force all structs to be packed with big-endian
- d3 = struct.pack('>h', finfo.Flags)
- d4 = struct.pack('>ii', self.dlen, self.rlen)
+ d3 = struct.pack(">h", finfo.Flags)
+ d4 = struct.pack(">ii", self.dlen, self.rlen)
info = d + d2 + d3 + d4
self._write(info)
self._writecrc()
@@ -207,21 +207,21 @@ def _writecrc(self):
# XXXX Should this be here??
# self.crc = binascii.crc_hqx('\0\0', self.crc)
if self.crc < 0:
- fmt = '>h'
+ fmt = ">h"
else:
- fmt = '>H'
+ fmt = ">H"
self.ofp.write(struct.pack(fmt, self.crc))
self.crc = 0
def write(self, data):
if self.state != _DID_HEADER:
- raise Error('Writing data at the wrong time')
+ raise Error("Writing data at the wrong time")
self.dlen = self.dlen - len(data)
self._write(data)
def close_data(self):
if self.dlen != 0:
- raise Error('Incorrect data size, diff=%r' % (self.rlen,))
+ raise Error("Incorrect data size, diff=%r" % (self.rlen,))
self._writecrc()
self.state = _DID_DATA
@@ -229,7 +229,7 @@ def write_rsrc(self, data):
if self.state < _DID_DATA:
self.close_data()
if self.state != _DID_DATA:
- raise Error('Writing resource data at the wrong time')
+ raise Error("Writing resource data at the wrong time")
self.rlen = self.rlen - len(data)
self._write(data)
@@ -240,7 +240,7 @@ def close(self):
if self.state < _DID_DATA:
self.close_data()
if self.state != _DID_DATA:
- raise Error('Close at the wrong time')
+ raise Error("Close at the wrong time")
if self.rlen != 0:
raise Error("Incorrect resource-datasize, diff=%r" % (self.rlen,))
self._writecrc()
@@ -255,7 +255,7 @@ def binhex(inp, out):
finfo = getfileinfo(inp)
ofp = BinHex(finfo, out)
- with io.open(inp, 'rb') as ifp:
+ with io.open(inp, "rb") as ifp:
# XXXX Do textfile translation on non-mac systems
while True:
d = ifp.read(128000)
@@ -263,7 +263,7 @@ def binhex(inp, out):
ofp.write(d)
ofp.close_data()
- ifp = openrsrc(inp, 'rb')
+ ifp = openrsrc(inp, "rb")
while True:
d = ifp.read(128000)
if not d: break
@@ -280,7 +280,7 @@ def __init__(self, ifp):
def read(self, totalwtd):
"""Read at least wtd bytes (or until EOF)"""
- decdata = b''
+ decdata = b""
wtd = totalwtd
#
# The loop here is convoluted, since we don't really now how
@@ -303,12 +303,12 @@ def read(self, totalwtd):
pass
newdata = self.ifp.read(1)
if not newdata:
- raise Error('Premature EOF on binhex file')
+ raise Error("Premature EOF on binhex file")
data = data + newdata
decdata = decdata + decdatacur
wtd = totalwtd - len(decdata)
if not decdata and not self.eof:
- raise Error('Premature EOF on binhex file')
+ raise Error("Premature EOF on binhex file")
return decdata
def close(self):
@@ -319,8 +319,8 @@ class _Rledecoderengine:
def __init__(self, ifp):
self.ifp = ifp
- self.pre_buffer = b''
- self.post_buffer = b''
+ self.pre_buffer = b""
+ self.post_buffer = b""
self.eof = 0
def read(self, wtd):
@@ -336,7 +336,7 @@ def _fill(self, wtd):
with _ignore_deprecation_warning():
self.post_buffer = self.post_buffer + \
binascii.rledecode_hqx(self.pre_buffer)
- self.pre_buffer = b''
+ self.pre_buffer = b""
return
#
@@ -351,11 +351,11 @@ def _fill(self, wtd):
# otherwise: keep 1 byte.
#
mark = len(self.pre_buffer)
- if self.pre_buffer[-3:] == RUNCHAR + b'\0' + RUNCHAR:
+ if self.pre_buffer[-3:] == RUNCHAR + b"\0" + RUNCHAR:
mark = mark - 3
elif self.pre_buffer[-1:] == RUNCHAR:
mark = mark - 2
- elif self.pre_buffer[-2:] == RUNCHAR + b'\0':
+ elif self.pre_buffer[-2:] == RUNCHAR + b"\0":
mark = mark - 2
elif self.pre_buffer[-2:-1] == RUNCHAR:
pass # Decode all
@@ -373,7 +373,7 @@ def close(self):
class HexBin:
def __init__(self, ifp):
if isinstance(ifp, str):
- ifp = io.open(ifp, 'rb')
+ ifp = io.open(ifp, "rb")
#
# Find initial colon.
#
@@ -383,9 +383,9 @@ def __init__(self, ifp):
raise Error("No binhex data found")
# Cater for \r\n terminated lines (which show up as \n\r, hence
# all lines start with \r)
- if ch == b'\r':
+ if ch == b"\r":
continue
- if ch == b':':
+ if ch == b":":
break
hqxifp = _Hqxdecoderengine(ifp)
@@ -399,12 +399,12 @@ def _read(self, len):
return data
def _checkcrc(self):
- filecrc = struct.unpack('>h', self.ifp.read(2))[0] & 0xffff
+ filecrc = struct.unpack(">h", self.ifp.read(2))[0] & 0xffff
#self.crc = binascii.crc_hqx('\0\0', self.crc)
# XXXX Is this needed??
self.crc = self.crc & 0xffff
if filecrc != self.crc:
- raise Error('CRC error, computed %x, read %x'
+ raise Error("CRC error, computed %x, read %x"
% (self.crc, filecrc))
self.crc = 0
@@ -416,9 +416,9 @@ def _readheader(self):
type = rest[1:5]
creator = rest[5:9]
- flags = struct.unpack('>h', rest[9:11])[0]
- self.dlen = struct.unpack('>l', rest[11:15])[0]
- self.rlen = struct.unpack('>l', rest[15:19])[0]
+ flags = struct.unpack(">h", rest[9:11])[0]
+ self.dlen = struct.unpack(">l", rest[11:15])[0]
+ self.rlen = struct.unpack(">l", rest[15:19])[0]
self.FName = fname
self.FInfo = FInfo()
@@ -430,13 +430,13 @@ def _readheader(self):
def read(self, *n):
if self.state != _DID_HEADER:
- raise Error('Read data at wrong time')
+ raise Error("Read data at wrong time")
if n:
n = n[0]
n = min(n, self.dlen)
else:
n = self.dlen
- rv = b''
+ rv = b""
while len(rv) < n:
rv = rv + self._read(n-len(rv))
self.dlen = self.dlen - n
@@ -444,7 +444,7 @@ def read(self, *n):
def close_data(self):
if self.state != _DID_HEADER:
- raise Error('close_data at wrong time')
+ raise Error("close_data at wrong time")
if self.dlen:
dummy = self._read(self.dlen)
self._checkcrc()
@@ -454,7 +454,7 @@ def read_rsrc(self, *n):
if self.state == _DID_HEADER:
self.close_data()
if self.state != _DID_DATA:
- raise Error('Read resource data at wrong time')
+ raise Error("Read resource data at wrong time")
if n:
n = n[0]
n = min(n, self.rlen)
@@ -481,7 +481,7 @@ def hexbin(inp, out):
if not out:
out = ifp.FName
- with io.open(out, 'wb') as ofp:
+ with io.open(out, "wb") as ofp:
# XXXX Do translation on non-mac systems
while True:
d = ifp.read(128000)
@@ -491,7 +491,7 @@ def hexbin(inp, out):
d = ifp.read_rsrc(128000)
if d:
- ofp = openrsrc(out, 'wb')
+ ofp = openrsrc(out, "wb")
ofp.write(d)
while True:
d = ifp.read_rsrc(128000)
diff --git a/.venv3.10/Lib/bisect.py b/.venv3.10/Lib/bisect.py
index d37da74f..0a8ef2f5 100644
--- a/.venv3.10/Lib/bisect.py
+++ b/.venv3.10/Lib/bisect.py
@@ -28,7 +28,7 @@ def bisect_right(a, x, lo=0, hi=None, *, key=None):
"""
if lo < 0:
- raise ValueError('lo must be non-negative')
+ raise ValueError("lo must be non-negative")
if hi is None:
hi = len(a)
# Note, the comparison uses "<" to match the
@@ -77,7 +77,7 @@ def bisect_left(a, x, lo=0, hi=None, *, key=None):
"""
if lo < 0:
- raise ValueError('lo must be non-negative')
+ raise ValueError("lo must be non-negative")
if hi is None:
hi = len(a)
# Note, the comparison uses "<" to match the
diff --git a/.venv3.10/Lib/cProfile.py b/.venv3.10/Lib/cProfile.py
index 9ae1fb88..507afa75 100644
--- a/.venv3.10/Lib/cProfile.py
+++ b/.venv3.10/Lib/cProfile.py
@@ -44,7 +44,7 @@ def print_stats(self, sort=-1):
def dump_stats(self, file):
import marshal
- with open(file, 'wb') as f:
+ with open(file, "wb") as f:
self.create_stats()
marshal.dump(self.stats, f)
@@ -122,7 +122,7 @@ def __exit__(self, *exc_info):
def label(code):
if isinstance(code, str):
- return ('~', 0, code) # built-in functions ('~' sorts at the end)
+ return ("~", 0, code) # built-in functions ('~' sorts at the end)
else:
return (code.co_filename, code.co_firstlineno, code.co_name)
@@ -137,13 +137,13 @@ def main():
usage = "cProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ..."
parser = OptionParser(usage=usage)
parser.allow_interspersed_args = False
- parser.add_option('-o', '--outfile', dest="outfile",
+ parser.add_option("-o", "--outfile", dest="outfile",
help="Save stats to ", default=None)
- parser.add_option('-s', '--sort', dest="sort",
+ parser.add_option("-s", "--sort", dest="sort",
help="Sort order when printing to stdout, based on pstats.Stats class",
default=-1,
choices=sorted(pstats.Stats.sort_arg_dict_default))
- parser.add_option('-m', dest="module", action="store_true",
+ parser.add_option("-m", dest="module", action="store_true",
help="Profile a library module", default=False)
if not sys.argv[1:]:
@@ -162,19 +162,19 @@ def main():
if options.module:
code = "run_module(modname, run_name='__main__')"
globs = {
- 'run_module': runpy.run_module,
- 'modname': args[0]
+ "run_module": runpy.run_module,
+ "modname": args[0]
}
else:
progname = args[0]
sys.path.insert(0, os.path.dirname(progname))
with io.open_code(progname) as fp:
- code = compile(fp.read(), progname, 'exec')
+ code = compile(fp.read(), progname, "exec")
globs = {
- '__file__': progname,
- '__name__': '__main__',
- '__package__': None,
- '__cached__': None,
+ "__file__": progname,
+ "__name__": "__main__",
+ "__package__": None,
+ "__cached__": None,
}
try:
runctx(code, globs, None, options.outfile, options.sort)
@@ -187,5 +187,5 @@ def main():
return parser
# When invoked as main program, invoke the profiler on a script
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/.venv3.10/Lib/calendar.py b/.venv3.10/Lib/calendar.py
index cbea9ec9..9cd3683d 100644
--- a/.venv3.10/Lib/calendar.py
+++ b/.venv3.10/Lib/calendar.py
@@ -88,12 +88,12 @@ def __len__(self):
# Full and abbreviated names of weekdays
-day_name = _localized_day('%A')
-day_abbr = _localized_day('%a')
+day_name = _localized_day("%A")
+day_abbr = _localized_day("%a")
# Full and abbreviated names of months (1-based arrays!!!)
-month_name = _localized_month('%B')
-month_abbr = _localized_month('%b')
+month_name = _localized_month("%B")
+month_abbr = _localized_month("%b")
# Constants for weekdays
(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) = range(7)
@@ -302,23 +302,23 @@ def prweek(self, theweek, width):
"""
Print a single week (no newline).
"""
- print(self.formatweek(theweek, width), end='')
+ print(self.formatweek(theweek, width), end="")
def formatday(self, day, weekday, width):
"""
Returns a formatted day.
"""
if day == 0:
- s = ''
+ s = ""
else:
- s = '%2i' % day # right-align single-digit days
+ s = "%2i" % day # right-align single-digit days
return s.center(width)
def formatweek(self, theweek, width):
"""
Returns a single week in a string (no newline).
"""
- return ' '.join(self.formatday(d, wd, width) for (d, wd) in theweek)
+ return " ".join(self.formatday(d, wd, width) for (d, wd) in theweek)
def formatweekday(self, day, width):
"""
@@ -334,7 +334,7 @@ def formatweekheader(self, width):
"""
Return a header for a week.
"""
- return ' '.join(self.formatweekday(i, width) for i in self.iterweekdays())
+ return " ".join(self.formatweekday(i, width) for i in self.iterweekdays())
def formatmonthname(self, theyear, themonth, width, withyear=True):
"""
@@ -349,7 +349,7 @@ def prmonth(self, theyear, themonth, w=0, l=0):
"""
Print a month's calendar.
"""
- print(self.formatmonth(theyear, themonth, w, l), end='')
+ print(self.formatmonth(theyear, themonth, w, l), end="")
def formatmonth(self, theyear, themonth, w=0, l=0):
"""
@@ -359,12 +359,12 @@ def formatmonth(self, theyear, themonth, w=0, l=0):
l = max(1, l)
s = self.formatmonthname(theyear, themonth, 7 * (w + 1) - 1)
s = s.rstrip()
- s += '\n' * l
+ s += "\n" * l
s += self.formatweekheader(w).rstrip()
- s += '\n' * l
+ s += "\n" * l
for week in self.monthdays2calendar(theyear, themonth):
s += self.formatweek(week, w).rstrip()
- s += '\n' * l
+ s += "\n" * l
return s
def formatyear(self, theyear, w=2, l=1, c=6, m=3):
@@ -378,35 +378,35 @@ def formatyear(self, theyear, w=2, l=1, c=6, m=3):
v = []
a = v.append
a(repr(theyear).center(colwidth*m+c*(m-1)).rstrip())
- a('\n'*l)
+ a("\n"*l)
header = self.formatweekheader(w)
for (i, row) in enumerate(self.yeardays2calendar(theyear, m)):
# months in this row
months = range(m*i+1, min(m*(i+1)+1, 13))
- a('\n'*l)
+ a("\n"*l)
names = (self.formatmonthname(theyear, k, colwidth, False)
for k in months)
a(formatstring(names, colwidth, c).rstrip())
- a('\n'*l)
+ a("\n"*l)
headers = (header for k in months)
a(formatstring(headers, colwidth, c).rstrip())
- a('\n'*l)
+ a("\n"*l)
# max number of weeks for this row
height = max(len(cal) for cal in row)
for j in range(height):
weeks = []
for cal in row:
if j >= len(cal):
- weeks.append('')
+ weeks.append("")
else:
weeks.append(self.formatweek(cal[j], w))
a(formatstring(weeks, colwidth, c).rstrip())
- a('\n' * l)
- return ''.join(v)
+ a("\n" * l)
+ return "".join(v)
def pryear(self, theyear, w=0, l=0, c=6, m=3):
"""Print a year's calendar."""
- print(self.formatyear(theyear, w, l, c, m), end='')
+ print(self.formatyear(theyear, w, l, c, m), end="")
class HTMLCalendar(Calendar):
@@ -449,8 +449,8 @@ def formatweek(self, theweek):
"""
Return a complete week as a table row.
"""
- s = ''.join(self.formatday(d, wd) for (d, wd) in theweek)
- return '
%s
' % s
+ s = "".join(self.formatday(d, wd) for (d, wd) in theweek)
+ return "
%s
" % s
def formatweekday(self, day):
"""
@@ -463,17 +463,17 @@ def formatweekheader(self):
"""
Return a header for a week as a table row.
"""
- s = ''.join(self.formatweekday(i) for i in self.iterweekdays())
- return '
%s
' % s
+ s = "".join(self.formatweekday(i) for i in self.iterweekdays())
+ return "
%s
" % s
def formatmonthname(self, theyear, themonth, withyear=True):
"""
Return a month name as a table row.
"""
if withyear:
- s = '%s %s' % (month_name[themonth], theyear)
+ s = "%s %s" % (month_name[themonth], theyear)
else:
- s = '%s' % month_name[themonth]
+ s = "%s" % month_name[themonth]
return '
' % (
width, self.cssclass_year_head, theyear))
for i in range(January, January+12, width):
# months in this row
months = range(i, min(i+width, 13))
- a('
')
+ a("
")
for m in months:
- a('
')
+ a("
")
a(self.formatmonth(theyear, m, withyear=False))
- a('
')
- a('
')
- a('
')
- return ''.join(v)
+ a("")
+ a("")
+ a("")
+ return "".join(v)
- def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
+ def formatyearpage(self, theyear, width=3, css="calendar.css", encoding=None):
"""
Return a formatted year as a complete HTML page.
"""
@@ -531,18 +531,18 @@ def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
a = v.append
a('\n' % encoding)
a('\n')
- a('\n')
- a('\n')
+ a("\n")
+ a("\n")
a('\n' % encoding)
if css is not None:
a('\n' % css)
- a('Calendar for %d\n' % theyear)
- a('\n')
- a('\n')
+ a("Calendar for %d\n" % theyear)
+ a("\n")
+ a("\n")
a(self.formatyear(theyear, width))
- a('\n')
- a('\n')
- return ''.join(v).encode(encoding, "xmlcharrefreplace")
+ a("\n")
+ a("\n")
+ return "".join(v).encode(encoding, "xmlcharrefreplace")
class different_locale:
@@ -633,7 +633,7 @@ def format(cols, colwidth=_colwidth, spacing=_spacing):
def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
"""Returns a string formatted from n strings, centered within n columns."""
- spacing *= ' '
+ spacing *= " "
return spacing.join(c.center(colwidth) for c in cols)
@@ -654,8 +654,8 @@ def timegm(tuple):
def main(args):
import argparse
parser = argparse.ArgumentParser()
- textgroup = parser.add_argument_group('text only arguments')
- htmlgroup = parser.add_argument_group('html only arguments')
+ textgroup = parser.add_argument_group("text only arguments")
+ htmlgroup = parser.add_argument_group("html only arguments")
textgroup.add_argument(
"-w", "--width",
type=int, default=2,
@@ -699,12 +699,12 @@ def main(args):
)
parser.add_argument(
"year",
- nargs='?', type=int,
+ nargs="?", type=int,
help="year number (1-9999)"
)
parser.add_argument(
"month",
- nargs='?', type=int,
+ nargs="?", type=int,
help="month number (1-12, text only)"
)
diff --git a/.venv3.10/Lib/cgi.py b/.venv3.10/Lib/cgi.py
index 6cb8cf28..895841d5 100644
--- a/.venv3.10/Lib/cgi.py
+++ b/.venv3.10/Lib/cgi.py
@@ -102,7 +102,7 @@ def nolog(*allargs):
def closelog():
"""Close the log file."""
global log, logfile, logfp
- logfile = ''
+ logfile = ""
if logfp:
logfp.close()
logfp = None
@@ -119,7 +119,7 @@ def closelog():
maxlen = 0
def parse(fp=None, environ=os.environ, keep_blank_values=0,
- strict_parsing=0, separator='&'):
+ strict_parsing=0, separator="&"):
"""Parse a query in the environment or from a file (default stdin)
Arguments, all optional:
@@ -147,48 +147,48 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0,
# field keys and values (except for files) are returned as strings
# an encoding is required to decode the bytes read from self.fp
- if hasattr(fp,'encoding'):
+ if hasattr(fp,"encoding"):
encoding = fp.encoding
else:
- encoding = 'latin-1'
+ encoding = "latin-1"
# fp.read() must return bytes
if isinstance(fp, TextIOWrapper):
fp = fp.buffer
- if not 'REQUEST_METHOD' in environ:
- environ['REQUEST_METHOD'] = 'GET' # For testing stand-alone
- if environ['REQUEST_METHOD'] == 'POST':
- ctype, pdict = parse_header(environ['CONTENT_TYPE'])
- if ctype == 'multipart/form-data':
+ if "REQUEST_METHOD" not in environ:
+ environ["REQUEST_METHOD"] = "GET" # For testing stand-alone
+ if environ["REQUEST_METHOD"] == "POST":
+ ctype, pdict = parse_header(environ["CONTENT_TYPE"])
+ if ctype == "multipart/form-data":
return parse_multipart(fp, pdict, separator=separator)
- elif ctype == 'application/x-www-form-urlencoded':
- clength = int(environ['CONTENT_LENGTH'])
+ elif ctype == "application/x-www-form-urlencoded":
+ clength = int(environ["CONTENT_LENGTH"])
if maxlen and clength > maxlen:
- raise ValueError('Maximum content length exceeded')
+ raise ValueError("Maximum content length exceeded")
qs = fp.read(clength).decode(encoding)
else:
- qs = '' # Unknown content-type
- if 'QUERY_STRING' in environ:
- if qs: qs = qs + '&'
- qs = qs + environ['QUERY_STRING']
+ qs = "" # Unknown content-type
+ if "QUERY_STRING" in environ:
+ if qs: qs = qs + "&"
+ qs = qs + environ["QUERY_STRING"]
elif sys.argv[1:]:
- if qs: qs = qs + '&'
+ if qs: qs = qs + "&"
qs = qs + sys.argv[1]
- environ['QUERY_STRING'] = qs # XXX Shouldn't, really
- elif 'QUERY_STRING' in environ:
- qs = environ['QUERY_STRING']
+ environ["QUERY_STRING"] = qs # XXX Shouldn't, really
+ elif "QUERY_STRING" in environ:
+ qs = environ["QUERY_STRING"]
else:
if sys.argv[1:]:
qs = sys.argv[1]
else:
qs = ""
- environ['QUERY_STRING'] = qs # XXX Shouldn't, really
+ environ["QUERY_STRING"] = qs # XXX Shouldn't, really
return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
encoding=encoding, separator=separator)
-def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'):
+def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator="&"):
"""Parse multipart input.
Arguments:
@@ -203,24 +203,24 @@ def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'
"""
# RFC 2046, Section 5.1 : The "multipart" boundary delimiters are always
# represented as 7bit US-ASCII.
- boundary = pdict['boundary'].decode('ascii')
+ boundary = pdict["boundary"].decode("ascii")
ctype = "multipart/form-data; boundary={}".format(boundary)
headers = Message()
headers.set_type(ctype)
try:
- headers['Content-Length'] = pdict['CONTENT-LENGTH']
+ headers["Content-Length"] = pdict["CONTENT-LENGTH"]
except KeyError:
pass
fs = FieldStorage(fp, headers=headers, encoding=encoding, errors=errors,
- environ={'REQUEST_METHOD': 'POST'}, separator=separator)
+ environ={"REQUEST_METHOD": "POST"}, separator=separator)
return {k: fs.getlist(k) for k in fs}
def _parseparam(s):
- while s[:1] == ';':
+ while s[:1] == ";":
s = s[1:]
- end = s.find(';')
+ end = s.find(";")
while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
- end = s.find(';', end + 1)
+ end = s.find(";", end + 1)
if end < 0:
end = len(s)
f = s[:end]
@@ -233,17 +233,17 @@ def parse_header(line):
Return the main content-type and a dictionary of options.
"""
- parts = _parseparam(';' + line)
+ parts = _parseparam(";" + line)
key = parts.__next__()
pdict = {}
for p in parts:
- i = p.find('=')
+ i = p.find("=")
if i >= 0:
name = p[:i].strip().lower()
value = p[i+1:].strip()
if len(value) >= 2 and value[0] == value[-1] == '"':
value = value[1:-1]
- value = value.replace('\\\\', '\\').replace('\\"', '"')
+ value = value.replace("\\\\", "\\").replace('\\"', '"')
pdict[name] = value
return key, pdict
@@ -319,10 +319,10 @@ class FieldStorage:
directory and unlinking them as soon as they have been opened.
"""
- def __init__(self, fp=None, headers=None, outerboundary=b'',
+ def __init__(self, fp=None, headers=None, outerboundary=b"",
environ=os.environ, keep_blank_values=0, strict_parsing=0,
- limit=None, encoding='utf-8', errors='replace',
- max_num_fields=None, separator='&'):
+ limit=None, encoding="utf-8", errors="replace",
+ max_num_fields=None, separator="&"):
"""Constructor. Read multipart/* until last part.
Arguments, all optional:
@@ -366,37 +366,37 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
if there are more than n fields read by parse_qsl().
"""
- method = 'GET'
+ method = "GET"
self.keep_blank_values = keep_blank_values
self.strict_parsing = strict_parsing
self.max_num_fields = max_num_fields
self.separator = separator
- if 'REQUEST_METHOD' in environ:
- method = environ['REQUEST_METHOD'].upper()
+ if "REQUEST_METHOD" in environ:
+ method = environ["REQUEST_METHOD"].upper()
self.qs_on_post = None
- if method == 'GET' or method == 'HEAD':
- if 'QUERY_STRING' in environ:
- qs = environ['QUERY_STRING']
+ if method == "GET" or method == "HEAD":
+ if "QUERY_STRING" in environ:
+ qs = environ["QUERY_STRING"]
elif sys.argv[1:]:
qs = sys.argv[1]
else:
qs = ""
- qs = qs.encode(locale.getpreferredencoding(), 'surrogateescape')
+ qs = qs.encode(locale.getpreferredencoding(), "surrogateescape")
fp = BytesIO(qs)
if headers is None:
- headers = {'content-type':
+ headers = {"content-type":
"application/x-www-form-urlencoded"}
if headers is None:
headers = {}
- if method == 'POST':
+ if method == "POST":
# Set default content-type for POST to what's traditional
- headers['content-type'] = "application/x-www-form-urlencoded"
- if 'CONTENT_TYPE' in environ:
- headers['content-type'] = environ['CONTENT_TYPE']
- if 'QUERY_STRING' in environ:
- self.qs_on_post = environ['QUERY_STRING']
- if 'CONTENT_LENGTH' in environ:
- headers['content-length'] = environ['CONTENT_LENGTH']
+ headers["content-type"] = "application/x-www-form-urlencoded"
+ if "CONTENT_TYPE" in environ:
+ headers["content-type"] = environ["CONTENT_TYPE"]
+ if "QUERY_STRING" in environ:
+ self.qs_on_post = environ["QUERY_STRING"]
+ if "CONTENT_LENGTH" in environ:
+ headers["content-length"] = environ["CONTENT_LENGTH"]
else:
if not (isinstance(headers, (Mapping, Message))):
raise TypeError("headers must be mapping or an instance of "
@@ -408,7 +408,7 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
elif isinstance(fp, TextIOWrapper):
self.fp = fp.buffer
else:
- if not (hasattr(fp, 'read') and hasattr(fp, 'readline')):
+ if not (hasattr(fp, "read") and hasattr(fp, "readline")):
raise TypeError("fp must be file pointer")
self.fp = fp
@@ -416,7 +416,7 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
self.errors = errors
if not isinstance(outerboundary, bytes):
- raise TypeError('outerboundary must be bytes, not %s'
+ raise TypeError("outerboundary must be bytes, not %s"
% type(outerboundary).__name__)
self.outerboundary = outerboundary
@@ -425,16 +425,16 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
# Process content-disposition header
cdisp, pdict = "", {}
- if 'content-disposition' in self.headers:
- cdisp, pdict = parse_header(self.headers['content-disposition'])
+ if "content-disposition" in self.headers:
+ cdisp, pdict = parse_header(self.headers["content-disposition"])
self.disposition = cdisp
self.disposition_options = pdict
self.name = None
- if 'name' in pdict:
- self.name = pdict['name']
+ if "name" in pdict:
+ self.name = pdict["name"]
self.filename = None
- if 'filename' in pdict:
- self.filename = pdict['filename']
+ if "filename" in pdict:
+ self.filename = pdict["filename"]
self._binary_file = self.filename is not None
# Process content-type header
@@ -449,37 +449,37 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
#
# See below for what we do if there does exist a content-type header,
# but it happens to be something we don't understand.
- if 'content-type' in self.headers:
- ctype, pdict = parse_header(self.headers['content-type'])
- elif self.outerboundary or method != 'POST':
+ if "content-type" in self.headers:
+ ctype, pdict = parse_header(self.headers["content-type"])
+ elif self.outerboundary or method != "POST":
ctype, pdict = "text/plain", {}
else:
- ctype, pdict = 'application/x-www-form-urlencoded', {}
+ ctype, pdict = "application/x-www-form-urlencoded", {}
self.type = ctype
self.type_options = pdict
- if 'boundary' in pdict:
- self.innerboundary = pdict['boundary'].encode(self.encoding,
+ if "boundary" in pdict:
+ self.innerboundary = pdict["boundary"].encode(self.encoding,
self.errors)
else:
self.innerboundary = b""
clen = -1
- if 'content-length' in self.headers:
+ if "content-length" in self.headers:
try:
- clen = int(self.headers['content-length'])
+ clen = int(self.headers["content-length"])
except ValueError:
pass
if maxlen and clen > maxlen:
- raise ValueError('Maximum content length exceeded')
+ raise ValueError("Maximum content length exceeded")
self.length = clen
if self.limit is None and clen >= 0:
self.limit = clen
self.list = self.file = None
self.done = 0
- if ctype == 'application/x-www-form-urlencoded':
+ if ctype == "application/x-www-form-urlencoded":
self.read_urlencoded()
- elif ctype[:10] == 'multipart/':
+ elif ctype[:10] == "multipart/":
self.read_multi(environ, keep_blank_values, strict_parsing)
else:
self.read_single()
@@ -505,7 +505,7 @@ def __iter__(self):
return iter(self.keys())
def __getattr__(self, name):
- if name != 'value':
+ if name != "value":
raise AttributeError(name)
if self.file:
self.file.seek(0)
@@ -593,7 +593,7 @@ def read_urlencoded(self):
% (self.fp, type(qs).__name__))
qs = qs.decode(self.encoding, self.errors)
if self.qs_on_post:
- qs += '&' + self.qs_on_post
+ qs += "&" + self.qs_on_post
query = urllib.parse.parse_qsl(
qs, self.keep_blank_values, self.strict_parsing,
encoding=self.encoding, errors=self.errors,
@@ -607,7 +607,7 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
"""Internal: read a part that is itself multipart."""
ib = self.innerboundary
if not valid_boundary(ib):
- raise ValueError('Invalid boundary in multipart form: %r' % (ib,))
+ raise ValueError("Invalid boundary in multipart form: %r" % (ib,))
self.list = []
if self.qs_on_post:
query = urllib.parse.parse_qsl(
@@ -650,8 +650,8 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
headers = parser.close()
# Some clients add Content-Length for part headers, ignore them
- if 'content-length' in headers:
- del headers['content-length']
+ if "content-length" in headers:
+ del headers["content-length"]
limit = None if self.limit is None \
else self.limit - self.bytes_read
@@ -664,7 +664,7 @@ def read_multi(self, environ, keep_blank_values, strict_parsing):
if part.list:
max_num_fields -= len(part.list)
if max_num_fields < 0:
- raise ValueError('Max number of fields exceeded')
+ raise ValueError("Max number of fields exceeded")
self.bytes_read += part.bytes_read
self.list.append(part)
@@ -806,7 +806,7 @@ def skip_lines(self):
if strippedline == last_boundary:
self.done = 1
break
- last_line_lfend = line.endswith(b'\n')
+ last_line_lfend = line.endswith(b"\n")
def make_file(self):
"""Overridable: return a readable & writable file.
@@ -836,7 +836,7 @@ def make_file(self):
return tempfile.TemporaryFile("wb+")
else:
return tempfile.TemporaryFile("w+",
- encoding=self.encoding, newline = '\n')
+ encoding=self.encoding, newline = "\n")
# Test/debug code
@@ -915,7 +915,7 @@ def print_form(form):
print("
' %
- (' ', link, call)]
+ (" ", link, call)]
if index is not None:
i = lnum - index
for line in lines:
- num = small(' ' * (5-len(str(i))) + str(i)) + ' '
+ num = small(" " * (5-len(str(i))) + str(i)) + " "
if i in highlight:
- line = '=>%s%s' % (num, pydoc.html.preformat(line))
+ line = "=>%s%s" % (num, pydoc.html.preformat(line))
rows.append('
" % grey(line))
i += 1
done, dump = {}, []
@@ -155,29 +155,29 @@ def reader(lnum=[lnum]):
if name in done: continue
done[name] = 1
if value is not __UNDEF__:
- if where in ('global', 'builtin'):
- name = ('%s ' % where) + strong(name)
- elif where == 'local':
+ if where in ("global", "builtin"):
+ name = ("%s " % where) + strong(name)
+ elif where == "local":
name = strong(name)
else:
- name = where + strong(name.split('.')[-1])
- dump.append('%s = %s' % (name, pydoc.html.repr(value)))
+ name = where + strong(name.split(".")[-1])
+ dump.append("%s = %s" % (name, pydoc.html.repr(value)))
else:
- dump.append(name + ' undefined')
+ dump.append(name + " undefined")
- rows.append('
A problem occurred in a Python script.\n')
+ self.file.write("
A problem occurred in a Python script.\n")
if self.logdir is not None:
- suffix = ['.txt', '.html'][self.format=="html"]
+ suffix = [".txt", ".html"][self.format=="html"]
(fd, path) = tempfile.mkstemp(suffix=suffix, dir=self.logdir)
try:
- with os.fdopen(fd, 'w') as file:
+ with os.fdopen(fd, "w") as file:
file.write(doc)
- msg = '%s contains the description of this error.' % path
+ msg = "%s contains the description of this error." % path
except:
- msg = 'Tried to save traceback to %s, but failed.' % path
+ msg = "Tried to save traceback to %s, but failed." % path
- if self.format == 'html':
- self.file.write('
%s
\n' % msg)
+ if self.format == "html":
+ self.file.write("
%s
\n" % msg)
else:
- self.file.write(msg + '\n')
+ self.file.write(msg + "\n")
try:
self.file.flush()
except: pass
diff --git a/.venv3.10/Lib/chunk.py b/.venv3.10/Lib/chunk.py
index 870c39fe..0601d27d 100644
--- a/.venv3.10/Lib/chunk.py
+++ b/.venv3.10/Lib/chunk.py
@@ -54,15 +54,15 @@ def __init__(self, file, align=True, bigendian=True, inclheader=False):
self.closed = False
self.align = align # whether to align to word (2-byte) boundaries
if bigendian:
- strflag = '>'
+ strflag = ">"
else:
- strflag = '<'
+ strflag = "<"
self.file = file
self.chunkname = file.read(4)
if len(self.chunkname) < 4:
raise EOFError
try:
- self.chunksize = struct.unpack_from(strflag+'L', file.read(4))[0]
+ self.chunksize = struct.unpack_from(strflag+"L", file.read(4))[0]
except struct.error:
raise EOFError from None
if inclheader:
@@ -128,7 +128,7 @@ def read(self, size=-1):
if self.closed:
raise ValueError("I/O operation on closed file")
if self.size_read >= self.chunksize:
- return b''
+ return b""
if size < 0:
size = self.chunksize - self.size_read
if size > self.chunksize - self.size_read:
diff --git a/.venv3.10/Lib/cmd.py b/.venv3.10/Lib/cmd.py
index 859e9109..9bd3c55e 100644
--- a/.venv3.10/Lib/cmd.py
+++ b/.venv3.10/Lib/cmd.py
@@ -42,12 +42,13 @@
functions respectively.
"""
-import string, sys
+import string
+import sys
__all__ = ["Cmd"]
-PROMPT = '(Cmd) '
-IDENTCHARS = string.ascii_letters + string.digits + '_'
+PROMPT = "(Cmd) "
+IDENTCHARS = string.ascii_letters + string.digits + "_"
class Cmd:
"""A simple framework for writing line-oriented command interpreters.
@@ -63,8 +64,8 @@ class Cmd:
"""
prompt = PROMPT
identchars = IDENTCHARS
- ruler = '='
- lastcmd = ''
+ ruler = "="
+ lastcmd = ""
intro = None
doc_leader = ""
doc_header = "Documented commands (type help ):"
@@ -73,7 +74,7 @@ class Cmd:
nohelp = "*** No help on %s"
use_rawinput = 1
- def __init__(self, completekey='tab', stdin=None, stdout=None):
+ def __init__(self, completekey="tab", stdin=None, stdout=None):
"""Instantiate a line-oriented interpreter framework.
The optional argument 'completekey' is the readline name of a
@@ -125,15 +126,15 @@ def cmdloop(self, intro=None):
try:
line = input(self.prompt)
except EOFError:
- line = 'EOF'
+ line = "EOF"
else:
self.stdout.write(self.prompt)
self.stdout.flush()
line = self.stdin.readline()
if not len(line):
- line = 'EOF'
+ line = "EOF"
else:
- line = line.rstrip('\r\n')
+ line = line.rstrip("\r\n")
line = self.precmd(line)
stop = self.onecmd(line)
stop = self.postcmd(stop, line)
@@ -177,11 +178,11 @@ def parseline(self, line):
line = line.strip()
if not line:
return None, None, line
- elif line[0] == '?':
- line = 'help ' + line[1:]
- elif line[0] == '!':
- if hasattr(self, 'do_shell'):
- line = 'shell ' + line[1:]
+ elif line[0] == "?":
+ line = "help " + line[1:]
+ elif line[0] == "!":
+ if hasattr(self, "do_shell"):
+ line = "shell " + line[1:]
else:
return None, None, line
i, n = 0, len(line)
@@ -205,13 +206,13 @@ def onecmd(self, line):
if cmd is None:
return self.default(line)
self.lastcmd = line
- if line == 'EOF' :
- self.lastcmd = ''
- if cmd == '':
+ if line == "EOF" :
+ self.lastcmd = ""
+ if cmd == "":
return self.default(line)
else:
try:
- func = getattr(self, 'do_' + cmd)
+ func = getattr(self, "do_" + cmd)
except AttributeError:
return self.default(line)
return func(arg)
@@ -233,7 +234,7 @@ def default(self, line):
returns.
"""
- self.stdout.write('*** Unknown syntax: %s\n'%line)
+ self.stdout.write("*** Unknown syntax: %s\n"%line)
def completedefault(self, *ignored):
"""Method called to complete an input line when no command-specific
@@ -245,7 +246,7 @@ def completedefault(self, *ignored):
return []
def completenames(self, text, *ignored):
- dotext = 'do_'+text
+ dotext = "do_"+text
return [a[3:] for a in self.get_names() if a.startswith(dotext)]
def complete(self, text, state):
@@ -263,11 +264,11 @@ def complete(self, text, state):
endidx = readline.get_endidx() - stripped
if begidx>0:
cmd, args, foo = self.parseline(line)
- if cmd == '':
+ if cmd == "":
compfunc = self.completedefault
else:
try:
- compfunc = getattr(self, 'complete_' + cmd)
+ compfunc = getattr(self, "complete_" + cmd)
except AttributeError:
compfunc = self.completedefault
else:
@@ -286,7 +287,7 @@ def get_names(self):
def complete_help(self, *args):
commands = set(self.completenames(*args))
topics = set(a[5:] for a in self.get_names()
- if a.startswith('help_' + args[0]))
+ if a.startswith("help_" + args[0]))
return list(commands | topics)
def do_help(self, arg):
@@ -294,10 +295,10 @@ def do_help(self, arg):
if arg:
# XXX check arg syntax
try:
- func = getattr(self, 'help_' + arg)
+ func = getattr(self, "help_" + arg)
except AttributeError:
try:
- doc=getattr(self, 'do_' + arg).__doc__
+ doc=getattr(self, "do_" + arg).__doc__
if doc:
self.stdout.write("%s\n"%str(doc))
return
@@ -312,13 +313,13 @@ def do_help(self, arg):
cmds_undoc = []
help = {}
for name in names:
- if name[:5] == 'help_':
+ if name[:5] == "help_":
help[name[5:]]=1
names.sort()
# There can be duplicates if routines overridden
- prevname = ''
+ prevname = ""
for name in names:
- if name[:3] == 'do_':
+ if name[:3] == "do_":
if name == prevname:
continue
prevname = name
@@ -360,7 +361,7 @@ def columnize(self, list, displaywidth=80):
% ", ".join(map(str, nonstrings)))
size = len(list)
if size == 1:
- self.stdout.write('%s\n'%str(list[0]))
+ self.stdout.write("%s\n"%str(list[0]))
return
# Try every row count from 1 upwards
for nrows in range(1, len(list)):
diff --git a/.venv3.10/Lib/code.py b/.venv3.10/Lib/code.py
index 76000f8c..ffa55ece 100644
--- a/.venv3.10/Lib/code.py
+++ b/.venv3.10/Lib/code.py
@@ -122,7 +122,7 @@ def showsyntaxerror(self, filename=None):
sys.last_value = value
if sys.excepthook is sys.__excepthook__:
lines = traceback.format_exception_only(type, value)
- self.write(''.join(lines))
+ self.write("".join(lines))
else:
# If someone has set sys.excepthook, we let that take precedence
# over self.write
@@ -141,7 +141,7 @@ def showtraceback(self):
try:
lines = traceback.format_exception(ei[0], ei[1], last_tb.tb_next)
if sys.excepthook is sys.__excepthook__:
- self.write(''.join(lines))
+ self.write("".join(lines))
else:
# If someone has set sys.excepthook, we let that take precedence
# over self.write
@@ -235,9 +235,9 @@ def interact(self, banner=None, exitmsg=None):
self.resetbuffer()
more = 0
if exitmsg is None:
- self.write('now exiting %s...\n' % self.__class__.__name__)
- elif exitmsg != '':
- self.write('%s\n' % exitmsg)
+ self.write("now exiting %s...\n" % self.__class__.__name__)
+ elif exitmsg != "":
+ self.write("%s\n" % exitmsg)
def push(self, line):
"""Push a line to the interpreter.
@@ -305,11 +305,11 @@ def interact(banner=None, readfunc=None, local=None, exitmsg=None):
import argparse
parser = argparse.ArgumentParser()
- parser.add_argument('-q', action='store_true',
+ parser.add_argument("-q", action="store_true",
help="don't print version and copyright messages")
args = parser.parse_args()
if args.q or sys.flags.quiet:
- banner = ''
+ banner = ""
else:
banner = None
interact(banner)
diff --git a/.venv3.10/Lib/codecs.py b/.venv3.10/Lib/codecs.py
index 3b173b61..df98ad46 100644
--- a/.venv3.10/Lib/codecs.py
+++ b/.venv3.10/Lib/codecs.py
@@ -15,7 +15,7 @@
try:
from _codecs import *
except ImportError as why:
- raise SystemError('Failed to load the builtin codecs: %s' % why)
+ raise SystemError("Failed to load the builtin codecs: %s" % why)
__all__ = ["register", "lookup", "open", "EncodedFile", "BOM", "BOM_BE",
"BOM_LE", "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",
@@ -41,21 +41,21 @@
#
# UTF-8
-BOM_UTF8 = b'\xef\xbb\xbf'
+BOM_UTF8 = b"\xef\xbb\xbf"
# UTF-16, little endian
-BOM_LE = BOM_UTF16_LE = b'\xff\xfe'
+BOM_LE = BOM_UTF16_LE = b"\xff\xfe"
# UTF-16, big endian
-BOM_BE = BOM_UTF16_BE = b'\xfe\xff'
+BOM_BE = BOM_UTF16_BE = b"\xfe\xff"
# UTF-32, little endian
-BOM_UTF32_LE = b'\xff\xfe\x00\x00'
+BOM_UTF32_LE = b"\xff\xfe\x00\x00"
# UTF-32, big endian
-BOM_UTF32_BE = b'\x00\x00\xfe\xff'
+BOM_UTF32_BE = b"\x00\x00\xfe\xff"
-if sys.byteorder == 'little':
+if sys.byteorder == "little":
# UTF-16, native endianness
BOM = BOM_UTF16 = BOM_UTF16_LE
@@ -135,7 +135,7 @@ class Codec:
The set of allowed values can be extended via register_error.
"""
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
""" Encodes the object input and returns a tuple (output
object, length consumed).
@@ -154,7 +154,7 @@ def encode(self, input, errors='strict'):
"""
raise NotImplementedError
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
""" Decodes the object input and returns a tuple (output
object, length consumed).
@@ -183,7 +183,7 @@ class IncrementalEncoder(object):
be passed piece by piece to the encode() method. The IncrementalEncoder
remembers the state of the encoding process between calls to encode().
"""
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
"""
Creates an IncrementalEncoder instance.
@@ -223,7 +223,7 @@ class BufferedIncrementalEncoder(IncrementalEncoder):
incremental encoder if the encoder must keep some of the output in a
buffer between calls to encode().
"""
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
IncrementalEncoder.__init__(self, errors)
# unencoded input that is kept between calls to encode()
self.buffer = ""
@@ -257,7 +257,7 @@ class IncrementalDecoder(object):
be passed piece by piece to the decode() method. The IncrementalDecoder
remembers the state of the decoding process between calls to decode().
"""
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
"""
Create an IncrementalDecoder instance.
@@ -306,7 +306,7 @@ class BufferedIncrementalDecoder(IncrementalDecoder):
incremental decoder if the decoder must be able to handle incomplete
byte sequences.
"""
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
IncrementalDecoder.__init__(self, errors)
# undecoded input that is kept between calls to decode()
self.buffer = b""
@@ -345,7 +345,7 @@ def setstate(self, state):
class StreamWriter(Codec):
- def __init__(self, stream, errors='strict'):
+ def __init__(self, stream, errors="strict"):
""" Creates a StreamWriter instance.
@@ -382,7 +382,7 @@ def writelines(self, list):
""" Writes the concatenated list of strings to the stream
using .write().
"""
- self.write(''.join(list))
+ self.write("".join(list))
def reset(self):
@@ -420,7 +420,7 @@ class StreamReader(Codec):
charbuffertype = str
- def __init__(self, stream, errors='strict'):
+ def __init__(self, stream, errors="strict"):
""" Creates a StreamReader instance.
@@ -445,7 +445,7 @@ def __init__(self, stream, errors='strict'):
self.charbuffer = self._empty_charbuffer
self.linebuffer = None
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
raise NotImplementedError
def read(self, size=-1, chars=-1, firstline=False):
@@ -676,9 +676,9 @@ class StreamReaderWriter:
"""
# Optional attributes set by the file wrappers below
- encoding = 'unknown'
+ encoding = "unknown"
- def __init__(self, stream, Reader, Writer, errors='strict'):
+ def __init__(self, stream, Reader, Writer, errors="strict"):
""" Creates a StreamReaderWriter instance.
@@ -769,11 +769,11 @@ class StreamRecoder:
"""
# Optional attributes set by the file wrappers below
- data_encoding = 'unknown'
- file_encoding = 'unknown'
+ data_encoding = "unknown"
+ file_encoding = "unknown"
def __init__(self, stream, encode, decode, Reader, Writer,
- errors='strict'):
+ errors="strict"):
""" Creates a StreamRecoder instance which implements a two-way
conversion: encode and decode work on the frontend (the
@@ -838,7 +838,7 @@ def write(self, data):
def writelines(self, list):
- data = b''.join(list)
+ data = b"".join(list)
data, bytesdecoded = self.decode(data, self.errors)
return self.writer.write(data)
@@ -868,7 +868,7 @@ def __exit__(self, type, value, tb):
### Shortcuts
-def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
+def open(filename, mode="r", encoding=None, errors="strict", buffering=-1):
""" Open an encoded file using the given mode and return
a wrapped version providing transparent encoding/decoding.
@@ -900,9 +900,9 @@ def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
"""
if encoding is not None and \
- 'b' not in mode:
+ "b" not in mode:
# Force opening of the file in binary mode
- mode = mode + 'b'
+ mode = mode + "b"
file = builtins.open(filename, mode, buffering)
if encoding is None:
return file
@@ -917,7 +917,7 @@ def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
file.close()
raise
-def EncodedFile(file, data_encoding, file_encoding=None, errors='strict'):
+def EncodedFile(file, data_encoding, file_encoding=None, errors="strict"):
""" Return a wrapped version of file which provides transparent
encoding translation.
@@ -1023,7 +1023,7 @@ def getwriter(encoding):
"""
return lookup(encoding).streamwriter
-def iterencode(iterator, encoding, errors='strict', **kwargs):
+def iterencode(iterator, encoding, errors="strict", **kwargs):
"""
Encoding iterator.
@@ -1041,7 +1041,7 @@ def iterencode(iterator, encoding, errors='strict', **kwargs):
if output:
yield output
-def iterdecode(iterator, encoding, errors='strict', **kwargs):
+def iterdecode(iterator, encoding, errors="strict", **kwargs):
"""
Decoding iterator.
@@ -1086,7 +1086,7 @@ def make_encoding_map(decoding_map):
"""
m = {}
for k,v in decoding_map.items():
- if not v in m:
+ if v not in m:
m[v] = k
else:
m[v] = None
@@ -1114,14 +1114,14 @@ def make_encoding_map(decoding_map):
# package
_false = 0
if _false:
- import encodings
+ pass
### Tests
-if __name__ == '__main__':
+if __name__ == "__main__":
# Make stdout translate Latin-1 output into UTF-8 output
- sys.stdout = EncodedFile(sys.stdout, 'latin-1', 'utf-8')
+ sys.stdout = EncodedFile(sys.stdout, "latin-1", "utf-8")
# Have stdin translate Latin-1 input into UTF-8 input
- sys.stdin = EncodedFile(sys.stdin, 'utf-8', 'latin-1')
+ sys.stdin = EncodedFile(sys.stdin, "utf-8", "latin-1")
diff --git a/.venv3.10/Lib/codeop.py b/.venv3.10/Lib/codeop.py
index fe8713ec..8aa87532 100644
--- a/.venv3.10/Lib/codeop.py
+++ b/.venv3.10/Lib/codeop.py
@@ -43,14 +43,14 @@
# The following flags match the values from Include/cpython/compile.h
# Caveat emptor: These flags are undocumented on purpose and depending
# on their effect outside the standard library is **unsupported**.
-PyCF_DONT_IMPLY_DEDENT = 0x200
+PyCF_DONT_IMPLY_DEDENT = 0x200
PyCF_ALLOW_INCOMPLETE_INPUT = 0x4000
def _maybe_compile(compiler, source, filename, symbol):
# Check for source consisting of only blank lines and comments.
for line in source.split("\n"):
line = line.strip()
- if line and line[0] != '#':
+ if line and line[0] != "#":
break # Leave it alone.
else:
if symbol != "eval":
diff --git a/.venv3.10/Lib/collections/__init__.py b/.venv3.10/Lib/collections/__init__.py
index 818588f7..624e25d6 100644
--- a/.venv3.10/Lib/collections/__init__.py
+++ b/.venv3.10/Lib/collections/__init__.py
@@ -1,4 +1,4 @@
-'''This module implements specialized container datatypes providing
+"""This module implements specialized container datatypes providing
alternatives to Python's general purpose built-in containers, dict,
list, set, and tuple.
@@ -12,18 +12,18 @@
* UserList wrapper around list objects for easier list subclassing
* UserString wrapper around string objects for easier string subclassing
-'''
+"""
__all__ = [
- 'ChainMap',
- 'Counter',
- 'OrderedDict',
- 'UserDict',
- 'UserList',
- 'UserString',
- 'defaultdict',
- 'deque',
- 'namedtuple',
+ "ChainMap",
+ "Counter",
+ "OrderedDict",
+ "UserDict",
+ "UserList",
+ "UserString",
+ "defaultdict",
+ "deque",
+ "namedtuple",
]
import _collections_abc
@@ -73,10 +73,10 @@ def __reversed__(self):
yield self._mapping[key]
class _Link(object):
- __slots__ = 'prev', 'next', 'key', '__weakref__'
+ __slots__ = "prev", "next", "key", "__weakref__"
class OrderedDict(dict):
- 'Dictionary that remembers insertion order'
+ "Dictionary that remembers insertion order"
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
@@ -91,9 +91,9 @@ class OrderedDict(dict):
# Those hard references disappear when a key is deleted from an OrderedDict.
def __init__(self, other=(), /, **kwds):
- '''Initialize an ordered dictionary. The signature is the same as
+ """Initialize an ordered dictionary. The signature is the same as
regular dictionaries. Keyword argument order is preserved.
- '''
+ """
try:
self.__root
except AttributeError:
@@ -105,7 +105,7 @@ def __init__(self, other=(), /, **kwds):
def __setitem__(self, key, value,
dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
- 'od.__setitem__(i, y) <==> od[i]=y'
+ "od.__setitem__(i, y) <==> od[i]=y"
# Setting a new item creates a new link at the end of the linked list,
# and the inherited dictionary is updated with the new key/value pair.
if key not in self:
@@ -118,7 +118,7 @@ def __setitem__(self, key, value,
dict_setitem(self, key, value)
def __delitem__(self, key, dict_delitem=dict.__delitem__):
- 'od.__delitem__(y) <==> del od[y]'
+ "od.__delitem__(y) <==> del od[y]"
# Deleting an existing item uses self.__map to find the link which gets
# removed by updating the links in the predecessor and successor nodes.
dict_delitem(self, key)
@@ -131,7 +131,7 @@ def __delitem__(self, key, dict_delitem=dict.__delitem__):
link.next = None
def __iter__(self):
- 'od.__iter__() <==> iter(od)'
+ "od.__iter__() <==> iter(od)"
# Traverse the linked list in order.
root = self.__root
curr = root.next
@@ -140,7 +140,7 @@ def __iter__(self):
curr = curr.next
def __reversed__(self):
- 'od.__reversed__() <==> reversed(od)'
+ "od.__reversed__() <==> reversed(od)"
# Traverse the linked list in reverse order.
root = self.__root
curr = root.prev
@@ -149,19 +149,19 @@ def __reversed__(self):
curr = curr.prev
def clear(self):
- 'od.clear() -> None. Remove all items from od.'
+ "od.clear() -> None. Remove all items from od."
root = self.__root
root.prev = root.next = root
self.__map.clear()
dict.clear(self)
def popitem(self, last=True):
- '''Remove and return a (key, value) pair from the dictionary.
+ """Remove and return a (key, value) pair from the dictionary.
Pairs are returned in LIFO order if last is true or FIFO order if false.
- '''
+ """
if not self:
- raise KeyError('dictionary is empty')
+ raise KeyError("dictionary is empty")
root = self.__root
if last:
link = root.prev
@@ -179,10 +179,10 @@ def popitem(self, last=True):
return key, value
def move_to_end(self, key, last=True):
- '''Move an existing element to the end (or beginning if last is false).
+ """Move an existing element to the end (or beginning if last is false).
Raise KeyError if the element does not exist.
- '''
+ """
link = self.__map[key]
link_prev = link.prev
link_next = link.next
@@ -231,11 +231,11 @@ def values(self):
__marker = object()
def pop(self, key, default=__marker):
- '''od.pop(k[,d]) -> v, remove specified key and return the corresponding
+ """od.pop(k[,d]) -> v, remove specified key and return the corresponding
value. If key is not found, d is returned if given, otherwise KeyError
is raised.
- '''
+ """
if key in self:
result = self[key]
del self[key]
@@ -245,10 +245,10 @@ def pop(self, key, default=__marker):
return default
def setdefault(self, key, default=None):
- '''Insert key with a value of default if key is not in the dictionary.
+ """Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- '''
+ """
if key in self:
return self[key]
self[key] = default
@@ -256,36 +256,36 @@ def setdefault(self, key, default=None):
@_recursive_repr()
def __repr__(self):
- 'od.__repr__() <==> repr(od)'
+ "od.__repr__() <==> repr(od)"
if not self:
- return '%s()' % (self.__class__.__name__,)
- return '%s(%r)' % (self.__class__.__name__, list(self.items()))
+ return "%s()" % (self.__class__.__name__,)
+ return "%s(%r)" % (self.__class__.__name__, list(self.items()))
def __reduce__(self):
- 'Return state information for pickling'
+ "Return state information for pickling"
inst_dict = vars(self).copy()
for k in vars(OrderedDict()):
inst_dict.pop(k, None)
return self.__class__, (), inst_dict or None, None, iter(self.items())
def copy(self):
- 'od.copy() -> a shallow copy of od'
+ "od.copy() -> a shallow copy of od"
return self.__class__(self)
@classmethod
def fromkeys(cls, iterable, value=None):
- '''Create a new ordered dictionary with keys from iterable and values set to value.
- '''
+ """Create a new ordered dictionary with keys from iterable and values set to value.
+ """
self = cls()
for key in iterable:
self[key] = value
return self
def __eq__(self, other):
- '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive
+ """od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive
while comparison to a regular mapping is order-insensitive.
- '''
+ """
if isinstance(other, OrderedDict):
return dict.__eq__(self, other) and all(map(_eq, self, other))
return dict.__eq__(self, other)
@@ -352,7 +352,7 @@ def namedtuple(typename, field_names, *, rename=False, defaults=None, module=Non
# Validate the field names. At the user's option, either generate an error
# message or automatically replace the field name with a valid name.
if isinstance(field_names, str):
- field_names = field_names.replace(',', ' ').split()
+ field_names = field_names.replace(",", " ").split()
field_names = list(map(str, field_names))
typename = _sys.intern(str(typename))
@@ -361,59 +361,59 @@ def namedtuple(typename, field_names, *, rename=False, defaults=None, module=Non
for index, name in enumerate(field_names):
if (not name.isidentifier()
or _iskeyword(name)
- or name.startswith('_')
+ or name.startswith("_")
or name in seen):
- field_names[index] = f'_{index}'
+ field_names[index] = f"_{index}"
seen.add(name)
for name in [typename] + field_names:
if type(name) is not str:
- raise TypeError('Type names and field names must be strings')
+ raise TypeError("Type names and field names must be strings")
if not name.isidentifier():
- raise ValueError('Type names and field names must be valid '
- f'identifiers: {name!r}')
+ raise ValueError("Type names and field names must be valid "
+ f"identifiers: {name!r}")
if _iskeyword(name):
- raise ValueError('Type names and field names cannot be a '
- f'keyword: {name!r}')
+ raise ValueError("Type names and field names cannot be a "
+ f"keyword: {name!r}")
seen = set()
for name in field_names:
- if name.startswith('_') and not rename:
- raise ValueError('Field names cannot start with an underscore: '
- f'{name!r}')
+ if name.startswith("_") and not rename:
+ raise ValueError("Field names cannot start with an underscore: "
+ f"{name!r}")
if name in seen:
- raise ValueError(f'Encountered duplicate field name: {name!r}')
+ raise ValueError(f"Encountered duplicate field name: {name!r}")
seen.add(name)
field_defaults = {}
if defaults is not None:
defaults = tuple(defaults)
if len(defaults) > len(field_names):
- raise TypeError('Got more default values than field names')
+ raise TypeError("Got more default values than field names")
field_defaults = dict(reversed(list(zip(reversed(field_names),
reversed(defaults)))))
# Variables used in the methods and docstrings
field_names = tuple(map(_sys.intern, field_names))
num_fields = len(field_names)
- arg_list = ', '.join(field_names)
+ arg_list = ", ".join(field_names)
if num_fields == 1:
- arg_list += ','
- repr_fmt = '(' + ', '.join(f'{name}=%r' for name in field_names) + ')'
+ arg_list += ","
+ repr_fmt = "(" + ", ".join(f"{name}=%r" for name in field_names) + ")"
tuple_new = tuple.__new__
_dict, _tuple, _len, _map, _zip = dict, tuple, len, map, zip
# Create all the named tuple methods to be added to the class namespace
namespace = {
- '_tuple_new': tuple_new,
- '__builtins__': {},
- '__name__': f'namedtuple_{typename}',
+ "_tuple_new": tuple_new,
+ "__builtins__": {},
+ "__name__": f"namedtuple_{typename}",
}
- code = f'lambda _cls, {arg_list}: _tuple_new(_cls, ({arg_list}))'
+ code = f"lambda _cls, {arg_list}: _tuple_new(_cls, ({arg_list}))"
__new__ = eval(code, namespace)
- __new__.__name__ = '__new__'
- __new__.__doc__ = f'Create new instance of {typename}({arg_list})'
+ __new__.__name__ = "__new__"
+ __new__.__doc__ = f"Create new instance of {typename}({arg_list})"
if defaults is not None:
__new__.__defaults__ = defaults
@@ -421,31 +421,31 @@ def namedtuple(typename, field_names, *, rename=False, defaults=None, module=Non
def _make(cls, iterable):
result = tuple_new(cls, iterable)
if _len(result) != num_fields:
- raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
+ raise TypeError(f"Expected {num_fields} arguments, got {len(result)}")
return result
- _make.__func__.__doc__ = (f'Make a new {typename} object from a sequence '
- 'or iterable')
+ _make.__func__.__doc__ = (f"Make a new {typename} object from a sequence "
+ "or iterable")
def _replace(self, /, **kwds):
result = self._make(_map(kwds.pop, field_names, self))
if kwds:
- raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
+ raise ValueError(f"Got unexpected field names: {list(kwds)!r}")
return result
- _replace.__doc__ = (f'Return a new {typename} object replacing specified '
- 'fields with new values')
+ _replace.__doc__ = (f"Return a new {typename} object replacing specified "
+ "fields with new values")
def __repr__(self):
- 'Return a nicely formatted representation string'
+ "Return a nicely formatted representation string"
return self.__class__.__name__ + repr_fmt % self
def _asdict(self):
- 'Return a new dict which maps field names to their values.'
+ "Return a new dict which maps field names to their values."
return _dict(_zip(self._fields, self))
def __getnewargs__(self):
- 'Return self as a plain tuple. Used by copy and pickle.'
+ "Return self as a plain tuple. Used by copy and pickle."
return _tuple(self)
# Modify function metadata to help with introspection and debugging
@@ -457,25 +457,25 @@ def __getnewargs__(self):
_asdict,
__getnewargs__,
):
- method.__qualname__ = f'{typename}.{method.__name__}'
+ method.__qualname__ = f"{typename}.{method.__name__}"
# Build-up the class namespace dictionary
# and use type() to build the result class
class_namespace = {
- '__doc__': f'{typename}({arg_list})',
- '__slots__': (),
- '_fields': field_names,
- '_field_defaults': field_defaults,
- '__new__': __new__,
- '_make': _make,
- '_replace': _replace,
- '__repr__': __repr__,
- '_asdict': _asdict,
- '__getnewargs__': __getnewargs__,
- '__match_args__': field_names,
+ "__doc__": f"{typename}({arg_list})",
+ "__slots__": (),
+ "_fields": field_names,
+ "_field_defaults": field_defaults,
+ "__new__": __new__,
+ "_make": _make,
+ "_replace": _replace,
+ "__repr__": __repr__,
+ "_asdict": _asdict,
+ "__getnewargs__": __getnewargs__,
+ "__match_args__": field_names,
}
for index, name in enumerate(field_names):
- doc = _sys.intern(f'Alias for field number {index}')
+ doc = _sys.intern(f"Alias for field number {index}")
class_namespace[name] = _tuplegetter(index, doc)
result = type(typename, (tuple,), class_namespace)
@@ -487,7 +487,7 @@ def __getnewargs__(self):
# specified a particular module.
if module is None:
try:
- module = _sys._getframe(1).f_globals.get('__name__', '__main__')
+ module = _sys._getframe(1).f_globals.get("__name__", "__main__")
except (AttributeError, ValueError):
pass
if module is not None:
@@ -501,7 +501,7 @@ def __getnewargs__(self):
########################################################################
def _count_elements(mapping, iterable):
- 'Tally elements from the iterable.'
+ "Tally elements from the iterable."
mapping_get = mapping.get
for elem in iterable:
mapping[elem] = mapping_get(elem, 0) + 1
@@ -512,7 +512,7 @@ def _count_elements(mapping, iterable):
pass
class Counter(dict):
- '''Dict subclass for counting hashable items. Sometimes called a bag
+ """Dict subclass for counting hashable items. Sometimes called a bag
or multiset. Elements are stored as dictionary keys and their counts
are stored as dictionary values.
@@ -554,7 +554,7 @@ class Counter(dict):
>>> c.most_common() # 'b' is still in, but its count is zero
[('a', 3), ('c', 1), ('b', 0)]
- '''
+ """
# References:
# http://en.wikipedia.org/wiki/Multiset
# http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
@@ -563,7 +563,7 @@ class Counter(dict):
# Knuth, TAOCP Vol. II section 4.6.3
def __init__(self, iterable=None, /, **kwds):
- '''Create a new, empty Counter object. And if given, count elements
+ """Create a new, empty Counter object. And if given, count elements
from an input iterable. Or, initialize the count from another mapping
of elements to their counts.
@@ -572,27 +572,27 @@ def __init__(self, iterable=None, /, **kwds):
>>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping
>>> c = Counter(a=4, b=2) # a new counter from keyword args
- '''
+ """
super().__init__()
self.update(iterable, **kwds)
def __missing__(self, key):
- 'The count of elements not in the Counter is zero.'
+ "The count of elements not in the Counter is zero."
# Needed so that self[missing_item] does not raise KeyError
return 0
def total(self):
- 'Sum of the counts'
+ "Sum of the counts"
return sum(self.values())
def most_common(self, n=None):
- '''List the n most common elements and their counts from the most
+ """List the n most common elements and their counts from the most
common to the least. If n is None, then list all element counts.
>>> Counter('abracadabra').most_common(3)
[('a', 5), ('b', 2), ('r', 2)]
- '''
+ """
# Emulate Bag.sortedByCount from Smalltalk
if n is None:
return sorted(self.items(), key=_itemgetter(1), reverse=True)
@@ -602,7 +602,7 @@ def most_common(self, n=None):
return heapq.nlargest(n, self.items(), key=_itemgetter(1))
def elements(self):
- '''Iterator over elements repeating each as many times as its count.
+ """Iterator over elements repeating each as many times as its count.
>>> c = Counter('ABCABC')
>>> sorted(c.elements())
@@ -619,7 +619,7 @@ def elements(self):
Note, if an element's count has been set to zero or is a negative
number, elements() will ignore it.
- '''
+ """
# Emulate Bag.do from Smalltalk and Multiset.begin from C++.
return _chain.from_iterable(_starmap(_repeat, self.items()))
@@ -635,10 +635,10 @@ def fromkeys(cls, iterable, v=None):
# more exotic cases, create a dictionary first using a dictionary
# comprehension or dict.fromkeys().
raise NotImplementedError(
- 'Counter.fromkeys() is undefined. Use Counter(iterable) instead.')
+ "Counter.fromkeys() is undefined. Use Counter(iterable) instead.")
def update(self, iterable=None, /, **kwds):
- '''Like dict.update() but add counts instead of replacing them.
+ """Like dict.update() but add counts instead of replacing them.
Source can be an iterable, a dictionary, or another Counter instance.
@@ -649,7 +649,7 @@ def update(self, iterable=None, /, **kwds):
>>> c['h'] # four 'h' in which, witch, and watch
4
- '''
+ """
# The regular dict.update() operation makes no sense here because the
# replace behavior results in the some of original untouched counts
# being mixed-in with all of the other counts for a mismash that
@@ -672,7 +672,7 @@ def update(self, iterable=None, /, **kwds):
self.update(kwds)
def subtract(self, iterable=None, /, **kwds):
- '''Like dict.update() but subtracts counts instead of replacing them.
+ """Like dict.update() but subtracts counts instead of replacing them.
Counts can be reduced below zero. Both the inputs and outputs are
allowed to contain zero and negative counts.
@@ -686,7 +686,7 @@ def subtract(self, iterable=None, /, **kwds):
>>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch
-1
- '''
+ """
if iterable is not None:
self_get = self.get
if isinstance(iterable, _collections_abc.Mapping):
@@ -699,63 +699,63 @@ def subtract(self, iterable=None, /, **kwds):
self.subtract(kwds)
def copy(self):
- 'Return a shallow copy.'
+ "Return a shallow copy."
return self.__class__(self)
def __reduce__(self):
return self.__class__, (dict(self),)
def __delitem__(self, elem):
- 'Like dict.__delitem__() but does not raise KeyError for missing values.'
+ "Like dict.__delitem__() but does not raise KeyError for missing values."
if elem in self:
super().__delitem__(elem)
def __eq__(self, other):
- 'True if all counts agree. Missing counts are treated as zero.'
+ "True if all counts agree. Missing counts are treated as zero."
if not isinstance(other, Counter):
return NotImplemented
return all(self[e] == other[e] for c in (self, other) for e in c)
def __ne__(self, other):
- 'True if any counts disagree. Missing counts are treated as zero.'
+ "True if any counts disagree. Missing counts are treated as zero."
if not isinstance(other, Counter):
return NotImplemented
return not self == other
def __le__(self, other):
- 'True if all counts in self are a subset of those in other.'
+ "True if all counts in self are a subset of those in other."
if not isinstance(other, Counter):
return NotImplemented
return all(self[e] <= other[e] for c in (self, other) for e in c)
def __lt__(self, other):
- 'True if all counts in self are a proper subset of those in other.'
+ "True if all counts in self are a proper subset of those in other."
if not isinstance(other, Counter):
return NotImplemented
return self <= other and self != other
def __ge__(self, other):
- 'True if all counts in self are a superset of those in other.'
+ "True if all counts in self are a superset of those in other."
if not isinstance(other, Counter):
return NotImplemented
return all(self[e] >= other[e] for c in (self, other) for e in c)
def __gt__(self, other):
- 'True if all counts in self are a proper superset of those in other.'
+ "True if all counts in self are a proper superset of those in other."
if not isinstance(other, Counter):
return NotImplemented
return self >= other and self != other
def __repr__(self):
if not self:
- return f'{self.__class__.__name__}()'
+ return f"{self.__class__.__name__}()"
try:
# dict() preserves the ordering returned by most_common()
d = dict(self.most_common())
except TypeError:
# handle case where values are not orderable
d = dict(self)
- return f'{self.__class__.__name__}({d!r})'
+ return f"{self.__class__.__name__}({d!r})"
# Multiset-style mathematical operations discussed in:
# Knuth TAOCP Volume II section 4.6.3 exercise 19
@@ -792,12 +792,12 @@ def __repr__(self):
# (cp > cq) == (sp > sq)
def __add__(self, other):
- '''Add counts from two counters.
+ """Add counts from two counters.
>>> Counter('abbb') + Counter('bcc')
Counter({'b': 4, 'c': 2, 'a': 1})
- '''
+ """
if not isinstance(other, Counter):
return NotImplemented
result = Counter()
@@ -811,12 +811,12 @@ def __add__(self, other):
return result
def __sub__(self, other):
- ''' Subtract count, but keep only results with positive counts.
+ """ Subtract count, but keep only results with positive counts.
>>> Counter('abbbc') - Counter('bccd')
Counter({'b': 2, 'a': 1})
- '''
+ """
if not isinstance(other, Counter):
return NotImplemented
result = Counter()
@@ -830,12 +830,12 @@ def __sub__(self, other):
return result
def __or__(self, other):
- '''Union is the maximum of value in either of the input counters.
+ """Union is the maximum of value in either of the input counters.
>>> Counter('abbb') | Counter('bcc')
Counter({'b': 3, 'c': 2, 'a': 1})
- '''
+ """
if not isinstance(other, Counter):
return NotImplemented
result = Counter()
@@ -850,12 +850,12 @@ def __or__(self, other):
return result
def __and__(self, other):
- ''' Intersection is the minimum of corresponding counts.
+ """ Intersection is the minimum of corresponding counts.
>>> Counter('abbb') & Counter('bcc')
Counter({'b': 1})
- '''
+ """
if not isinstance(other, Counter):
return NotImplemented
result = Counter()
@@ -867,7 +867,7 @@ def __and__(self, other):
return result
def __pos__(self):
- 'Adds an empty counter, effectively stripping negative and zero counts'
+ "Adds an empty counter, effectively stripping negative and zero counts"
result = Counter()
for elem, count in self.items():
if count > 0:
@@ -875,10 +875,10 @@ def __pos__(self):
return result
def __neg__(self):
- '''Subtracts from an empty counter. Strips positive and zero counts,
+ """Subtracts from an empty counter. Strips positive and zero counts,
and flips the sign on negative counts.
- '''
+ """
result = Counter()
for elem, count in self.items():
if count < 0:
@@ -886,47 +886,47 @@ def __neg__(self):
return result
def _keep_positive(self):
- '''Internal method to strip elements with a negative or zero count'''
+ """Internal method to strip elements with a negative or zero count"""
nonpositive = [elem for elem, count in self.items() if not count > 0]
for elem in nonpositive:
del self[elem]
return self
def __iadd__(self, other):
- '''Inplace add from another counter, keeping only positive counts.
+ """Inplace add from another counter, keeping only positive counts.
>>> c = Counter('abbb')
>>> c += Counter('bcc')
>>> c
Counter({'b': 4, 'c': 2, 'a': 1})
- '''
+ """
for elem, count in other.items():
self[elem] += count
return self._keep_positive()
def __isub__(self, other):
- '''Inplace subtract counter, but keep only results with positive counts.
+ """Inplace subtract counter, but keep only results with positive counts.
>>> c = Counter('abbbc')
>>> c -= Counter('bccd')
>>> c
Counter({'b': 2, 'a': 1})
- '''
+ """
for elem, count in other.items():
self[elem] -= count
return self._keep_positive()
def __ior__(self, other):
- '''Inplace union is the maximum of value from either counter.
+ """Inplace union is the maximum of value from either counter.
>>> c = Counter('abbb')
>>> c |= Counter('bcc')
>>> c
Counter({'b': 3, 'c': 2, 'a': 1})
- '''
+ """
for elem, other_count in other.items():
count = self[elem]
if other_count > count:
@@ -934,14 +934,14 @@ def __ior__(self, other):
return self._keep_positive()
def __iand__(self, other):
- '''Inplace intersection is the minimum of corresponding counts.
+ """Inplace intersection is the minimum of corresponding counts.
>>> c = Counter('abbb')
>>> c &= Counter('bcc')
>>> c
Counter({'b': 1})
- '''
+ """
for elem, count in self.items():
other_count = other[elem]
if other_count < count:
@@ -954,7 +954,7 @@ def __iand__(self, other):
########################################################################
class ChainMap(_collections_abc.MutableMapping):
- ''' A ChainMap groups multiple dicts (or other mappings) together
+ """ A ChainMap groups multiple dicts (or other mappings) together
to create a single, updateable view.
The underlying mappings are stored in a list. That list is public and can
@@ -965,13 +965,13 @@ class ChainMap(_collections_abc.MutableMapping):
In contrast, writes, updates, and deletions only operate on the first
mapping.
- '''
+ """
def __init__(self, *maps):
- '''Initialize a ChainMap by setting *maps* to the given mappings.
+ """Initialize a ChainMap by setting *maps* to the given mappings.
If no mappings are provided, a single empty dictionary is used.
- '''
+ """
self.maps = list(maps) or [{}] # always at least one map
def __missing__(self, key):
@@ -1009,20 +1009,20 @@ def __repr__(self):
@classmethod
def fromkeys(cls, iterable, *args):
- 'Create a ChainMap with a single dict created from the iterable.'
+ "Create a ChainMap with a single dict created from the iterable."
return cls(dict.fromkeys(iterable, *args))
def copy(self):
- 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'
+ "New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]"
return self.__class__(self.maps[0].copy(), *self.maps[1:])
__copy__ = copy
def new_child(self, m=None, **kwargs): # like Django's Context.push()
- '''New ChainMap with a new map followed by all previous maps.
+ """New ChainMap with a new map followed by all previous maps.
If no map is provided, an empty dict is used.
Keyword arguments update the map or new empty dict.
- '''
+ """
if m is None:
m = kwargs
elif kwargs:
@@ -1031,7 +1031,7 @@ def new_child(self, m=None, **kwargs): # like Django's Context.push()
@property
def parents(self): # like Django's Context.pop()
- 'New ChainMap from maps[1:].'
+ "New ChainMap from maps[1:]."
return self.__class__(*self.maps[1:])
def __setitem__(self, key, value):
@@ -1041,24 +1041,24 @@ def __delitem__(self, key):
try:
del self.maps[0][key]
except KeyError:
- raise KeyError(f'Key not found in the first mapping: {key!r}')
+ raise KeyError(f"Key not found in the first mapping: {key!r}")
def popitem(self):
- 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
+ "Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty."
try:
return self.maps[0].popitem()
except KeyError:
- raise KeyError('No keys found in the first mapping.')
+ raise KeyError("No keys found in the first mapping.")
def pop(self, key, *args):
- 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'
+ "Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0]."
try:
return self.maps[0].pop(key, *args)
except KeyError:
- raise KeyError(f'Key not found in the first mapping: {key!r}')
+ raise KeyError(f"Key not found in the first mapping: {key!r}")
def clear(self):
- 'Clear maps[0], leaving maps[1:] intact.'
+ "Clear maps[0], leaving maps[1:] intact."
self.maps[0].clear()
def __ior__(self, other):
@@ -1423,9 +1423,9 @@ def removesuffix(self, suffix, /):
suffix = suffix.data
return self.__class__(self.data.removesuffix(suffix))
- def encode(self, encoding='utf-8', errors='strict'):
- encoding = 'utf-8' if encoding is None else encoding
- errors = 'strict' if errors is None else errors
+ def encode(self, encoding="utf-8", errors="strict"):
+ encoding = "utf-8" if encoding is None else encoding
+ errors = "strict" if errors is None else errors
return self.data.encode(encoding, errors)
def endswith(self, suffix, start=0, end=_sys.maxsize):
diff --git a/.venv3.10/Lib/collections/abc.py b/.venv3.10/Lib/collections/abc.py
index 86ca8b8a..8b98557b 100644
--- a/.venv3.10/Lib/collections/abc.py
+++ b/.venv3.10/Lib/collections/abc.py
@@ -1,3 +1 @@
from _collections_abc import *
-from _collections_abc import __all__
-from _collections_abc import _CallableGenericAlias
diff --git a/.venv3.10/Lib/compileall.py b/.venv3.10/Lib/compileall.py
index 50183ea8..ebbb5047 100644
--- a/.venv3.10/Lib/compileall.py
+++ b/.venv3.10/Lib/compileall.py
@@ -26,7 +26,7 @@ def _walk_dir(dir, maxlevels, quiet=0):
if quiet < 2 and isinstance(dir, os.PathLike):
dir = os.fspath(dir)
if not quiet:
- print('Listing {!r}...'.format(dir))
+ print("Listing {!r}...".format(dir))
try:
names = os.listdir(dir)
except OSError:
@@ -35,7 +35,7 @@ def _walk_dir(dir, maxlevels, quiet=0):
names = []
names.sort()
for name in names:
- if name == '__pycache__':
+ if name == "__pycache__":
continue
fullname = os.path.join(dir, name)
if not os.path.isdir(fullname):
@@ -82,7 +82,7 @@ def compile_dir(dir, maxlevels=None, ddir=None, force=False,
prependdir = ddir
ddir = None
if workers < 0:
- raise ValueError('workers must be greater or equal to 0')
+ raise ValueError("workers must be greater or equal to 0")
if workers != 1:
# Check if this is a system where ProcessPoolExecutor can function.
from concurrent.futures.process import _check_system_limits
@@ -205,10 +205,10 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
if os.path.isfile(fullname):
for opt_level in optimize:
if legacy:
- opt_cfiles[opt_level] = fullname + 'c'
+ opt_cfiles[opt_level] = fullname + "c"
else:
if opt_level >= 0:
- opt = opt_level if opt_level >= 1 else ''
+ opt = opt_level if opt_level >= 1 else ""
cfile = (importlib.util.cache_from_source(
fullname, optimization=opt))
opt_cfiles[opt_level] = cfile
@@ -217,14 +217,14 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
opt_cfiles[opt_level] = cfile
head, tail = name[:-3], name[-3:]
- if tail == '.py':
+ if tail == ".py":
if not force:
try:
mtime = int(os.stat(fullname).st_mtime)
- expect = struct.pack('<4sLL', importlib.util.MAGIC_NUMBER,
+ expect = struct.pack("<4sLL", importlib.util.MAGIC_NUMBER,
0, mtime & 0xFFFF_FFFF)
for cfile in opt_cfiles.values():
- with open(cfile, 'rb') as chandle:
+ with open(cfile, "rb") as chandle:
actual = chandle.read(12)
if expect != actual:
break
@@ -233,7 +233,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
except OSError:
pass
if not quiet:
- print('Compiling {!r}...'.format(fullname))
+ print("Compiling {!r}...".format(fullname))
try:
for index, opt_level in enumerate(optimize):
cfile = opt_cfiles[opt_level]
@@ -250,22 +250,22 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
if quiet >= 2:
return success
elif quiet:
- print('*** Error compiling {!r}...'.format(fullname))
+ print("*** Error compiling {!r}...".format(fullname))
else:
- print('*** ', end='')
+ print("*** ", end="")
# escape non-printable characters in msg
encoding = sys.stdout.encoding or sys.getdefaultencoding()
- msg = err.msg.encode(encoding, errors='backslashreplace').decode(encoding)
+ msg = err.msg.encode(encoding, errors="backslashreplace").decode(encoding)
print(msg)
except (SyntaxError, UnicodeError, OSError) as e:
success = False
if quiet >= 2:
return success
elif quiet:
- print('*** Error compiling {!r}...'.format(fullname))
+ print("*** Error compiling {!r}...".format(fullname))
else:
- print('*** ', end='')
- print(e.__class__.__name__ + ':', e)
+ print("*** ", end="")
+ print(e.__class__.__name__ + ":", e)
else:
if ok == 0:
success = False
@@ -290,7 +290,7 @@ def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0,
for dir in sys.path:
if (not dir or dir == os.curdir) and skip_curdir:
if quiet < 2:
- print('Skipping current directory')
+ print("Skipping current directory")
else:
success = success and compile_dir(
dir,
@@ -310,71 +310,71 @@ def main():
import argparse
parser = argparse.ArgumentParser(
- description='Utilities to support installing Python libraries.')
- parser.add_argument('-l', action='store_const', const=0,
- default=None, dest='maxlevels',
+ description="Utilities to support installing Python libraries.")
+ parser.add_argument("-l", action="store_const", const=0,
+ default=None, dest="maxlevels",
help="don't recurse into subdirectories")
- parser.add_argument('-r', type=int, dest='recursion',
- help=('control the maximum recursion level. '
- 'if `-l` and `-r` options are specified, '
- 'then `-r` takes precedence.'))
- parser.add_argument('-f', action='store_true', dest='force',
- help='force rebuild even if timestamps are up to date')
- parser.add_argument('-q', action='count', dest='quiet', default=0,
- help='output only error messages; -qq will suppress '
- 'the error messages as well.')
- parser.add_argument('-b', action='store_true', dest='legacy',
- help='use legacy (pre-PEP3147) compiled file locations')
- parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
- help=('directory to prepend to file paths for use in '
- 'compile-time tracebacks and in runtime '
- 'tracebacks in cases where the source file is '
- 'unavailable'))
- parser.add_argument('-s', metavar='STRIPDIR', dest='stripdir',
+ parser.add_argument("-r", type=int, dest="recursion",
+ help=("control the maximum recursion level. "
+ "if `-l` and `-r` options are specified, "
+ "then `-r` takes precedence."))
+ parser.add_argument("-f", action="store_true", dest="force",
+ help="force rebuild even if timestamps are up to date")
+ parser.add_argument("-q", action="count", dest="quiet", default=0,
+ help="output only error messages; -qq will suppress "
+ "the error messages as well.")
+ parser.add_argument("-b", action="store_true", dest="legacy",
+ help="use legacy (pre-PEP3147) compiled file locations")
+ parser.add_argument("-d", metavar="DESTDIR", dest="ddir", default=None,
+ help=("directory to prepend to file paths for use in "
+ "compile-time tracebacks and in runtime "
+ "tracebacks in cases where the source file is "
+ "unavailable"))
+ parser.add_argument("-s", metavar="STRIPDIR", dest="stripdir",
default=None,
- help=('part of path to left-strip from path '
- 'to source file - for example buildroot. '
- '`-d` and `-s` options cannot be '
- 'specified together.'))
- parser.add_argument('-p', metavar='PREPENDDIR', dest='prependdir',
+ help=("part of path to left-strip from path "
+ "to source file - for example buildroot. "
+ "`-d` and `-s` options cannot be "
+ "specified together."))
+ parser.add_argument("-p", metavar="PREPENDDIR", dest="prependdir",
default=None,
- help=('path to add as prefix to path '
- 'to source file - for example / to make '
- 'it absolute when some part is removed '
- 'by `-s` option. '
- '`-d` and `-p` options cannot be '
- 'specified together.'))
- parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
- help=('skip files matching the regular expression; '
- 'the regexp is searched for in the full path '
- 'of each file considered for compilation'))
- parser.add_argument('-i', metavar='FILE', dest='flist',
+ help=("path to add as prefix to path "
+ "to source file - for example / to make "
+ "it absolute when some part is removed "
+ "by `-s` option. "
+ "`-d` and `-p` options cannot be "
+ "specified together."))
+ parser.add_argument("-x", metavar="REGEXP", dest="rx", default=None,
+ help=("skip files matching the regular expression; "
+ "the regexp is searched for in the full path "
+ "of each file considered for compilation"))
+ parser.add_argument("-i", metavar="FILE", dest="flist",
help=('add all the files and directories listed in '
'FILE to the list considered for compilation; '
'if "-", names are read from stdin'))
- parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
- help=('zero or more file and directory names '
- 'to compile; if no arguments given, defaults '
- 'to the equivalent of -l sys.path'))
- parser.add_argument('-j', '--workers', default=1,
- type=int, help='Run compileall concurrently')
- invalidation_modes = [mode.name.lower().replace('_', '-')
+ parser.add_argument("compile_dest", metavar="FILE|DIR", nargs="*",
+ help=("zero or more file and directory names "
+ "to compile; if no arguments given, defaults "
+ "to the equivalent of -l sys.path"))
+ parser.add_argument("-j", "--workers", default=1,
+ type=int, help="Run compileall concurrently")
+ invalidation_modes = [mode.name.lower().replace("_", "-")
for mode in py_compile.PycInvalidationMode]
- parser.add_argument('--invalidation-mode',
+ parser.add_argument("--invalidation-mode",
choices=sorted(invalidation_modes),
help=('set .pyc invalidation mode; defaults to '
'"checked-hash" if the SOURCE_DATE_EPOCH '
'environment variable is set, and '
'"timestamp" otherwise.'))
- parser.add_argument('-o', action='append', type=int, dest='opt_levels',
- help=('Optimization levels to run compilation with. '
- 'Default is -1 which uses the optimization level '
- 'of the Python interpreter itself (see -O).'))
- parser.add_argument('-e', metavar='DIR', dest='limit_sl_dest',
- help='Ignore symlinks pointing outsite of the DIR')
- parser.add_argument('--hardlink-dupes', action='store_true',
- dest='hardlink_dupes',
- help='Hardlink duplicated pyc files')
+ parser.add_argument("-o", action="append", type=int, dest="opt_levels",
+ help=("Optimization levels to run compilation with. "
+ "Default is -1 which uses the optimization level "
+ "of the Python interpreter itself (see -O)."))
+ parser.add_argument("-e", metavar="DIR", dest="limit_sl_dest",
+ help="Ignore symlinks pointing outsite of the DIR")
+ parser.add_argument("--hardlink-dupes", action="store_true",
+ dest="hardlink_dupes",
+ help="Hardlink duplicated pyc files")
args = parser.parse_args()
compile_dests = args.compile_dest
@@ -406,7 +406,7 @@ def main():
# if flist is provided then load it
if args.flist:
try:
- with (sys.stdin if args.flist=='-' else
+ with (sys.stdin if args.flist=="-" else
open(args.flist, encoding="utf-8")) as f:
for line in f:
compile_dests.append(line.strip())
@@ -416,7 +416,7 @@ def main():
return False
if args.invalidation_mode:
- ivl_mode = args.invalidation_mode.replace('-', '_').upper()
+ ivl_mode = args.invalidation_mode.replace("-", "_").upper()
invalidation_mode = py_compile.PycInvalidationMode[ivl_mode]
else:
invalidation_mode = None
@@ -458,6 +458,6 @@ def main():
return True
-if __name__ == '__main__':
+if __name__ == "__main__":
exit_status = int(not main())
sys.exit(exit_status)
diff --git a/.venv3.10/Lib/concurrent/futures/__init__.py b/.venv3.10/Lib/concurrent/futures/__init__.py
index d746aeac..33aa4f06 100644
--- a/.venv3.10/Lib/concurrent/futures/__init__.py
+++ b/.venv3.10/Lib/concurrent/futures/__init__.py
@@ -3,7 +3,7 @@
"""Execute computations asynchronously using threads or processes."""
-__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+__author__ = "Brian Quinlan (brian@sweetapp.com)"
from concurrent.futures._base import (FIRST_COMPLETED,
FIRST_EXCEPTION,
@@ -18,34 +18,34 @@
as_completed)
__all__ = (
- 'FIRST_COMPLETED',
- 'FIRST_EXCEPTION',
- 'ALL_COMPLETED',
- 'CancelledError',
- 'TimeoutError',
- 'BrokenExecutor',
- 'Future',
- 'Executor',
- 'wait',
- 'as_completed',
- 'ProcessPoolExecutor',
- 'ThreadPoolExecutor',
+ "FIRST_COMPLETED",
+ "FIRST_EXCEPTION",
+ "ALL_COMPLETED",
+ "CancelledError",
+ "TimeoutError",
+ "BrokenExecutor",
+ "Future",
+ "Executor",
+ "wait",
+ "as_completed",
+ "ProcessPoolExecutor",
+ "ThreadPoolExecutor",
)
def __dir__():
- return __all__ + ('__author__', '__doc__')
+ return __all__ + ("__author__", "__doc__")
def __getattr__(name):
global ProcessPoolExecutor, ThreadPoolExecutor
- if name == 'ProcessPoolExecutor':
+ if name == "ProcessPoolExecutor":
from .process import ProcessPoolExecutor as pe
ProcessPoolExecutor = pe
return pe
- if name == 'ThreadPoolExecutor':
+ if name == "ThreadPoolExecutor":
from .thread import ThreadPoolExecutor as te
ThreadPoolExecutor = te
return te
diff --git a/.venv3.10/Lib/concurrent/futures/_base.py b/.venv3.10/Lib/concurrent/futures/_base.py
index a329e74d..20719436 100644
--- a/.venv3.10/Lib/concurrent/futures/_base.py
+++ b/.venv3.10/Lib/concurrent/futures/_base.py
@@ -1,7 +1,7 @@
# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
-__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+__author__ = "Brian Quinlan (brian@sweetapp.com)"
import collections
import logging
@@ -9,19 +9,19 @@
import time
import types
-FIRST_COMPLETED = 'FIRST_COMPLETED'
-FIRST_EXCEPTION = 'FIRST_EXCEPTION'
-ALL_COMPLETED = 'ALL_COMPLETED'
-_AS_COMPLETED = '_AS_COMPLETED'
+FIRST_COMPLETED = "FIRST_COMPLETED"
+FIRST_EXCEPTION = "FIRST_EXCEPTION"
+ALL_COMPLETED = "ALL_COMPLETED"
+_AS_COMPLETED = "_AS_COMPLETED"
# Possible future states (for internal use by the futures package).
-PENDING = 'PENDING'
-RUNNING = 'RUNNING'
+PENDING = "PENDING"
+RUNNING = "RUNNING"
# The future was cancelled by the user...
-CANCELLED = 'CANCELLED'
+CANCELLED = "CANCELLED"
# ...and _Waiter.add_cancelled() was called by a worker.
-CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED'
-FINISHED = 'FINISHED'
+CANCELLED_AND_NOTIFIED = "CANCELLED_AND_NOTIFIED"
+FINISHED = "FINISHED"
_FUTURE_STATES = [
PENDING,
@@ -239,7 +239,7 @@ def as_completed(fs, timeout=None):
wait_timeout = end_time - time.monotonic()
if wait_timeout < 0:
raise TimeoutError(
- '%d (of %d) futures unfinished' % (
+ "%d (of %d) futures unfinished" % (
len(pending), total_futures))
waiter.event.wait(wait_timeout)
@@ -261,7 +261,7 @@ def as_completed(fs, timeout=None):
f._waiters.remove(waiter)
DoneAndNotDoneFutures = collections.namedtuple(
- 'DoneAndNotDoneFutures', 'done not_done')
+ "DoneAndNotDoneFutures", "done not_done")
def wait(fs, timeout=None, return_when=ALL_COMPLETED):
"""Wait for the futures in the given sequence to complete.
@@ -341,24 +341,24 @@ def _invoke_callbacks(self):
try:
callback(self)
except Exception:
- LOGGER.exception('exception calling callback for %r', self)
+ LOGGER.exception("exception calling callback for %r", self)
def __repr__(self):
with self._condition:
if self._state == FINISHED:
if self._exception:
- return '<%s at %#x state=%s raised %s>' % (
+ return "<%s at %#x state=%s raised %s>" % (
self.__class__.__name__,
id(self),
_STATE_TO_DESCRIPTION_MAP[self._state],
self._exception.__class__.__name__)
else:
- return '<%s at %#x state=%s returned %s>' % (
+ return "<%s at %#x state=%s returned %s>" % (
self.__class__.__name__,
id(self),
_STATE_TO_DESCRIPTION_MAP[self._state],
self._result.__class__.__name__)
- return '<%s at %#x state=%s>' % (
+ return "<%s at %#x state=%s>" % (
self.__class__.__name__,
id(self),
_STATE_TO_DESCRIPTION_MAP[self._state])
@@ -425,7 +425,7 @@ def add_done_callback(self, fn):
try:
fn(self)
except Exception:
- LOGGER.exception('exception calling callback for %r', self)
+ LOGGER.exception("exception calling callback for %r", self)
def result(self, timeout=None):
"""Return the result of the call that the future represents.
@@ -531,10 +531,10 @@ def set_running_or_notify_cancel(self):
self._state = RUNNING
return True
else:
- LOGGER.critical('Future %s in unexpected state: %s',
+ LOGGER.critical("Future %s in unexpected state: %s",
id(self),
self._state)
- raise RuntimeError('Future in unexpected state')
+ raise RuntimeError("Future in unexpected state")
def set_result(self, result):
"""Sets the return value of work associated with the future.
@@ -543,7 +543,7 @@ def set_result(self, result):
"""
with self._condition:
if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
- raise InvalidStateError('{}: {!r}'.format(self._state, self))
+ raise InvalidStateError("{}: {!r}".format(self._state, self))
self._result = result
self._state = FINISHED
for waiter in self._waiters:
@@ -558,7 +558,7 @@ def set_exception(self, exception):
"""
with self._condition:
if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
- raise InvalidStateError('{}: {!r}'.format(self._state, self))
+ raise InvalidStateError("{}: {!r}".format(self._state, self))
self._exception = exception
self._state = FINISHED
for waiter in self._waiters:
diff --git a/.venv3.10/Lib/concurrent/futures/process.py b/.venv3.10/Lib/concurrent/futures/process.py
index 81cc1fb6..9fc3d8d4 100644
--- a/.venv3.10/Lib/concurrent/futures/process.py
+++ b/.venv3.10/Lib/concurrent/futures/process.py
@@ -43,7 +43,7 @@
_ResultItems in "Result Q"
"""
-__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+__author__ = "Brian Quinlan (brian@sweetapp.com)"
import os
from concurrent.futures import _base
@@ -124,7 +124,7 @@ def __str__(self):
class _ExceptionWithTraceback:
def __init__(self, exc, tb):
tb = traceback.format_exception(type(exc), exc, tb)
- tb = ''.join(tb)
+ tb = "".join(tb)
self.exc = exc
# Traceback object needs to be garbage-collected as its frames
# contain references to all the objects in the exception scope
@@ -170,7 +170,7 @@ def __init__(self, max_size=0, *, ctx, pending_work_items, shutdown_lock,
def _on_queue_feeder_error(self, e, obj):
if isinstance(obj, _CallItem):
tb = traceback.format_exception(type(e), e, e.__traceback__)
- e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb)))
+ e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format("".join(tb)))
work_item = self.pending_work_items.pop(obj.work_id, None)
with self.shutdown_lock:
self.thread_wakeup.wakeup()
@@ -232,7 +232,7 @@ def _process_worker(call_queue, result_queue, initializer, initargs):
try:
initializer(*initargs)
except BaseException:
- _base.LOGGER.critical('Exception in initializer:', exc_info=True)
+ _base.LOGGER.critical("Exception in initializer:", exc_info=True)
# The parent will notice that the process stopped and
# mark the pool broken
return
@@ -285,8 +285,8 @@ def __init__(self, executor):
def weakref_cb(_,
thread_wakeup=self.thread_wakeup,
shutdown_lock=self.shutdown_lock):
- mp.util.debug('Executor collected: triggering callback for'
- ' QueueManager wakeup')
+ mp.util.debug("Executor collected: triggering callback for"
+ " QueueManager wakeup")
with shutdown_lock:
thread_wakeup.wakeup()
@@ -443,9 +443,9 @@ def terminate_broken(self, cause):
# Mark the process pool broken so that submits fail right now.
executor = self.executor_reference()
if executor is not None:
- executor._broken = ('A child process terminated '
- 'abruptly, the process pool is not '
- 'usable anymore')
+ executor._broken = ("A child process terminated "
+ "abruptly, the process pool is not "
+ "usable anymore")
executor._shutdown_thread = True
executor = None
@@ -603,13 +603,13 @@ def __init__(self, max_workers=None, mp_context=None,
if max_workers is None:
self._max_workers = os.cpu_count() or 1
- if sys.platform == 'win32':
+ if sys.platform == "win32":
self._max_workers = min(_MAX_WINDOWS_WORKERS,
self._max_workers)
else:
if max_workers <= 0:
raise ValueError("max_workers must be greater than 0")
- elif (sys.platform == 'win32' and
+ elif (sys.platform == "win32" and
max_workers > _MAX_WINDOWS_WORKERS):
raise ValueError(
f"max_workers must be <= {_MAX_WINDOWS_WORKERS}")
@@ -699,8 +699,8 @@ def _adjust_process_count(self):
def _launch_processes(self):
# https://github.com/python/cpython/issues/90622
assert not self._executor_manager_thread, (
- 'Processes cannot be fork()ed after the thread has started, '
- 'deadlock in the child processes could result.')
+ "Processes cannot be fork()ed after the thread has started, "
+ "deadlock in the child processes could result.")
for _ in range(len(self._processes), self._max_workers):
self._spawn_process()
@@ -719,10 +719,10 @@ def submit(self, fn, /, *args, **kwargs):
if self._broken:
raise BrokenProcessPool(self._broken)
if self._shutdown_thread:
- raise RuntimeError('cannot schedule new futures after shutdown')
+ raise RuntimeError("cannot schedule new futures after shutdown")
if _global_shutdown:
- raise RuntimeError('cannot schedule new futures after '
- 'interpreter shutdown')
+ raise RuntimeError("cannot schedule new futures after "
+ "interpreter shutdown")
f = _base.Future()
w = _WorkItem(f, fn, args, kwargs)
diff --git a/.venv3.10/Lib/concurrent/futures/thread.py b/.venv3.10/Lib/concurrent/futures/thread.py
index 51c942f5..7066e871 100644
--- a/.venv3.10/Lib/concurrent/futures/thread.py
+++ b/.venv3.10/Lib/concurrent/futures/thread.py
@@ -3,7 +3,7 @@
"""Implements ThreadPoolExecutor."""
-__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+__author__ = "Brian Quinlan (brian@sweetapp.com)"
from concurrent.futures import _base
import itertools
@@ -37,7 +37,7 @@ def _python_exit():
threading._register_atexit(_python_exit)
# At fork, reinitialize the `_global_shutdown_lock` lock in the child process
-if hasattr(os, 'register_at_fork'):
+if hasattr(os, "register_at_fork"):
os.register_at_fork(before=_global_shutdown_lock.acquire,
after_in_child=_global_shutdown_lock._at_fork_reinit,
after_in_parent=_global_shutdown_lock.release)
@@ -71,7 +71,7 @@ def _worker(executor_reference, work_queue, initializer, initargs):
try:
initializer(*initargs)
except BaseException:
- _base.LOGGER.critical('Exception in initializer:', exc_info=True)
+ _base.LOGGER.critical("Exception in initializer:", exc_info=True)
executor = executor_reference()
if executor is not None:
executor._initializer_failed()
@@ -106,7 +106,7 @@ def _worker(executor_reference, work_queue, initializer, initargs):
return
del executor
except BaseException:
- _base.LOGGER.critical('Exception in worker', exc_info=True)
+ _base.LOGGER.critical("Exception in worker", exc_info=True)
class BrokenThreadPool(_base.BrokenExecutor):
@@ -120,7 +120,7 @@ class ThreadPoolExecutor(_base.Executor):
# Used to assign unique thread names when thread_name_prefix is not supplied.
_counter = itertools.count().__next__
- def __init__(self, max_workers=None, thread_name_prefix='',
+ def __init__(self, max_workers=None, thread_name_prefix="",
initializer=None, initargs=()):
"""Initializes a new ThreadPoolExecutor instance.
@@ -164,10 +164,10 @@ def submit(self, fn, /, *args, **kwargs):
raise BrokenThreadPool(self._broken)
if self._shutdown:
- raise RuntimeError('cannot schedule new futures after shutdown')
+ raise RuntimeError("cannot schedule new futures after shutdown")
if _shutdown:
- raise RuntimeError('cannot schedule new futures after '
- 'interpreter shutdown')
+ raise RuntimeError("cannot schedule new futures after "
+ "interpreter shutdown")
f = _base.Future()
w = _WorkItem(f, fn, args, kwargs)
@@ -189,7 +189,7 @@ def weakref_cb(_, q=self._work_queue):
num_threads = len(self._threads)
if num_threads < self._max_workers:
- thread_name = '%s_%d' % (self._thread_name_prefix or self,
+ thread_name = "%s_%d" % (self._thread_name_prefix or self,
num_threads)
t = threading.Thread(name=thread_name, target=_worker,
args=(weakref.ref(self, weakref_cb),
@@ -202,8 +202,8 @@ def weakref_cb(_, q=self._work_queue):
def _initializer_failed(self):
with self._shutdown_lock:
- self._broken = ('A thread initializer failed, the thread pool '
- 'is not usable anymore')
+ self._broken = ("A thread initializer failed, the thread pool "
+ "is not usable anymore")
# Drain work queue and mark pending futures failed
while True:
try:
diff --git a/.venv3.10/Lib/configparser.py b/.venv3.10/Lib/configparser.py
index 78552708..e1ce2ad8 100644
--- a/.venv3.10/Lib/configparser.py
+++ b/.venv3.10/Lib/configparser.py
@@ -169,7 +169,7 @@
class Error(Exception):
"""Base class for ConfigParser exceptions."""
- def __init__(self, msg=''):
+ def __init__(self, msg=""):
self.message = msg
Exception.__init__(self, msg)
@@ -183,7 +183,7 @@ class NoSectionError(Error):
"""Raised when no section matches a requested option."""
def __init__(self, section):
- Error.__init__(self, 'No section: %r' % (section,))
+ Error.__init__(self, "No section: %r" % (section,))
self.section = section
self.args = (section, )
@@ -308,7 +308,7 @@ def __init__(self, source=None, filename=None):
raise ValueError("Required argument `source' not given.")
elif filename:
source = filename
- Error.__init__(self, 'Source contains parsing errors: %r' % source)
+ Error.__init__(self, "Source contains parsing errors: %r" % source)
self.source = source
self.errors = []
self.args = (source, )
@@ -335,7 +335,7 @@ def filename(self, value):
def append(self, lineno, line):
self.errors.append((lineno, line))
- self.message += '\n\t[line %2d]: %s' % (lineno, line)
+ self.message += "\n\t[line %2d]: %s" % (lineno, line)
class MissingSectionHeaderError(ParsingError):
@@ -344,7 +344,7 @@ class MissingSectionHeaderError(ParsingError):
def __init__(self, filename, lineno, line):
Error.__init__(
self,
- 'File contains no section headers.\nfile: %r, line: %d\n%r' %
+ "File contains no section headers.\nfile: %r, line: %d\n%r" %
(filename, lineno, line))
self.source = filename
self.lineno = lineno
@@ -394,14 +394,14 @@ class BasicInterpolation(Interpolation):
def before_get(self, parser, section, option, value, defaults):
L = []
self._interpolate_some(parser, option, L, value, section, defaults, 1)
- return ''.join(L)
+ return "".join(L)
def before_set(self, parser, section, option, value):
- tmp_value = value.replace('%%', '') # escaped percent signs
- tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
- if '%' in tmp_value:
+ tmp_value = value.replace("%%", "") # escaped percent signs
+ tmp_value = self._KEYCRE.sub("", tmp_value) # valid syntax
+ if "%" in tmp_value:
raise ValueError("invalid interpolation syntax in %r at "
- "position %d" % (value, tmp_value.find('%')))
+ "position %d" % (value, tmp_value.find("%")))
return value
def _interpolate_some(self, parser, option, accum, rest, section, map,
@@ -455,14 +455,14 @@ class ExtendedInterpolation(Interpolation):
def before_get(self, parser, section, option, value, defaults):
L = []
self._interpolate_some(parser, option, L, value, section, defaults, 1)
- return ''.join(L)
+ return "".join(L)
def before_set(self, parser, section, option, value):
- tmp_value = value.replace('$$', '') # escaped dollar signs
- tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
- if '$' in tmp_value:
+ tmp_value = value.replace("$$", "") # escaped dollar signs
+ tmp_value = self._KEYCRE.sub("", tmp_value) # valid syntax
+ if "$" in tmp_value:
raise ValueError("invalid interpolation syntax in %r at "
- "position %d" % (value, tmp_value.find('$')))
+ "position %d" % (value, tmp_value.find("$")))
return value
def _interpolate_some(self, parser, option, accum, rest, section, map,
@@ -488,7 +488,7 @@ def _interpolate_some(self, parser, option, accum, rest, section, map,
if m is None:
raise InterpolationSyntaxError(option, section,
"bad interpolation variable reference %r" % rest)
- path = m.group(1).split(':')
+ path = m.group(1).split(":")
rest = rest[m.end():]
sect = section
opt = option
@@ -596,12 +596,12 @@ class RawConfigParser(MutableMapping):
# Compiled regular expression for matching leading whitespace in a line
NONSPACECRE = re.compile(r"\S")
# Possible boolean values in the configuration.
- BOOLEAN_STATES = {'1': True, 'yes': True, 'true': True, 'on': True,
- '0': False, 'no': False, 'false': False, 'off': False}
+ BOOLEAN_STATES = {"1": True, "yes": True, "true": True, "on": True,
+ "0": False, "no": False, "false": False, "off": False}
def __init__(self, defaults=None, dict_type=_default_dict,
- allow_no_value=False, *, delimiters=('=', ':'),
- comment_prefixes=('#', ';'), inline_comment_prefixes=None,
+ allow_no_value=False, *, delimiters=("=", ":"),
+ comment_prefixes=("#", ";"), inline_comment_prefixes=None,
strict=True, empty_lines_in_values=True,
default_section=DEFAULTSECT,
interpolation=_UNSET, converters=_UNSET):
@@ -613,7 +613,7 @@ def __init__(self, defaults=None, dict_type=_default_dict,
self._proxies = self._dict()
self._proxies[default_section] = SectionProxy(self, default_section)
self._delimiters = tuple(delimiters)
- if delimiters == ('=', ':'):
+ if delimiters == ("=", ":"):
self._optcre = self.OPTCRE_NV if allow_no_value else self.OPTCRE
else:
d = "|".join(re.escape(d) for d in delimiters)
@@ -654,7 +654,7 @@ def add_section(self, section):
already exists. Raise ValueError if name is DEFAULT.
"""
if section == self.default_section:
- raise ValueError('Invalid section name: %r' % section)
+ raise ValueError("Invalid section name: %r" % section)
if section in self._sections:
raise DuplicateSectionError(section)
@@ -716,15 +716,15 @@ def read_file(self, f, source=None):
try:
source = f.name
except AttributeError:
- source = '??>'
+ source = "??>"
self._read(f, source)
- def read_string(self, string, source=''):
+ def read_string(self, string, source=""):
"""Read configuration from a given string."""
sfile = io.StringIO(string)
self.read_file(sfile, source)
- def read_dict(self, dictionary, source=''):
+ def read_dict(self, dictionary, source=""):
"""Read configuration from a dictionary.
Keys are section names, values are dictionaries with keys and values
@@ -931,7 +931,7 @@ def _write_section(self, fp, section_name, section_items, delimiter):
value = self._interpolation.before_write(self, section_name, key,
value)
if value is not None or not self._allow_no_value:
- value = delimiter + str(value).replace('\n', '\n\t')
+ value = delimiter + str(value).replace("\n", "\n\t")
else:
value = ""
fp.write("{}{}\n".format(key, value))
@@ -1022,7 +1022,7 @@ def _read(self, fp, fpname):
for lineno, line in enumerate(fp, start=1):
comment_start = sys.maxsize
# strip inline comments
- inline_prefixes = {p: -1 for p in self._inline_comment_prefixes}
+ inline_prefixes = dict.fromkeys(self._inline_comment_prefixes, -1)
while comment_start == sys.maxsize and inline_prefixes:
next_prefixes = {}
for prefix, index in inline_prefixes.items():
@@ -1049,7 +1049,7 @@ def _read(self, fp, fpname):
cursect is not None and
optname and
cursect[optname] is not None):
- cursect[optname].append('') # newlines added at join
+ cursect[optname].append("") # newlines added at join
else:
# empty line marks end of value
indent_level = sys.maxsize
@@ -1066,7 +1066,7 @@ def _read(self, fp, fpname):
# is it a section header?
mo = self.SECTCRE.match(value)
if mo:
- sectname = mo.group('header')
+ sectname = mo.group("header")
if sectname in self._sections:
if self._strict and sectname in elements_added:
raise DuplicateSectionError(sectname, fpname,
@@ -1089,7 +1089,7 @@ def _read(self, fp, fpname):
else:
mo = self._optcre.match(value)
if mo:
- optname, vi, optval = mo.group('option', 'vi', 'value')
+ optname, vi, optval = mo.group("option", "vi", "value")
if not optname:
e = self._handle_error(e, fpname, lineno, line)
optname = self.optionxform(optname.rstrip())
@@ -1124,7 +1124,7 @@ def _join_multiline_values(self):
for section, options in all_sections:
for name, val in options.items():
if isinstance(val, list):
- val = '\n'.join(val).rstrip()
+ val = "\n".join(val).rstrip()
options[name] = self._interpolation.before_read(self,
section,
name, val)
@@ -1165,7 +1165,7 @@ def _convert_to_boolean(self, value):
"""Return a boolean value translating from other types if necessary.
"""
if value.lower() not in self.BOOLEAN_STATES:
- raise ValueError('Not a boolean: %s' % value)
+ raise ValueError("Not a boolean: %s" % value)
return self.BOOLEAN_STATES[value.lower()]
def _validate_value_types(self, *, section="", option="", value=""):
@@ -1247,12 +1247,12 @@ def __init__(self, parser, name):
self._parser = parser
self._name = name
for conv in parser.converters:
- key = 'get' + conv
+ key = "get" + conv
getter = functools.partial(self.get, _impl=getattr(parser, key))
setattr(self, key, getter)
def __repr__(self):
- return ''.format(self._name)
+ return "".format(self._name)
def __getitem__(self, key):
if not self._parser.has_option(self._name, key):
@@ -1326,18 +1326,18 @@ def __init__(self, parser):
m = self.GETTERCRE.match(getter)
if not m or not callable(getattr(self._parser, getter)):
continue
- self._data[m.group('name')] = None # See class docstring.
+ self._data[m.group("name")] = None # See class docstring.
def __getitem__(self, key):
return self._data[key]
def __setitem__(self, key, value):
try:
- k = 'get' + key
+ k = "get" + key
except TypeError:
- raise ValueError('Incompatible key: {} (type: {})'
- ''.format(key, type(key)))
- if k == 'get':
+ raise ValueError("Incompatible key: {} (type: {})"
+ "".format(key, type(key)))
+ if k == "get":
raise ValueError('Incompatible key: cannot use "" as a name')
self._data[key] = value
func = functools.partial(self._parser._get_conv, conv=value)
@@ -1349,7 +1349,7 @@ def __setitem__(self, key, value):
def __delitem__(self, key):
try:
- k = 'get' + (key or None)
+ k = "get" + (key or None)
except TypeError:
raise KeyError(key)
del self._data[key]
diff --git a/.venv3.10/Lib/contextvars.py b/.venv3.10/Lib/contextvars.py
index d78c80df..25e63425 100644
--- a/.venv3.10/Lib/contextvars.py
+++ b/.venv3.10/Lib/contextvars.py
@@ -1,4 +1,4 @@
from _contextvars import Context, ContextVar, Token, copy_context
-__all__ = ('Context', 'ContextVar', 'Token', 'copy_context')
+__all__ = ("Context", "ContextVar", "Token", "copy_context")
diff --git a/.venv3.10/Lib/copy.py b/.venv3.10/Lib/copy.py
index 1b276afe..b4ed7ad9 100644
--- a/.venv3.10/Lib/copy.py
+++ b/.venv3.10/Lib/copy.py
@@ -269,7 +269,7 @@ def _reconstruct(x, memo, func, args,
if state is not None:
if deep:
state = deepcopy(state, memo)
- if hasattr(y, '__setstate__'):
+ if hasattr(y, "__setstate__"):
y.__setstate__(state)
else:
if isinstance(state, tuple) and len(state) == 2:
diff --git a/.venv3.10/Lib/copyreg.py b/.venv3.10/Lib/copyreg.py
index 356db6f0..061559b9 100644
--- a/.venv3.10/Lib/copyreg.py
+++ b/.venv3.10/Lib/copyreg.py
@@ -37,7 +37,8 @@ def pickle_complex(c):
pickle(complex, pickle_complex, complex)
def pickle_union(obj):
- import functools, operator
+ import functools
+ import operator
return functools.reduce, (operator.or_, obj.__args__)
pickle(type(int | str), pickle_union)
@@ -62,7 +63,7 @@ def _reduce_ex(self, proto):
assert proto < 2
cls = self.__class__
for base in cls.__mro__:
- if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE:
+ if hasattr(base, "__flags__") and not base.__flags__ & _HEAPTYPE:
break
new = base.__new__
if isinstance(new, _new_type) and new.__self__ is base:
@@ -131,7 +132,7 @@ class found there. (This assumes classes don't modify their
# Slots found -- gather slot names from all base classes
for c in cls.__mro__:
if "__slots__" in c.__dict__:
- slots = c.__dict__['__slots__']
+ slots = c.__dict__["__slots__"]
# if class has a single slot, it can be given as a string
if isinstance(slots, str):
slots = (slots,)
@@ -140,10 +141,10 @@ class found there. (This assumes classes don't modify their
if name in ("__dict__", "__weakref__"):
continue
# mangled names
- elif name.startswith('__') and not name.endswith('__'):
- stripped = c.__name__.lstrip('_')
+ elif name.startswith("__") and not name.endswith("__"):
+ stripped = c.__name__.lstrip("_")
if stripped:
- names.append('_%s%s' % (stripped, name))
+ names.append("_%s%s" % (stripped, name))
else:
names.append(name)
else:
diff --git a/.venv3.10/Lib/crypt.py b/.venv3.10/Lib/crypt.py
index b296c3ed..e1a1fcf3 100644
--- a/.venv3.10/Lib/crypt.py
+++ b/.venv3.10/Lib/crypt.py
@@ -5,7 +5,7 @@
try:
import _crypt
except ModuleNotFoundError:
- if _sys.platform == 'win32':
+ if _sys.platform == "win32":
raise ImportError("The crypt module is not supported on Windows")
else:
raise ImportError("The required _crypt module was not built as part of CPython")
@@ -16,17 +16,17 @@
from collections import namedtuple as _namedtuple
-_saltchars = _string.ascii_letters + _string.digits + './'
+_saltchars = _string.ascii_letters + _string.digits + "./"
_sr = _SystemRandom()
-class _Method(_namedtuple('_Method', 'name ident salt_chars total_size')):
+class _Method(_namedtuple("_Method", "name ident salt_chars total_size")):
"""Class representing a salt method per the Modular Crypt Format or the
legacy 2-character crypt method."""
def __repr__(self):
- return ''.format(self.name)
+ return "".format(self.name)
def mksalt(method=None, *, rounds=None):
@@ -38,32 +38,32 @@ def mksalt(method=None, *, rounds=None):
if method is None:
method = methods[0]
if rounds is not None and not isinstance(rounds, int):
- raise TypeError(f'{rounds.__class__.__name__} object cannot be '
- f'interpreted as an integer')
+ raise TypeError(f"{rounds.__class__.__name__} object cannot be "
+ f"interpreted as an integer")
if not method.ident: # traditional
- s = ''
+ s = ""
else: # modular
- s = f'${method.ident}$'
+ s = f"${method.ident}$"
- if method.ident and method.ident[0] == '2': # Blowfish variants
+ if method.ident and method.ident[0] == "2": # Blowfish variants
if rounds is None:
log_rounds = 12
else:
log_rounds = int.bit_length(rounds-1)
if rounds != 1 << log_rounds:
- raise ValueError('rounds must be a power of 2')
+ raise ValueError("rounds must be a power of 2")
if not 4 <= log_rounds <= 31:
- raise ValueError('rounds out of the range 2**4 to 2**31')
- s += f'{log_rounds:02d}$'
- elif method.ident in ('5', '6'): # SHA-2
+ raise ValueError("rounds out of the range 2**4 to 2**31")
+ s += f"{log_rounds:02d}$"
+ elif method.ident in ("5", "6"): # SHA-2
if rounds is not None:
if not 1000 <= rounds <= 999_999_999:
- raise ValueError('rounds out of the range 1000 to 999_999_999')
- s += f'rounds={rounds}$'
+ raise ValueError("rounds out of the range 1000 to 999_999_999")
+ s += f"rounds={rounds}$"
elif rounds is not None:
raise ValueError(f"{method} doesn't support the rounds argument")
- s += ''.join(_sr.choice(_saltchars) for char in range(method.salt_chars))
+ s += "".join(_sr.choice(_saltchars) for char in range(method.salt_chars))
return s
@@ -87,11 +87,11 @@ def crypt(word, salt=None):
def _add_method(name, *args, rounds=None):
method = _Method(name, *args)
- globals()['METHOD_' + name] = method
+ globals()["METHOD_" + name] = method
salt = mksalt(method, rounds=rounds)
result = None
try:
- result = crypt('', salt)
+ result = crypt("", salt)
except OSError as e:
# Not all libc libraries support all encryption methods.
if e.errno in {errno.EINVAL, errno.EPERM, errno.ENOSYS}:
@@ -102,19 +102,19 @@ def _add_method(name, *args, rounds=None):
return True
return False
-_add_method('SHA512', '6', 16, 106)
-_add_method('SHA256', '5', 16, 63)
+_add_method("SHA512", "6", 16, 106)
+_add_method("SHA256", "5", 16, 63)
# Choose the strongest supported version of Blowfish hashing.
# Early versions have flaws. Version 'a' fixes flaws of
# the initial implementation, 'b' fixes flaws of 'a'.
# 'y' is the same as 'b', for compatibility
# with openwall crypt_blowfish.
-for _v in 'b', 'y', 'a', '':
- if _add_method('BLOWFISH', '2' + _v, 22, 59 + len(_v), rounds=1<<4):
+for _v in "b", "y", "a", "":
+ if _add_method("BLOWFISH", "2" + _v, 22, 59 + len(_v), rounds=1<<4):
break
-_add_method('MD5', '1', 8, 34)
-_add_method('CRYPT', None, 2, 13)
+_add_method("MD5", "1", 8, 34)
+_add_method("CRYPT", None, 2, 13)
del _v, _add_method
diff --git a/.venv3.10/Lib/csv.py b/.venv3.10/Lib/csv.py
index bb3ee269..44df4881 100644
--- a/.venv3.10/Lib/csv.py
+++ b/.venv3.10/Lib/csv.py
@@ -53,26 +53,26 @@ def _validate(self):
class excel(Dialect):
"""Describe the usual properties of Excel-generated CSV files."""
- delimiter = ','
+ delimiter = ","
quotechar = '"'
doublequote = True
skipinitialspace = False
- lineterminator = '\r\n'
+ lineterminator = "\r\n"
quoting = QUOTE_MINIMAL
register_dialect("excel", excel)
class excel_tab(excel):
"""Describe the usual properties of Excel-generated TAB-delimited files."""
- delimiter = '\t'
+ delimiter = "\t"
register_dialect("excel-tab", excel_tab)
class unix_dialect(Dialect):
"""Describe the usual properties of Unix-generated CSV files."""
- delimiter = ','
+ delimiter = ","
quotechar = '"'
doublequote = True
skipinitialspace = False
- lineterminator = '\n'
+ lineterminator = "\n"
quoting = QUOTE_ALL
register_dialect("unix", unix_dialect)
@@ -169,7 +169,7 @@ class Sniffer:
'''
def __init__(self):
# in case there is more than one possible delimiter
- self.preferred = [',', '\t', ';', ' ', ':']
+ self.preferred = [",", "\t", ";", " ", ":"]
def sniff(self, sample, delimiters=None):
@@ -188,7 +188,7 @@ def sniff(self, sample, delimiters=None):
class dialect(Dialect):
_name = "sniffed"
- lineterminator = '\r\n'
+ lineterminator = "\r\n"
quoting = QUOTE_MINIMAL
# escapechar = ''
@@ -225,25 +225,25 @@ def _guess_quote_and_delimiter(self, data, delimiters):
if not matches:
# (quotechar, doublequote, delimiter, skipinitialspace)
- return ('', False, None, 0)
+ return ("", False, None, 0)
quotes = {}
delims = {}
spaces = 0
groupindex = regexp.groupindex
for m in matches:
- n = groupindex['quote'] - 1
+ n = groupindex["quote"] - 1
key = m[n]
if key:
quotes[key] = quotes.get(key, 0) + 1
try:
- n = groupindex['delim'] - 1
+ n = groupindex["delim"] - 1
key = m[n]
except KeyError:
continue
if key and (delimiters is None or key in delimiters):
delims[key] = delims.get(key, 0) + 1
try:
- n = groupindex['space'] - 1
+ n = groupindex["space"] - 1
except KeyError:
continue
if m[n]:
@@ -254,18 +254,18 @@ def _guess_quote_and_delimiter(self, data, delimiters):
if delims:
delim = max(delims, key=delims.get)
skipinitialspace = delims[delim] == spaces
- if delim == '\n': # most likely a file with a single column
- delim = ''
+ if delim == "\n": # most likely a file with a single column
+ delim = ""
else:
# there is *no* delimiter, it's a single column of quoted data
- delim = ''
+ delim = ""
skipinitialspace = 0
# if we see an extra quote between delimiters, we've got a
# double quoted format
dq_regexp = re.compile(
r"((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$)" % \
- {'delim':re.escape(delim), 'quote':quotechar}, re.MULTILINE)
+ {"delim":re.escape(delim), "quote":quotechar}, re.MULTILINE)
@@ -296,7 +296,7 @@ def _guess_delimiter(self, data, delimiters):
additional chunks as necessary.
"""
- data = list(filter(None, data.split('\n')))
+ data = list(filter(None, data.split("\n")))
ascii = [chr(c) for c in range(127)] # 7-bit ASCII
@@ -359,7 +359,7 @@ def _guess_delimiter(self, data, delimiters):
end += chunkLength
if not delims:
- return ('', 0)
+ return ("", 0)
# if there's more than one, fall back to a 'preferred' list
if len(delims) > 1:
diff --git a/.venv3.10/Lib/ctypes/__init__.py b/.venv3.10/Lib/ctypes/__init__.py
index 4afa4ebd..b584a8af 100644
--- a/.venv3.10/Lib/ctypes/__init__.py
+++ b/.venv3.10/Lib/ctypes/__init__.py
@@ -1,6 +1,7 @@
"""create and manipulate C data types in Python"""
-import os as _os, sys as _sys
+import os as _os
+import sys as _sys
import types as _types
__version__ = "1.1.0"
@@ -27,7 +28,7 @@
# libraries. OS X 10.3 is Darwin 7, so we check for
# that.
- if int(_os.uname().release.split('.')[0]) < 8:
+ if int(_os.uname().release.split(".")[0]) < 8:
DEFAULT_MODE = RTLD_GLOBAL
from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
@@ -333,7 +334,7 @@ class CDLL(object):
_func_flags_ = _FUNCFLAG_CDECL
_func_restype_ = c_int
# default values for repr
- _name = ''
+ _name = ""
_handle = 0
_FuncPtr = None
@@ -361,7 +362,7 @@ def __init__(self, name, mode=DEFAULT_MODE, handle=None,
else:
import nt
mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
- if '/' in name or '\\' in name:
+ if "/" in name or "\\" in name:
self._name = nt._getfullpathname(self._name)
mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
@@ -382,7 +383,7 @@ def __repr__(self):
id(self) & (_sys.maxsize*2 + 1))
def __getattr__(self, name):
- if name.startswith('__') and name.endswith('__'):
+ if name.startswith("__") and name.endswith("__"):
raise AttributeError(name)
func = self.__getitem__(name)
setattr(self, name, func)
@@ -439,7 +440,7 @@ def __init__(self, dlltype):
self._dlltype = dlltype
def __getattr__(self, name):
- if name[0] == '_':
+ if name[0] == "_":
raise AttributeError(name)
dll = self._dlltype(name)
setattr(self, name, dll)
@@ -532,7 +533,7 @@ def wstring_at(ptr, size=-1):
if _os.name == "nt": # COM stuff
def DllGetClassObject(rclsid, riid, ppv):
try:
- ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
+ ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ["*"])
except ImportError:
return -2147221231 # CLASS_E_CLASSNOTAVAILABLE
else:
@@ -540,7 +541,7 @@ def DllGetClassObject(rclsid, riid, ppv):
def DllCanUnloadNow():
try:
- ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
+ ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ["*"])
except ImportError:
return 0 # S_OK
return ccom.DllCanUnloadNow()
diff --git a/.venv3.10/Lib/ctypes/_aix.py b/.venv3.10/Lib/ctypes/_aix.py
index fc3e95cb..21b2849d 100644
--- a/.venv3.10/Lib/ctypes/_aix.py
+++ b/.venv3.10/Lib/ctypes/_aix.py
@@ -75,10 +75,10 @@ def get_ld_header(p):
# "nested-function, but placed at module level
ld_header = None
for line in p.stdout:
- if line.startswith(('/', './', '../')):
+ if line.startswith(("/", "./", "../")):
ld_header = line
elif "INDEX" in line:
- return ld_header.rstrip('\n')
+ return ld_header.rstrip("\n")
return None
def get_ld_header_info(p):
@@ -140,7 +140,7 @@ def get_one_match(expr, lines):
When there is a match, strip leading "[" and trailing "]"
"""
# member names in the ld_headers output are between square brackets
- expr = rf'\[({expr})\]'
+ expr = rf"\[({expr})\]"
matches = list(filter(None, (re.search(expr, line) for line in lines)))
if len(matches) == 1:
return matches[0].group(1)
@@ -157,7 +157,7 @@ def get_legacy(members):
"""
if AIX_ABI == 64:
# AIX 64-bit member is one of shr64.o, shr_64.o, or shr4_64.o
- expr = r'shr4?_?64\.o'
+ expr = r"shr4?_?64\.o"
member = get_one_match(expr, members)
if member:
return member
@@ -165,7 +165,7 @@ def get_legacy(members):
# 32-bit legacy names - both shr.o and shr4.o exist.
# shr.o is the preferred name so we look for shr.o first
# i.e., shr4.o is returned only when shr.o does not exist
- for name in ['shr.o', 'shr4.o']:
+ for name in ["shr.o", "shr4.o"]:
member = get_one_match(re.escape(name), members)
if member:
return member
@@ -197,8 +197,8 @@ def get_version(name, members):
# any combination of additional 'dot' digits pairs are accepted
# anything more than libFOO.so.digits.digits.digits
# should be seen as a member name outside normal expectations
- exprs = [rf'lib{name}\.so\.[0-9]+[0-9.]*',
- rf'lib{name}_?64\.so\.[0-9]+[0-9.]*']
+ exprs = [rf"lib{name}\.so\.[0-9]+[0-9.]*",
+ rf"lib{name}_?64\.so\.[0-9]+[0-9.]*"]
for expr in exprs:
versions = []
for line in members:
@@ -206,7 +206,7 @@ def get_version(name, members):
if m:
versions.append(m.group(0))
if versions:
- return _last_version(versions, '.')
+ return _last_version(versions, ".")
return None
def get_member(name, members):
@@ -219,12 +219,12 @@ def get_member(name, members):
and finally, legacy AIX naming scheme.
"""
# look first for a generic match - prepend lib and append .so
- expr = rf'lib{name}\.so'
+ expr = rf"lib{name}\.so"
member = get_one_match(expr, members)
if member:
return member
elif AIX_ABI == 64:
- expr = rf'lib{name}64\.so'
+ expr = rf"lib{name}64\.so"
member = get_one_match(expr, members)
if member:
return member
@@ -277,7 +277,7 @@ def find_shared(paths, name):
continue
# "lib" is prefixed to emulate compiler name resolution,
# e.g., -lc to libc
- base = f'lib{name}.a'
+ base = f"lib{name}.a"
archive = path.join(dir, base)
if path.exists(archive):
members = get_shared(get_ld_headers(archive))
diff --git a/.venv3.10/Lib/ctypes/macholib/__init__.py b/.venv3.10/Lib/ctypes/macholib/__init__.py
index 5621defc..4cdf7e67 100644
--- a/.venv3.10/Lib/ctypes/macholib/__init__.py
+++ b/.venv3.10/Lib/ctypes/macholib/__init__.py
@@ -6,4 +6,4 @@
And also Apple's documentation.
"""
-__version__ = '1.0'
+__version__ = "1.0"
diff --git a/.venv3.10/Lib/ctypes/macholib/dyld.py b/.venv3.10/Lib/ctypes/macholib/dyld.py
index 82a4b4fd..9d6d8ec8 100644
--- a/.venv3.10/Lib/ctypes/macholib/dyld.py
+++ b/.venv3.10/Lib/ctypes/macholib/dyld.py
@@ -13,8 +13,8 @@ def _dyld_shared_cache_contains_path(*args):
raise NotImplementedError
__all__ = [
- 'dyld_find', 'framework_find',
- 'framework_info', 'dylib_info',
+ "dyld_find", "framework_find",
+ "framework_info", "dylib_info",
]
# These are the defaults as per man dyld(1)
@@ -39,24 +39,24 @@ def dyld_env(env, var):
rval = env.get(var)
if rval is None:
return []
- return rval.split(':')
+ return rval.split(":")
def dyld_image_suffix(env=None):
if env is None:
env = os.environ
- return env.get('DYLD_IMAGE_SUFFIX')
+ return env.get("DYLD_IMAGE_SUFFIX")
def dyld_framework_path(env=None):
- return dyld_env(env, 'DYLD_FRAMEWORK_PATH')
+ return dyld_env(env, "DYLD_FRAMEWORK_PATH")
def dyld_library_path(env=None):
- return dyld_env(env, 'DYLD_LIBRARY_PATH')
+ return dyld_env(env, "DYLD_LIBRARY_PATH")
def dyld_fallback_framework_path(env=None):
- return dyld_env(env, 'DYLD_FALLBACK_FRAMEWORK_PATH')
+ return dyld_env(env, "DYLD_FALLBACK_FRAMEWORK_PATH")
def dyld_fallback_library_path(env=None):
- return dyld_env(env, 'DYLD_FALLBACK_LIBRARY_PATH')
+ return dyld_env(env, "DYLD_FALLBACK_LIBRARY_PATH")
def dyld_image_suffix_search(iterator, env=None):
"""For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics"""
@@ -65,8 +65,8 @@ def dyld_image_suffix_search(iterator, env=None):
return iterator
def _inject(iterator=iterator, suffix=suffix):
for path in iterator:
- if path.endswith('.dylib'):
- yield path[:-len('.dylib')] + suffix + '.dylib'
+ if path.endswith(".dylib"):
+ yield path[:-len(".dylib")] + suffix + ".dylib"
else:
yield path + suffix
yield path
@@ -82,7 +82,7 @@ def dyld_override_search(name, env=None):
if framework is not None:
for path in dyld_framework_path(env):
- yield os.path.join(path, framework['name'])
+ yield os.path.join(path, framework["name"])
# If DYLD_LIBRARY_PATH is set then use the first file that exists
# in the path. If none use the original name.
@@ -96,9 +96,9 @@ def dyld_executable_path_search(name, executable_path=None):
if not executable_path:
import sys
if sys.prefix:
- executable_path = os.path.join(sys.prefix, 'bin')
- if name.startswith('@executable_path/') and executable_path is not None:
- yield os.path.join(executable_path, name[len('@executable_path/'):])
+ executable_path = os.path.join(sys.prefix, "bin")
+ if name.startswith("@executable_path/") and executable_path is not None:
+ yield os.path.join(executable_path, name[len("@executable_path/"):])
def dyld_default_search(name, env=None):
yield name
@@ -108,7 +108,7 @@ def dyld_default_search(name, env=None):
if framework is not None:
fallback_framework_path = dyld_fallback_framework_path(env)
for path in fallback_framework_path:
- yield os.path.join(path, framework['name'])
+ yield os.path.join(path, framework["name"])
fallback_library_path = dyld_fallback_library_path(env)
for path in fallback_library_path:
@@ -116,7 +116,7 @@ def dyld_default_search(name, env=None):
if framework is not None and not fallback_framework_path:
for path in DEFAULT_FRAMEWORK_FALLBACK:
- yield os.path.join(path, framework['name'])
+ yield os.path.join(path, framework["name"])
if not fallback_library_path:
for path in DEFAULT_LIBRARY_FALLBACK:
@@ -156,10 +156,10 @@ def framework_find(fn, executable_path=None, env=None):
return dyld_find(fn, executable_path=executable_path, env=env)
except ValueError as e:
error = e
- fmwk_index = fn.rfind('.framework')
+ fmwk_index = fn.rfind(".framework")
if fmwk_index == -1:
fmwk_index = len(fn)
- fn += '.framework'
+ fn += ".framework"
fn = os.path.join(fn, os.path.basename(fn[:fmwk_index]))
try:
return dyld_find(fn, executable_path=executable_path, env=env)
@@ -170,8 +170,8 @@ def framework_find(fn, executable_path=None, env=None):
def test_dyld_find():
env = {}
- assert dyld_find('libSystem.dylib') == '/usr/lib/libSystem.dylib'
- assert dyld_find('System.framework/System') == '/System/Library/Frameworks/System.framework/System'
+ assert dyld_find("libSystem.dylib") == "/usr/lib/libSystem.dylib"
+ assert dyld_find("System.framework/System") == "/System/Library/Frameworks/System.framework/System"
-if __name__ == '__main__':
+if __name__ == "__main__":
test_dyld_find()
diff --git a/.venv3.10/Lib/ctypes/macholib/dylib.py b/.venv3.10/Lib/ctypes/macholib/dylib.py
index aa107507..cd46ec51 100644
--- a/.venv3.10/Lib/ctypes/macholib/dylib.py
+++ b/.venv3.10/Lib/ctypes/macholib/dylib.py
@@ -4,7 +4,7 @@
import re
-__all__ = ['dylib_info']
+__all__ = ["dylib_info"]
DYLIB_RE = re.compile(r"""(?x)
(?P^.*)(?:^|/)
@@ -51,13 +51,13 @@ def d(location=None, name=None, shortname=None, version=None, suffix=None):
version=version,
suffix=suffix
)
- assert dylib_info('completely/invalid') is None
- assert dylib_info('completely/invalide_debug') is None
- assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
- assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
- assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
- assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
- assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')
-
-if __name__ == '__main__':
+ assert dylib_info("completely/invalid") is None
+ assert dylib_info("completely/invalide_debug") is None
+ assert dylib_info("P/Foo.dylib") == d("P", "Foo.dylib", "Foo")
+ assert dylib_info("P/Foo_debug.dylib") == d("P", "Foo_debug.dylib", "Foo", suffix="debug")
+ assert dylib_info("P/Foo.A.dylib") == d("P", "Foo.A.dylib", "Foo", "A")
+ assert dylib_info("P/Foo_debug.A.dylib") == d("P", "Foo_debug.A.dylib", "Foo_debug", "A")
+ assert dylib_info("P/Foo.A_debug.dylib") == d("P", "Foo.A_debug.dylib", "Foo", "A", "debug")
+
+if __name__ == "__main__":
test_dylib_info()
diff --git a/.venv3.10/Lib/ctypes/macholib/framework.py b/.venv3.10/Lib/ctypes/macholib/framework.py
index ad6ed554..d362a3e0 100644
--- a/.venv3.10/Lib/ctypes/macholib/framework.py
+++ b/.venv3.10/Lib/ctypes/macholib/framework.py
@@ -4,7 +4,7 @@
import re
-__all__ = ['framework_info']
+__all__ = ["framework_info"]
STRICT_FRAMEWORK_RE = re.compile(r"""(?x)
(?P^.*)(?:^|/)
@@ -50,16 +50,16 @@ def d(location=None, name=None, shortname=None, version=None, suffix=None):
version=version,
suffix=suffix
)
- assert framework_info('completely/invalid') is None
- assert framework_info('completely/invalid/_debug') is None
- assert framework_info('P/F.framework') is None
- assert framework_info('P/F.framework/_debug') is None
- assert framework_info('P/F.framework/F') == d('P', 'F.framework/F', 'F')
- assert framework_info('P/F.framework/F_debug') == d('P', 'F.framework/F_debug', 'F', suffix='debug')
- assert framework_info('P/F.framework/Versions') is None
- assert framework_info('P/F.framework/Versions/A') is None
- assert framework_info('P/F.framework/Versions/A/F') == d('P', 'F.framework/Versions/A/F', 'F', 'A')
- assert framework_info('P/F.framework/Versions/A/F_debug') == d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug')
+ assert framework_info("completely/invalid") is None
+ assert framework_info("completely/invalid/_debug") is None
+ assert framework_info("P/F.framework") is None
+ assert framework_info("P/F.framework/_debug") is None
+ assert framework_info("P/F.framework/F") == d("P", "F.framework/F", "F")
+ assert framework_info("P/F.framework/F_debug") == d("P", "F.framework/F_debug", "F", suffix="debug")
+ assert framework_info("P/F.framework/Versions") is None
+ assert framework_info("P/F.framework/Versions/A") is None
+ assert framework_info("P/F.framework/Versions/A/F") == d("P", "F.framework/Versions/A/F", "F", "A")
+ assert framework_info("P/F.framework/Versions/A/F_debug") == d("P", "F.framework/Versions/A/F_debug", "F", "A", "debug")
-if __name__ == '__main__':
+if __name__ == "__main__":
test_framework_info()
diff --git a/.venv3.10/Lib/ctypes/test/__init__.py b/.venv3.10/Lib/ctypes/test/__init__.py
index 6e496fa5..8399917e 100644
--- a/.venv3.10/Lib/ctypes/test/__init__.py
+++ b/.venv3.10/Lib/ctypes/test/__init__.py
@@ -5,12 +5,12 @@
# skip tests if _ctypes was not built
-ctypes = import_helper.import_module('ctypes')
+ctypes = import_helper.import_module("ctypes")
ctypes_symbols = dir(ctypes)
def need_symbol(name):
return unittest.skipUnless(name in ctypes_symbols,
- '{!r} is required'.format(name))
+ "{!r} is required".format(name))
def load_tests(*args):
return support.load_package_tests(os.path.dirname(__file__), *args)
diff --git a/.venv3.10/Lib/ctypes/test/__main__.py b/.venv3.10/Lib/ctypes/test/__main__.py
index 362a9ec8..20c011ae 100644
--- a/.venv3.10/Lib/ctypes/test/__main__.py
+++ b/.venv3.10/Lib/ctypes/test/__main__.py
@@ -1,4 +1,3 @@
-from ctypes.test import load_tests
import unittest
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_arrays.py b/.venv3.10/Lib/ctypes/test/test_arrays.py
index 14603b70..eb1c79da 100644
--- a/.venv3.10/Lib/ctypes/test/test_arrays.py
+++ b/.venv3.10/Lib/ctypes/test/test_arrays.py
@@ -117,7 +117,7 @@ def test_from_address(self):
self.assertEqual(sz[1:4:2], b"o")
self.assertEqual(sz.value, b"foo")
- @need_symbol('create_unicode_buffer')
+ @need_symbol("create_unicode_buffer")
def test_from_addressW(self):
p = create_unicode_buffer("foo")
sz = (c_wchar * 3).from_address(addressof(p))
@@ -229,10 +229,10 @@ def test_bpo36504_signed_int_overflow(self):
with self.assertRaises(OverflowError):
c_char * sys.maxsize * 2
- @unittest.skipUnless(sys.maxsize > 2**32, 'requires 64bit platform')
+ @unittest.skipUnless(sys.maxsize > 2**32, "requires 64bit platform")
@bigmemtest(size=_2G, memuse=1, dry_run=False)
def test_large_array(self, size):
c_char * size
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_as_parameter.py b/.venv3.10/Lib/ctypes/test/test_as_parameter.py
index f9d27cb8..68c7de91 100644
--- a/.venv3.10/Lib/ctypes/test/test_as_parameter.py
+++ b/.venv3.10/Lib/ctypes/test/test_as_parameter.py
@@ -18,7 +18,7 @@ class BasicWrapTestCase(unittest.TestCase):
def wrap(self, param):
return param
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_wchar_parm(self):
f = dll._testfunc_i_bhilfd
f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double]
@@ -226,5 +226,5 @@ class AsParamPropertyWrapperTestCase(BasicWrapTestCase):
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_bitfields.py b/.venv3.10/Lib/ctypes/test/test_bitfields.py
index 66acd62e..4863a407 100644
--- a/.venv3.10/Lib/ctypes/test/test_bitfields.py
+++ b/.venv3.10/Lib/ctypes/test/test_bitfields.py
@@ -38,20 +38,20 @@ def test_ints(self):
for name in "ABCDEFGHI":
b = BITS()
setattr(b, name, i)
- self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
+ self.assertEqual(getattr(b, name), func(byref(b), name.encode("ascii")))
# bpo-46913: _ctypes/cfield.c h_get() has an undefined behavior
@support.skip_if_sanitizer(ub=True)
def test_shorts(self):
b = BITS()
name = "M"
- if func(byref(b), name.encode('ascii')) == 999:
+ if func(byref(b), name.encode("ascii")) == 999:
self.skipTest("Compiler does not support signed short bitfields")
for i in range(256):
for name in "MNOPQRS":
b = BITS()
setattr(b, name, i)
- self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii')))
+ self.assertEqual(getattr(b, name), func(byref(b), name.encode("ascii")))
signed_int_types = (c_byte, c_short, c_int, c_long, c_longlong)
unsigned_int_types = (c_ubyte, c_ushort, c_uint, c_ulong, c_ulonglong)
@@ -122,37 +122,37 @@ def fail_fields(self, *fields):
def test_nonint_types(self):
# bit fields are not allowed on non-integer types.
result = self.fail_fields(("a", c_char_p, 1))
- self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_char_p'))
+ self.assertEqual(result, (TypeError, "bit fields not allowed for type c_char_p"))
result = self.fail_fields(("a", c_void_p, 1))
- self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_void_p'))
+ self.assertEqual(result, (TypeError, "bit fields not allowed for type c_void_p"))
if c_int != c_long:
result = self.fail_fields(("a", POINTER(c_int), 1))
- self.assertEqual(result, (TypeError, 'bit fields not allowed for type LP_c_int'))
+ self.assertEqual(result, (TypeError, "bit fields not allowed for type LP_c_int"))
result = self.fail_fields(("a", c_char, 1))
- self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_char'))
+ self.assertEqual(result, (TypeError, "bit fields not allowed for type c_char"))
class Dummy(Structure):
_fields_ = []
result = self.fail_fields(("a", Dummy, 1))
- self.assertEqual(result, (TypeError, 'bit fields not allowed for type Dummy'))
+ self.assertEqual(result, (TypeError, "bit fields not allowed for type Dummy"))
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_c_wchar(self):
result = self.fail_fields(("a", c_wchar, 1))
self.assertEqual(result,
- (TypeError, 'bit fields not allowed for type c_wchar'))
+ (TypeError, "bit fields not allowed for type c_wchar"))
def test_single_bitfield_size(self):
for c_typ in int_types:
result = self.fail_fields(("a", c_typ, -1))
- self.assertEqual(result, (ValueError, 'number of bits invalid for bit field'))
+ self.assertEqual(result, (ValueError, "number of bits invalid for bit field"))
result = self.fail_fields(("a", c_typ, 0))
- self.assertEqual(result, (ValueError, 'number of bits invalid for bit field'))
+ self.assertEqual(result, (ValueError, "number of bits invalid for bit field"))
class X(Structure):
_fields_ = [("a", c_typ, 1)]
@@ -163,7 +163,7 @@ class X(Structure):
self.assertEqual(sizeof(X), sizeof(c_typ))
result = self.fail_fields(("a", c_typ, sizeof(c_typ)*8 + 1))
- self.assertEqual(result, (ValueError, 'number of bits invalid for bit field'))
+ self.assertEqual(result, (ValueError, "number of bits invalid for bit field"))
def test_multi_bitfields_size(self):
class X(Structure):
@@ -245,7 +245,7 @@ class Y(Structure):
_anonymous_ = ["_"]
_fields_ = [("_", X)]
- @need_symbol('c_uint32')
+ @need_symbol("c_uint32")
def test_uint32(self):
class X(Structure):
_fields_ = [("a", c_uint32, 32)]
@@ -255,7 +255,7 @@ class X(Structure):
x.a = 0xFDCBA987
self.assertEqual(x.a, 0xFDCBA987)
- @need_symbol('c_uint64')
+ @need_symbol("c_uint64")
def test_uint64(self):
class X(Structure):
_fields_ = [("a", c_uint64, 64)]
@@ -265,7 +265,7 @@ class X(Structure):
x.a = 0xFEDCBA9876543211
self.assertEqual(x.a, 0xFEDCBA9876543211)
- @need_symbol('c_uint32')
+ @need_symbol("c_uint32")
def test_uint32_swap_little_endian(self):
# Issue #23319
class Little(LittleEndianStructure):
@@ -277,9 +277,9 @@ class Little(LittleEndianStructure):
x.a = 0xabcdef
x.b = 1
x.c = 2
- self.assertEqual(b, b'\xef\xcd\xab\x21')
+ self.assertEqual(b, b"\xef\xcd\xab\x21")
- @need_symbol('c_uint32')
+ @need_symbol("c_uint32")
def test_uint32_swap_big_endian(self):
# Issue #23319
class Big(BigEndianStructure):
@@ -291,7 +291,7 @@ class Big(BigEndianStructure):
x.a = 0xabcdef
x.b = 1
x.c = 2
- self.assertEqual(b, b'\xab\xcd\xef\x12')
+ self.assertEqual(b, b"\xab\xcd\xef\x12")
if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_buffers.py b/.venv3.10/Lib/ctypes/test/test_buffers.py
index 15782be7..baabb8d8 100644
--- a/.venv3.10/Lib/ctypes/test/test_buffers.py
+++ b/.venv3.10/Lib/ctypes/test/test_buffers.py
@@ -27,7 +27,7 @@ def test_buffer_interface(self):
self.assertEqual(len(bytearray(create_string_buffer(0))), 0)
self.assertEqual(len(bytearray(create_string_buffer(1))), 1)
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_unicode_buffer(self):
b = create_unicode_buffer(32)
self.assertEqual(len(b), 32)
@@ -47,7 +47,7 @@ def test_unicode_buffer(self):
self.assertRaises(TypeError, create_unicode_buffer, b"abc")
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_unicode_conversion(self):
b = create_unicode_buffer("abc")
self.assertEqual(len(b), 4) # trailing nul char
@@ -60,13 +60,13 @@ def test_unicode_conversion(self):
self.assertEqual(b[::2], "ac")
self.assertEqual(b[::5], "a")
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_create_unicode_buffer_non_bmp(self):
expected = 5 if sizeof(c_wchar) == 2 else 3
- for s in '\U00010000\U00100000', '\U00010000\U0010ffff':
+ for s in "\U00010000\U00100000", "\U00010000\U0010ffff":
b = create_unicode_buffer(s)
self.assertEqual(len(b), expected)
- self.assertEqual(b[-1], '\0')
+ self.assertEqual(b[-1], "\0")
if __name__ == "__main__":
diff --git a/.venv3.10/Lib/ctypes/test/test_bytes.py b/.venv3.10/Lib/ctypes/test/test_bytes.py
index 092ec5af..94b6226e 100644
--- a/.venv3.10/Lib/ctypes/test/test_bytes.py
+++ b/.venv3.10/Lib/ctypes/test/test_bytes.py
@@ -12,7 +12,7 @@ def test_c_char(self):
x.value = "y"
c_char.from_param(b"x")
self.assertRaises(TypeError, c_char.from_param, "x")
- self.assertIn('xbd', repr(c_char.from_param(b"\xbd")))
+ self.assertIn("xbd", repr(c_char.from_param(b"\xbd")))
(c_char * 3)(b"a", b"b", b"c")
self.assertRaises(TypeError, c_char * 3, "a", "b", "c")
@@ -53,7 +53,7 @@ class X(Structure):
self.assertEqual(x.a, "abc")
self.assertEqual(type(x.a), str)
- @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+ @unittest.skipUnless(sys.platform == "win32", "Windows-specific test")
def test_BSTR(self):
from _ctypes import _SimpleCData
class BSTR(_SimpleCData):
@@ -62,5 +62,5 @@ class BSTR(_SimpleCData):
BSTR("abc")
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_byteswap.py b/.venv3.10/Lib/ctypes/test/test_byteswap.py
index 01c97e83..e9256185 100644
--- a/.venv3.10/Lib/ctypes/test/test_byteswap.py
+++ b/.venv3.10/Lib/ctypes/test/test_byteswap.py
@@ -1,4 +1,8 @@
-import sys, unittest, struct, math, ctypes
+import sys
+import unittest
+import struct
+import math
+import ctypes
from binascii import hexlify
from ctypes import *
@@ -14,7 +18,7 @@ def bin(s):
# For Structures and Unions, these types are created on demand.
class Test(unittest.TestCase):
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_X(self):
print(sys.byteorder, file=sys.stderr)
for i in range(32):
@@ -211,8 +215,8 @@ def test_struct_struct(self):
# create nested structures with given byteorders and set memory to data
for nested, data in (
- (BigEndianStructure, b'\0\0\0\1\0\0\0\2'),
- (LittleEndianStructure, b'\1\0\0\0\2\0\0\0'),
+ (BigEndianStructure, b"\0\0\0\1\0\0\0\2"),
+ (LittleEndianStructure, b"\1\0\0\0\2\0\0\0"),
):
for parent in (
BigEndianStructure,
diff --git a/.venv3.10/Lib/ctypes/test/test_callbacks.py b/.venv3.10/Lib/ctypes/test/test_callbacks.py
index d8e9c5a7..da0af404 100644
--- a/.venv3.10/Lib/ctypes/test/test_callbacks.py
+++ b/.venv3.10/Lib/ctypes/test/test_callbacks.py
@@ -92,7 +92,7 @@ def test_char(self):
# disabled: would now (correctly) raise a RuntimeWarning about
# a memory leak. A callback function cannot return a non-integral
# C type without causing a memory leak.
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_char_p(self):
self.check_type(c_char_p, "abc")
self.check_type(c_char_p, "def")
@@ -147,7 +147,7 @@ def __del__(self):
CFUNCTYPE(None)(lambda x=Nasty(): None)
-@need_symbol('WINFUNCTYPE')
+@need_symbol("WINFUNCTYPE")
class StdcallCallbacks(Callbacks):
try:
functype = WINFUNCTYPE
@@ -182,7 +182,7 @@ def test_issue_8959_a(self):
from ctypes.util import find_library
libc_path = find_library("c")
if not libc_path:
- self.skipTest('could not find libc')
+ self.skipTest("could not find libc")
libc = CDLL(libc_path)
@CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))
@@ -194,7 +194,7 @@ def cmp_func(a, b):
libc.qsort(array, len(array), sizeof(c_int), cmp_func)
self.assertEqual(array[:], [1, 5, 7, 33, 99])
- @need_symbol('WINFUNCTYPE')
+ @need_symbol("WINFUNCTYPE")
def test_issue_8959_b(self):
from ctypes.wintypes import BOOL, HWND, LPARAM
global windowCount
@@ -249,9 +249,9 @@ class Check: pass
# This should mirror the structure in Modules/_ctypes/_ctypes_test.c
class X(Structure):
_fields_ = [
- ('first', c_ulong),
- ('second', c_ulong),
- ('third', c_ulong),
+ ("first", c_ulong),
+ ("second", c_ulong),
+ ("third", c_ulong),
]
def callback(check, s):
@@ -320,5 +320,5 @@ def func():
self.assertIs(cm.unraisable.object, func)
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_cast.py b/.venv3.10/Lib/ctypes/test/test_cast.py
index 6878f973..ab75d299 100644
--- a/.venv3.10/Lib/ctypes/test/test_cast.py
+++ b/.venv3.10/Lib/ctypes/test/test_cast.py
@@ -35,17 +35,17 @@ def test_p2a_objects(self):
array = (c_char_p * 5)()
self.assertEqual(array._objects, None)
array[0] = b"foo bar"
- self.assertEqual(array._objects, {'0': b"foo bar"})
+ self.assertEqual(array._objects, {"0": b"foo bar"})
p = cast(array, POINTER(c_char_p))
# array and p share a common _objects attribute
self.assertIs(p._objects, array._objects)
- self.assertEqual(array._objects, {'0': b"foo bar", id(array): array})
+ self.assertEqual(array._objects, {"0": b"foo bar", id(array): array})
p[0] = b"spam spam"
- self.assertEqual(p._objects, {'0': b"spam spam", id(array): array})
+ self.assertEqual(p._objects, {"0": b"spam spam", id(array): array})
self.assertIs(array._objects, p._objects)
p[1] = b"foo bar"
- self.assertEqual(p._objects, {'1': b'foo bar', '0': b"spam spam", id(array): array})
+ self.assertEqual(p._objects, {"1": b"foo bar", "0": b"spam spam", id(array): array})
self.assertIs(array._objects, p._objects)
def test_other(self):
@@ -76,7 +76,7 @@ def test_char_p(self):
self.assertEqual(cast(cast(s, c_void_p), c_char_p).value,
b"hiho")
- @need_symbol('c_wchar_p')
+ @need_symbol("c_wchar_p")
def test_wchar_p(self):
s = c_wchar_p("hiho")
self.assertEqual(cast(cast(s, c_void_p), c_wchar_p).value,
diff --git a/.venv3.10/Lib/ctypes/test/test_cfuncs.py b/.venv3.10/Lib/ctypes/test/test_cfuncs.py
index ac2240fa..0fb5c72e 100644
--- a/.venv3.10/Lib/ctypes/test/test_cfuncs.py
+++ b/.venv3.10/Lib/ctypes/test/test_cfuncs.py
@@ -108,7 +108,7 @@ def test_ulong(self):
def test_ulong_plus(self):
self._dll.tf_bL.restype = c_ulong
self._dll.tf_bL.argtypes = (c_char, c_ulong)
- self.assertEqual(self._dll.tf_bL(b' ', 4294967295), 1431655765)
+ self.assertEqual(self._dll.tf_bL(b" ", 4294967295), 1431655765)
self.assertEqual(self.U(), 4294967295)
def test_longlong(self):
@@ -198,15 +198,15 @@ def stdcall_dll(*_): pass
else:
class stdcall_dll(WinDLL):
def __getattr__(self, name):
- if name[:2] == '__' and name[-2:] == '__':
+ if name[:2] == "__" and name[-2:] == "__":
raise AttributeError(name)
func = self._FuncPtr(("s_" + name, self))
setattr(self, name, func)
return func
-@need_symbol('WinDLL')
+@need_symbol("WinDLL")
class stdcallCFunctions(CFunctions):
_dll = stdcall_dll(_ctypes_test.__file__)
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_checkretval.py b/.venv3.10/Lib/ctypes/test/test_checkretval.py
index e9567dc3..83236d22 100644
--- a/.venv3.10/Lib/ctypes/test/test_checkretval.py
+++ b/.venv3.10/Lib/ctypes/test/test_checkretval.py
@@ -26,7 +26,7 @@ def test_checkretval(self):
del dll._testfunc_p_p.restype
self.assertEqual(42, dll._testfunc_p_p(42))
- @need_symbol('oledll')
+ @need_symbol("oledll")
def test_oledll(self):
self.assertRaises(OSError,
oledll.oleaut32.CreateTypeLib2,
diff --git a/.venv3.10/Lib/ctypes/test/test_errno.py b/.venv3.10/Lib/ctypes/test/test_errno.py
index 3685164d..352c8902 100644
--- a/.venv3.10/Lib/ctypes/test/test_errno.py
+++ b/.venv3.10/Lib/ctypes/test/test_errno.py
@@ -1,4 +1,6 @@
-import unittest, os, errno
+import unittest
+import os
+import errno
import threading
from ctypes import *
@@ -42,7 +44,7 @@ def _worker():
self.assertEqual(get_errno(), 32)
set_errno(0)
- @unittest.skipUnless(os.name == "nt", 'Test specific to Windows')
+ @unittest.skipUnless(os.name == "nt", "Test specific to Windows")
def test_GetLastError(self):
dll = WinDLL("kernel32", use_last_error=True)
GetModuleHandle = dll.GetModuleHandleA
diff --git a/.venv3.10/Lib/ctypes/test/test_find.py b/.venv3.10/Lib/ctypes/test/test_find.py
index 1ff9d019..7511dcf8 100644
--- a/.venv3.10/Lib/ctypes/test/test_find.py
+++ b/.venv3.10/Lib/ctypes/test/test_find.py
@@ -53,49 +53,49 @@ def tearDownClass(cls):
def test_gl(self):
if self.gl is None:
- self.skipTest('lib_gl not available')
+ self.skipTest("lib_gl not available")
self.gl.glClearIndex
def test_glu(self):
if self.glu is None:
- self.skipTest('lib_glu not available')
+ self.skipTest("lib_glu not available")
self.glu.gluBeginCurve
def test_gle(self):
if self.gle is None:
- self.skipTest('lib_gle not available')
+ self.skipTest("lib_gle not available")
self.gle.gleGetJoinStyle
def test_shell_injection(self):
- result = find_library('; echo Hello shell > ' + os_helper.TESTFN)
+ result = find_library("; echo Hello shell > " + os_helper.TESTFN)
self.assertFalse(os.path.lexists(os_helper.TESTFN))
self.assertIsNone(result)
-@unittest.skipUnless(sys.platform.startswith('linux'),
- 'Test only valid for Linux')
+@unittest.skipUnless(sys.platform.startswith("linux"),
+ "Test only valid for Linux")
class FindLibraryLinux(unittest.TestCase):
def test_find_on_libpath(self):
import subprocess
import tempfile
try:
- p = subprocess.Popen(['gcc', '--version'], stdout=subprocess.PIPE,
+ p = subprocess.Popen(["gcc", "--version"], stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
out, _ = p.communicate()
except OSError:
- raise unittest.SkipTest('gcc, needed for test, not available')
+ raise unittest.SkipTest("gcc, needed for test, not available")
with tempfile.TemporaryDirectory() as d:
# create an empty temporary file
- srcname = os.path.join(d, 'dummy.c')
- libname = 'py_ctypes_test_dummy'
- dstname = os.path.join(d, 'lib%s.so' % libname)
- with open(srcname, 'wb') as f:
+ srcname = os.path.join(d, "dummy.c")
+ libname = "py_ctypes_test_dummy"
+ dstname = os.path.join(d, "lib%s.so" % libname)
+ with open(srcname, "wb") as f:
pass
self.assertTrue(os.path.exists(srcname))
# compile the file to a shared library
- cmd = ['gcc', '-o', dstname, '--shared',
- '-Wl,-soname,lib%s.so' % libname, srcname]
+ cmd = ["gcc", "-o", dstname, "--shared",
+ "-Wl,-soname,lib%s.so" % libname, srcname]
out = subprocess.check_output(cmd)
self.assertTrue(os.path.exists(dstname))
# now check that the .so can't be found (since not in
@@ -103,24 +103,24 @@ def test_find_on_libpath(self):
self.assertIsNone(find_library(libname))
# now add the location to LD_LIBRARY_PATH
with os_helper.EnvironmentVarGuard() as env:
- KEY = 'LD_LIBRARY_PATH'
+ KEY = "LD_LIBRARY_PATH"
if KEY not in env:
v = d
else:
- v = '%s:%s' % (env[KEY], d)
+ v = "%s:%s" % (env[KEY], d)
env.set(KEY, v)
# now check that the .so can be found (since in
# LD_LIBRARY_PATH)
- self.assertEqual(find_library(libname), 'lib%s.so' % libname)
+ self.assertEqual(find_library(libname), "lib%s.so" % libname)
def test_find_library_with_gcc(self):
with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
- self.assertNotEqual(find_library('c'), None)
+ self.assertNotEqual(find_library("c"), None)
def test_find_library_with_ld(self):
with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
- self.assertNotEqual(find_library('c'), None)
+ self.assertNotEqual(find_library("c"), None)
if __name__ == "__main__":
diff --git a/.venv3.10/Lib/ctypes/test/test_frombuffer.py b/.venv3.10/Lib/ctypes/test/test_frombuffer.py
index 55c24435..a8917293 100644
--- a/.venv3.10/Lib/ctypes/test/test_frombuffer.py
+++ b/.venv3.10/Lib/ctypes/test/test_frombuffer.py
@@ -77,7 +77,7 @@ def test_from_buffer_with_offset(self):
(c_int * 1).from_buffer(a, 16 * sizeof(c_int))
def test_from_buffer_memoryview(self):
- a = [c_char.from_buffer(memoryview(bytearray(b'a')))]
+ a = [c_char.from_buffer(memoryview(bytearray(b"a")))]
a.append(a)
del a
gc.collect() # Should not crash
@@ -137,5 +137,5 @@ def test_abstract(self):
self.assertRaises(TypeError, _Pointer.from_buffer_copy, b"123")
self.assertRaises(TypeError, _SimpleCData.from_buffer_copy, b"123")
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_funcptr.py b/.venv3.10/Lib/ctypes/test/test_funcptr.py
index e0b9b54e..cc2e4701 100644
--- a/.venv3.10/Lib/ctypes/test/test_funcptr.py
+++ b/.venv3.10/Lib/ctypes/test/test_funcptr.py
@@ -39,7 +39,7 @@ def func(a, b):
# possible, as in C, to call cdecl functions with more parameters.
#self.assertRaises(TypeError, c, 1, 2, 3)
self.assertEqual(c(1, 2, 3, 4, 5, 6), 3)
- if not WINFUNCTYPE is CFUNCTYPE:
+ if WINFUNCTYPE is not CFUNCTYPE:
self.assertRaises(TypeError, s, 1, 2, 3)
def test_structures(self):
@@ -128,5 +128,5 @@ def test_abstract(self):
self.assertRaises(TypeError, _CFuncPtr, 13, "name", 42, "iid")
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_functions.py b/.venv3.10/Lib/ctypes/test/test_functions.py
index bdb044e5..476b79ff 100644
--- a/.venv3.10/Lib/ctypes/test/test_functions.py
+++ b/.venv3.10/Lib/ctypes/test/test_functions.py
@@ -7,7 +7,8 @@
from ctypes import *
from ctypes.test import need_symbol
-import sys, unittest
+import sys
+import unittest
try:
WINFUNCTYPE
@@ -54,7 +55,7 @@ class X(object, _SimpleCData):
class X(object, Structure):
_fields_ = []
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_wchar_parm(self):
f = dll._testfunc_i_bhilfd
f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double]
@@ -62,13 +63,13 @@ def test_wchar_parm(self):
self.assertEqual(result, 139)
self.assertEqual(type(result), int)
- @need_symbol('c_wchar')
+ @need_symbol("c_wchar")
def test_wchar_result(self):
f = dll._testfunc_i_bhilfd
f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double]
f.restype = c_wchar
result = f(0, 0, 0, 0, 0, 0)
- self.assertEqual(result, '\x00')
+ self.assertEqual(result, "\x00")
def test_voidresult(self):
f = dll._testfunc_v
@@ -140,7 +141,7 @@ def test_longdoubleresult(self):
self.assertEqual(result, -21)
self.assertEqual(type(result), float)
- @need_symbol('c_longlong')
+ @need_symbol("c_longlong")
def test_longlongresult(self):
f = dll._testfunc_q_bhilfd
f.restype = c_longlong
@@ -278,7 +279,7 @@ def callback(value):
result = f(-10, cb)
self.assertEqual(result, -18)
- @need_symbol('c_longlong')
+ @need_symbol("c_longlong")
def test_longlong_callbacks(self):
f = dll._testfunc_callback_q_qf
@@ -331,7 +332,7 @@ class S2H(Structure):
s2h = dll.ret_2h_func(inp)
self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
- @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+ @unittest.skipUnless(sys.platform == "win32", "Windows-specific test")
def test_struct_return_2H_stdcall(self):
class S2H(Structure):
_fields_ = [("x", c_short),
@@ -359,7 +360,7 @@ class S8I(Structure):
self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h),
(9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9))
- @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
+ @unittest.skipUnless(sys.platform == "win32", "Windows-specific test")
def test_struct_return_8H_stdcall(self):
class S8I(Structure):
_fields_ = [("a", c_int),
@@ -388,5 +389,5 @@ def callback(*args):
callback = proto(callback)
self.assertRaises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT()))
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_incomplete.py b/.venv3.10/Lib/ctypes/test/test_incomplete.py
index 00c430ef..00b476ea 100644
--- a/.venv3.10/Lib/ctypes/test/test_incomplete.py
+++ b/.venv3.10/Lib/ctypes/test/test_incomplete.py
@@ -38,5 +38,5 @@ class cell(Structure):
################################################################
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_internals.py b/.venv3.10/Lib/ctypes/test/test_internals.py
index 271e3f57..9f2d6b65 100644
--- a/.venv3.10/Lib/ctypes/test/test_internals.py
+++ b/.venv3.10/Lib/ctypes/test/test_internals.py
@@ -96,5 +96,5 @@ class X(Structure):
##XXX print x.data[0]
##XXX print x.data._objects
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_keeprefs.py b/.venv3.10/Lib/ctypes/test/test_keeprefs.py
index 94c02573..dd527f32 100644
--- a/.venv3.10/Lib/ctypes/test/test_keeprefs.py
+++ b/.venv3.10/Lib/ctypes/test/test_keeprefs.py
@@ -57,12 +57,12 @@ class RECT(Structure):
r = RECT()
pt = POINT(1, 2)
r.ul = pt
- self.assertEqual(r._objects, {'0': {}})
+ self.assertEqual(r._objects, {"0": {}})
r.ul.x = 22
r.ul.y = 44
- self.assertEqual(r._objects, {'0': {}})
+ self.assertEqual(r._objects, {"0": {}})
r.lr = POINT()
- self.assertEqual(r._objects, {'0': {}, '1': {}})
+ self.assertEqual(r._objects, {"0": {}, "1": {}})
class ArrayTestCase(unittest.TestCase):
def test_cint_array(self):
@@ -85,16 +85,16 @@ class X(Structure):
x.a[1] = 96
self.assertEqual(x._objects, None)
x.a = ia
- self.assertEqual(x._objects, {'1': {}})
+ self.assertEqual(x._objects, {"1": {}})
class PointerTestCase(unittest.TestCase):
def test_p_cint(self):
i = c_int(42)
x = pointer(i)
- self.assertEqual(x._objects, {'1': i})
+ self.assertEqual(x._objects, {"1": i})
class DeletePointerTestCase(unittest.TestCase):
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_X(self):
class X(Structure):
_fields_ = [("p", POINTER(c_char_p))]
diff --git a/.venv3.10/Lib/ctypes/test/test_loading.py b/.venv3.10/Lib/ctypes/test/test_loading.py
index ea892277..dc3a1ea5 100644
--- a/.venv3.10/Lib/ctypes/test/test_loading.py
+++ b/.venv3.10/Lib/ctypes/test/test_loading.py
@@ -29,16 +29,16 @@ class LoaderTest(unittest.TestCase):
def test_load(self):
if libc_name is None:
- self.skipTest('could not find libc')
+ self.skipTest("could not find libc")
CDLL(libc_name)
CDLL(os.path.basename(libc_name))
self.assertRaises(OSError, CDLL, self.unknowndll)
def test_load_version(self):
if libc_name is None:
- self.skipTest('could not find libc')
- if os.path.basename(libc_name) != 'libc.so.6':
- self.skipTest('wrong libc path for test')
+ self.skipTest("could not find libc")
+ if os.path.basename(libc_name) != "libc.so.6":
+ self.skipTest("wrong libc path for test")
cdll.LoadLibrary("libc.so.6")
# linux uses version, libc 9 should not exist
self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9")
@@ -52,7 +52,7 @@ def test_find(self):
CDLL(lib)
@unittest.skipUnless(os.name == "nt",
- 'test specific to Windows')
+ "test specific to Windows")
def test_load_library(self):
# CRT is no longer directly loadable. See issue23606 for the
# discussion about alternative approaches.
@@ -70,7 +70,7 @@ def test_load_library(self):
self.assertRaises(ValueError, windll.LoadLibrary, "kernel32\0")
@unittest.skipUnless(os.name == "nt",
- 'test specific to Windows')
+ "test specific to Windows")
def test_load_ordinal_functions(self):
import _ctypes_test
dll = WinDLL(_ctypes_test.__file__)
@@ -86,7 +86,7 @@ def test_load_ordinal_functions(self):
self.assertRaises(AttributeError, dll.__getitem__, 1234)
- @unittest.skipUnless(os.name == "nt", 'Windows-specific test')
+ @unittest.skipUnless(os.name == "nt", "Windows-specific test")
def test_1703286_A(self):
from _ctypes import LoadLibrary, FreeLibrary
# On winXP 64-bit, advapi32 loads at an address that does
@@ -97,7 +97,7 @@ def test_1703286_A(self):
handle = LoadLibrary("advapi32")
FreeLibrary(handle)
- @unittest.skipUnless(os.name == "nt", 'Windows-specific test')
+ @unittest.skipUnless(os.name == "nt", "Windows-specific test")
def test_1703286_B(self):
# Since on winXP 64-bit advapi32 loads like described
# above, the (arbitrarily selected) CloseEventLog function
@@ -117,7 +117,7 @@ def test_1703286_B(self):
self.assertEqual(0, call_function(proc, (None,)))
@unittest.skipUnless(os.name == "nt",
- 'test specific to Windows')
+ "test specific to Windows")
def test_load_dll_with_flags(self):
_sqlite3 = import_helper.import_module("_sqlite3")
src = _sqlite3.__file__
diff --git a/.venv3.10/Lib/ctypes/test/test_macholib.py b/.venv3.10/Lib/ctypes/test/test_macholib.py
index a1bac26a..6203187f 100644
--- a/.venv3.10/Lib/ctypes/test/test_macholib.py
+++ b/.venv3.10/Lib/ctypes/test/test_macholib.py
@@ -34,7 +34,7 @@
from ctypes.macholib.dyld import dyld_find
def find_lib(name):
- possible = ['lib'+name+'.dylib', name+'.dylib', name+'.framework/'+name]
+ possible = ["lib"+name+".dylib", name+".dylib", name+".framework/"+name]
for dylib in possible:
try:
return os.path.realpath(dyld_find(dylib))
@@ -43,24 +43,24 @@ def find_lib(name):
raise ValueError("%s not found" % (name,))
class MachOTest(unittest.TestCase):
- @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test')
+ @unittest.skipUnless(sys.platform == "darwin", "OSX-specific test")
def test_find(self):
# On Mac OS 11, system dylibs are only present in the shared cache,
# so symlinks like libpthread.dylib -> libSystem.B.dylib will not
# be resolved by dyld_find
- self.assertIn(find_lib('pthread'),
- ('/usr/lib/libSystem.B.dylib', '/usr/lib/libpthread.dylib'))
+ self.assertIn(find_lib("pthread"),
+ ("/usr/lib/libSystem.B.dylib", "/usr/lib/libpthread.dylib"))
- result = find_lib('z')
+ result = find_lib("z")
# Issue #21093: dyld default search path includes $HOME/lib and
# /usr/local/lib before /usr/lib, which caused test failures if
# a local copy of libz exists in one of them. Now ignore the head
# of the path.
self.assertRegex(result, r".*/lib/libz.*\.dylib")
- self.assertIn(find_lib('IOKit'),
- ('/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit',
- '/System/Library/Frameworks/IOKit.framework/IOKit'))
+ self.assertIn(find_lib("IOKit"),
+ ("/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit",
+ "/System/Library/Frameworks/IOKit.framework/IOKit"))
if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_memfunctions.py b/.venv3.10/Lib/ctypes/test/test_memfunctions.py
index e784b9a7..e72ef9a3 100644
--- a/.venv3.10/Lib/ctypes/test/test_memfunctions.py
+++ b/.venv3.10/Lib/ctypes/test/test_memfunctions.py
@@ -5,7 +5,7 @@
from ctypes.test import need_symbol
class MemFunctionsTest(unittest.TestCase):
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_overflow(self):
# string_at and wstring_at must use the Python calling
# convention (which acquires the GIL and checks the Python
@@ -31,7 +31,7 @@ def test_memmove(self):
def test_memset(self):
a = create_string_buffer(1000000)
- result = memset(a, ord('x'), 16)
+ result = memset(a, ord("x"), 16)
self.assertEqual(a.value, b"xxxxxxxxxxxxxxxx")
self.assertEqual(string_at(result), b"xxxxxxxxxxxxxxxx")
@@ -63,7 +63,7 @@ def test_string_at(self):
self.assertEqual(string_at(b"foo bar", 7), b"foo bar")
self.assertEqual(string_at(b"foo bar", 3), b"foo")
- @need_symbol('create_unicode_buffer')
+ @need_symbol("create_unicode_buffer")
def test_wstring_at(self):
p = create_unicode_buffer("Hello, World")
a = create_unicode_buffer(1000000)
diff --git a/.venv3.10/Lib/ctypes/test/test_numbers.py b/.venv3.10/Lib/ctypes/test/test_numbers.py
index db500e81..df285412 100644
--- a/.venv3.10/Lib/ctypes/test/test_numbers.py
+++ b/.venv3.10/Lib/ctypes/test/test_numbers.py
@@ -46,7 +46,7 @@ def valid_ranges(*types):
unsigned_ranges = valid_ranges(*unsigned_types)
signed_ranges = valid_ranges(*signed_types)
-bool_values = [True, False, 0, 1, -1, 5000, 'test', [], [1]]
+bool_values = [True, False, 0, 1, -1, 5000, "test", [], [1]]
################################################################
@@ -82,7 +82,7 @@ def test_typeerror(self):
self.assertRaises(TypeError, t, "")
self.assertRaises(TypeError, t, None)
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_valid_ranges(self):
# invalid values of the correct type
# raise ValueError (not OverflowError)
@@ -196,17 +196,17 @@ def test_char_from_address(self):
from ctypes import c_char
from array import array
- a = array('b', [0])
- a[0] = ord('x')
+ a = array("b", [0])
+ a[0] = ord("x")
v = c_char.from_address(a.buffer_info()[0])
- self.assertEqual(v.value, b'x')
+ self.assertEqual(v.value, b"x")
self.assertIs(type(v), c_char)
- a[0] = ord('?')
- self.assertEqual(v.value, b'?')
+ a[0] = ord("?")
+ self.assertEqual(v.value, b"?")
# array does not support c_bool / 't'
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_bool_from_address(self):
from ctypes import c_bool
from array import array
@@ -234,7 +234,7 @@ def test_float_overflow(self):
if (hasattr(t, "__ctype_le__")):
self.assertRaises(OverflowError, t.__ctype_le__, big_int)
- @unittest.skip('test disabled')
+ @unittest.skip("test disabled")
def test_perf(self):
check_perf()
@@ -290,6 +290,6 @@ def check_perf():
# c_int_S(): 9.87 us
# c_int_S(999): 9.85 us
-if __name__ == '__main__':
+if __name__ == "__main__":
## check_perf()
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_objects.py b/.venv3.10/Lib/ctypes/test/test_objects.py
index 19e3dc1f..61692b60 100644
--- a/.venv3.10/Lib/ctypes/test/test_objects.py
+++ b/.venv3.10/Lib/ctypes/test/test_objects.py
@@ -54,14 +54,15 @@
'''
-import unittest, doctest
+import unittest
+import doctest
import ctypes.test.test_objects
class TestCase(unittest.TestCase):
def test(self):
failures, tests = doctest.testmod(ctypes.test.test_objects)
- self.assertFalse(failures, 'doctests failed, see output above')
+ self.assertFalse(failures, "doctests failed, see output above")
-if __name__ == '__main__':
+if __name__ == "__main__":
doctest.testmod(ctypes.test.test_objects)
diff --git a/.venv3.10/Lib/ctypes/test/test_parameters.py b/.venv3.10/Lib/ctypes/test/test_parameters.py
index 3fdc994e..b72c39c0 100644
--- a/.venv3.10/Lib/ctypes/test/test_parameters.py
+++ b/.venv3.10/Lib/ctypes/test/test_parameters.py
@@ -5,7 +5,6 @@
class SimpleTypesTestCase(unittest.TestCase):
def setUp(self):
- import ctypes
try:
from _ctypes import set_conversion_mode
except ImportError:
@@ -37,7 +36,7 @@ def from_param(cls, value):
self.assertEqual(CVOIDP.from_param("abc"), "abcabc")
self.assertEqual(CCHARP.from_param("abc"), "abcabcabcabc")
- @need_symbol('c_wchar_p')
+ @need_symbol("c_wchar_p")
def test_subclasses_c_wchar_p(self):
from ctypes import c_wchar_p
@@ -67,7 +66,7 @@ def test_cstrings(self):
a = c_char_p(b"123")
self.assertIs(c_char_p.from_param(a), a)
- @need_symbol('c_wchar_p')
+ @need_symbol("c_wchar_p")
def test_cw_strings(self):
from ctypes import c_wchar_p
@@ -192,14 +191,14 @@ class BadStruct(Structure):
def __dict__(self):
pass
with self.assertRaises(TypeError):
- BadStruct().__setstate__({}, b'foo')
+ BadStruct().__setstate__({}, b"foo")
class WorseStruct(Structure):
@property
def __dict__(self):
1/0
with self.assertRaises(ZeroDivisionError):
- WorseStruct().__setstate__({}, b'foo')
+ WorseStruct().__setstate__({}, b"foo")
def test_parameter_repr(self):
from ctypes import (
@@ -225,7 +224,7 @@ def test_parameter_repr(self):
)
self.assertRegex(repr(c_bool.from_param(True)), r"^$")
self.assertEqual(repr(c_char.from_param(97)), "")
- self.assertRegex(repr(c_wchar.from_param('a')), r"^$")
+ self.assertRegex(repr(c_wchar.from_param("a")), r"^$")
self.assertEqual(repr(c_byte.from_param(98)), "")
self.assertEqual(repr(c_ubyte.from_param(98)), "")
self.assertEqual(repr(c_short.from_param(511)), "")
@@ -240,8 +239,8 @@ def test_parameter_repr(self):
self.assertEqual(repr(c_double.from_param(1.5)), "")
self.assertEqual(repr(c_double.from_param(1e300)), "")
self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^$")
- self.assertRegex(repr(c_char_p.from_param(b'hihi')), r"^$")
- self.assertRegex(repr(c_wchar_p.from_param('hihi')), r"^$")
+ self.assertRegex(repr(c_char_p.from_param(b"hihi")), r"^$")
+ self.assertRegex(repr(c_wchar_p.from_param("hihi")), r"^$")
self.assertRegex(repr(c_void_p.from_param(0x12)), r"^$")
@test.support.cpython_only
@@ -298,5 +297,5 @@ def from_param(cls, value):
################################################################
-if __name__ == '__main__':
+if __name__ == "__main__":
unittest.main()
diff --git a/.venv3.10/Lib/ctypes/test/test_pep3118.py b/.venv3.10/Lib/ctypes/test/test_pep3118.py
index efffc80a..2fc9a9f1 100644
--- a/.venv3.10/Lib/ctypes/test/test_pep3118.py
+++ b/.venv3.10/Lib/ctypes/test/test_pep3118.py
@@ -1,6 +1,7 @@
import unittest
from ctypes import *
-import re, sys
+import re
+import sys
if sys.byteorder == "little":
THIS_ENDIAN = "<"
@@ -114,13 +115,13 @@ class Complete(Structure):
#
# Platform-specific type codes
-s_bool = {1: '?', 2: 'H', 4: 'L', 8: 'Q'}[sizeof(c_bool)]
-s_short = {2: 'h', 4: 'l', 8: 'q'}[sizeof(c_short)]
-s_ushort = {2: 'H', 4: 'L', 8: 'Q'}[sizeof(c_ushort)]
-s_int = {2: 'h', 4: 'i', 8: 'q'}[sizeof(c_int)]
-s_uint = {2: 'H', 4: 'I', 8: 'Q'}[sizeof(c_uint)]
-s_long = {4: 'l', 8: 'q'}[sizeof(c_long)]
-s_ulong = {4: 'L', 8: 'Q'}[sizeof(c_ulong)]
+s_bool = {1: "?", 2: "H", 4: "L", 8: "Q"}[sizeof(c_bool)]
+s_short = {2: "h", 4: "l", 8: "q"}[sizeof(c_short)]
+s_ushort = {2: "H", 4: "L", 8: "Q"}[sizeof(c_ushort)]
+s_int = {2: "h", 4: "i", 8: "q"}[sizeof(c_int)]
+s_uint = {2: "H", 4: "I", 8: "Q"}[sizeof(c_uint)]
+s_long = {4: "l", 8: "q"}[sizeof(c_long)]
+s_ulong = {4: "L", 8: "Q"}[sizeof(c_ulong)]
s_longlong = "q"
s_ulonglong = "Q"
s_float = "f"
@@ -185,16 +186,16 @@ class Complete(Structure):
## structures and unions
- (Point, "T{l:x:>l:y:}".replace('l', s_long), (), BEPoint),
- (LEPoint, "T{l:x:>l:y:}".replace('l', s_long), (), POINTER(BEPoint)),
- (POINTER(LEPoint), "&T{l:x:>l:y:}".replace("l", s_long), (), BEPoint),
+ (LEPoint, "T{l:x:>l:y:}".replace("l", s_long), (), POINTER(BEPoint)),
+ (POINTER(LEPoint), "&T{ \S*/(lib%s\.\S+)' % (ename, ename)
+ expr = r":-l%s\.\S+ => \S*/(lib%s\.\S+)" % (ename, ename)
expr = os.fsencode(expr)
try:
- proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
+ proc = subprocess.Popen(("/sbin/ldconfig", "-r"),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
except OSError: # E.g. command not found
- data = b''
+ data = b""
else:
with proc:
data = proc.stdout.read()
@@ -228,16 +229,16 @@ def find_library(name):
elif sys.platform == "sunos5":
def _findLib_crle(name, is64):
- if not os.path.exists('/usr/bin/crle'):
+ if not os.path.exists("/usr/bin/crle"):
return None
env = dict(os.environ)
- env['LC_ALL'] = 'C'
+ env["LC_ALL"] = "C"
if is64:
- args = ('/usr/bin/crle', '-64')
+ args = ("/usr/bin/crle", "-64")
else:
- args = ('/usr/bin/crle',)
+ args = ("/usr/bin/crle",)
paths = None
try:
@@ -250,7 +251,7 @@ def _findLib_crle(name, is64):
with proc:
for line in proc.stdout:
line = line.strip()
- if line.startswith(b'Default Library Path (ELF):'):
+ if line.startswith(b"Default Library Path (ELF):"):
paths = os.fsdecode(line).split()[4]
if not paths:
@@ -270,28 +271,28 @@ def find_library(name, is64 = False):
def _findSoname_ldconfig(name):
import struct
- if struct.calcsize('l') == 4:
- machine = os.uname().machine + '-32'
+ if struct.calcsize("l") == 4:
+ machine = os.uname().machine + "-32"
else:
- machine = os.uname().machine + '-64'
+ machine = os.uname().machine + "-64"
mach_map = {
- 'x86_64-64': 'libc6,x86-64',
- 'ppc64-64': 'libc6,64bit',
- 'sparc64-64': 'libc6,64bit',
- 's390x-64': 'libc6,64bit',
- 'ia64-64': 'libc6,IA-64',
+ "x86_64-64": "libc6,x86-64",
+ "ppc64-64": "libc6,64bit",
+ "sparc64-64": "libc6,64bit",
+ "s390x-64": "libc6,64bit",
+ "ia64-64": "libc6,IA-64",
}
- abi_type = mach_map.get(machine, 'libc6')
+ abi_type = mach_map.get(machine, "libc6")
# XXX assuming GLIBC's ldconfig (with option -p)
- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
+ regex = r"\s+(lib%s\.[^\s]+)\s+\(%s"
regex = os.fsencode(regex % (re.escape(name), abi_type))
try:
- with subprocess.Popen(['/sbin/ldconfig', '-p'],
+ with subprocess.Popen(["/sbin/ldconfig", "-p"],
stdin=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
stdout=subprocess.PIPE,
- env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
+ env={"LC_ALL": "C", "LANG": "C"}) as p:
res = re.search(regex, p.stdout.read())
if res:
return os.fsdecode(res.group(1))
@@ -300,13 +301,13 @@ def _findSoname_ldconfig(name):
def _findLib_ld(name):
# See issue #9998 for why this is needed
- expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
- cmd = ['ld', '-t']
- libpath = os.environ.get('LD_LIBRARY_PATH')
+ expr = r"[^\(\)\s]*lib%s\.[^\(\)\s]*" % re.escape(name)
+ cmd = ["ld", "-t"]
+ libpath = os.environ.get("LD_LIBRARY_PATH")
if libpath:
- for d in libpath.split(':'):
- cmd.extend(['-L', d])
- cmd.extend(['-o', os.devnull, '-l%s' % name])
+ for d in libpath.split(":"):
+ cmd.extend(["-L", d])
+ cmd.extend(["-o", os.devnull, "-l%s" % name])
result = None
try:
p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
@@ -329,7 +330,7 @@ def _findLib_prefix(name):
if not name:
return None
for fullname in (name, "lib%s.so" % (name)):
- path = os.path.join(sys.prefix, 'lib', fullname)
+ path = os.path.join(sys.prefix, "lib", fullname)
if os.path.exists(path):
return path
return None
diff --git a/.venv3.10/Lib/ctypes/wintypes.py b/.venv3.10/Lib/ctypes/wintypes.py
index c619d275..5b7dce4f 100644
--- a/.venv3.10/Lib/ctypes/wintypes.py
+++ b/.venv3.10/Lib/ctypes/wintypes.py
@@ -102,15 +102,15 @@ class RECT(ctypes.Structure):
tagRECT = _RECTL = RECTL = RECT
class _SMALL_RECT(ctypes.Structure):
- _fields_ = [('Left', SHORT),
- ('Top', SHORT),
- ('Right', SHORT),
- ('Bottom', SHORT)]
+ _fields_ = [("Left", SHORT),
+ ("Top", SHORT),
+ ("Right", SHORT),
+ ("Bottom", SHORT)]
SMALL_RECT = _SMALL_RECT
class _COORD(ctypes.Structure):
- _fields_ = [('X', SHORT),
- ('Y', SHORT)]
+ _fields_ = [("X", SHORT),
+ ("Y", SHORT)]
class POINT(ctypes.Structure):
_fields_ = [("x", LONG),
diff --git a/.venv3.10/Lib/curses/__init__.py b/.venv3.10/Lib/curses/__init__.py
index 69270bfc..5a079248 100644
--- a/.venv3.10/Lib/curses/__init__.py
+++ b/.venv3.10/Lib/curses/__init__.py
@@ -23,14 +23,15 @@
# curses import *' if you'll be needing the ACS_* constants.
def initscr():
- import _curses, curses
+ import _curses
+ import curses
# we call setupterm() here because it raises an error
# instead of calling exit() in error cases.
setupterm(term=_os.environ.get("TERM", "unknown"),
fd=_sys.__stdout__.fileno())
stdscr = _curses.initscr()
for key, value in _curses.__dict__.items():
- if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
+ if key[0:4] == "ACS_" or key in ("LINES", "COLS"):
setattr(curses, key, value)
return stdscr
@@ -40,11 +41,12 @@ def initscr():
# called.
def start_color():
- import _curses, curses
+ import _curses
+ import curses
retval = _curses.start_color()
- if hasattr(_curses, 'COLORS'):
+ if hasattr(_curses, "COLORS"):
curses.COLORS = _curses.COLORS
- if hasattr(_curses, 'COLOR_PAIRS'):
+ if hasattr(_curses, "COLOR_PAIRS"):
curses.COLOR_PAIRS = _curses.COLOR_PAIRS
return retval
@@ -94,7 +96,7 @@ def wrapper(func, /, *args, **kwds):
return func(stdscr, *args, **kwds)
finally:
# Set everything back to normal
- if 'stdscr' in locals():
+ if "stdscr" in locals():
stdscr.keypad(0)
echo()
nocbreak()
diff --git a/.venv3.10/Lib/curses/has_key.py b/.venv3.10/Lib/curses/has_key.py
index 4e37b480..be487e94 100644
--- a/.venv3.10/Lib/curses/has_key.py
+++ b/.venv3.10/Lib/curses/has_key.py
@@ -8,155 +8,155 @@
# Table mapping curses keys to the terminfo capability name
_capability_names = {
- _curses.KEY_A1: 'ka1',
- _curses.KEY_A3: 'ka3',
- _curses.KEY_B2: 'kb2',
- _curses.KEY_BACKSPACE: 'kbs',
- _curses.KEY_BEG: 'kbeg',
- _curses.KEY_BTAB: 'kcbt',
- _curses.KEY_C1: 'kc1',
- _curses.KEY_C3: 'kc3',
- _curses.KEY_CANCEL: 'kcan',
- _curses.KEY_CATAB: 'ktbc',
- _curses.KEY_CLEAR: 'kclr',
- _curses.KEY_CLOSE: 'kclo',
- _curses.KEY_COMMAND: 'kcmd',
- _curses.KEY_COPY: 'kcpy',
- _curses.KEY_CREATE: 'kcrt',
- _curses.KEY_CTAB: 'kctab',
- _curses.KEY_DC: 'kdch1',
- _curses.KEY_DL: 'kdl1',
- _curses.KEY_DOWN: 'kcud1',
- _curses.KEY_EIC: 'krmir',
- _curses.KEY_END: 'kend',
- _curses.KEY_ENTER: 'kent',
- _curses.KEY_EOL: 'kel',
- _curses.KEY_EOS: 'ked',
- _curses.KEY_EXIT: 'kext',
- _curses.KEY_F0: 'kf0',
- _curses.KEY_F1: 'kf1',
- _curses.KEY_F10: 'kf10',
- _curses.KEY_F11: 'kf11',
- _curses.KEY_F12: 'kf12',
- _curses.KEY_F13: 'kf13',
- _curses.KEY_F14: 'kf14',
- _curses.KEY_F15: 'kf15',
- _curses.KEY_F16: 'kf16',
- _curses.KEY_F17: 'kf17',
- _curses.KEY_F18: 'kf18',
- _curses.KEY_F19: 'kf19',
- _curses.KEY_F2: 'kf2',
- _curses.KEY_F20: 'kf20',
- _curses.KEY_F21: 'kf21',
- _curses.KEY_F22: 'kf22',
- _curses.KEY_F23: 'kf23',
- _curses.KEY_F24: 'kf24',
- _curses.KEY_F25: 'kf25',
- _curses.KEY_F26: 'kf26',
- _curses.KEY_F27: 'kf27',
- _curses.KEY_F28: 'kf28',
- _curses.KEY_F29: 'kf29',
- _curses.KEY_F3: 'kf3',
- _curses.KEY_F30: 'kf30',
- _curses.KEY_F31: 'kf31',
- _curses.KEY_F32: 'kf32',
- _curses.KEY_F33: 'kf33',
- _curses.KEY_F34: 'kf34',
- _curses.KEY_F35: 'kf35',
- _curses.KEY_F36: 'kf36',
- _curses.KEY_F37: 'kf37',
- _curses.KEY_F38: 'kf38',
- _curses.KEY_F39: 'kf39',
- _curses.KEY_F4: 'kf4',
- _curses.KEY_F40: 'kf40',
- _curses.KEY_F41: 'kf41',
- _curses.KEY_F42: 'kf42',
- _curses.KEY_F43: 'kf43',
- _curses.KEY_F44: 'kf44',
- _curses.KEY_F45: 'kf45',
- _curses.KEY_F46: 'kf46',
- _curses.KEY_F47: 'kf47',
- _curses.KEY_F48: 'kf48',
- _curses.KEY_F49: 'kf49',
- _curses.KEY_F5: 'kf5',
- _curses.KEY_F50: 'kf50',
- _curses.KEY_F51: 'kf51',
- _curses.KEY_F52: 'kf52',
- _curses.KEY_F53: 'kf53',
- _curses.KEY_F54: 'kf54',
- _curses.KEY_F55: 'kf55',
- _curses.KEY_F56: 'kf56',
- _curses.KEY_F57: 'kf57',
- _curses.KEY_F58: 'kf58',
- _curses.KEY_F59: 'kf59',
- _curses.KEY_F6: 'kf6',
- _curses.KEY_F60: 'kf60',
- _curses.KEY_F61: 'kf61',
- _curses.KEY_F62: 'kf62',
- _curses.KEY_F63: 'kf63',
- _curses.KEY_F7: 'kf7',
- _curses.KEY_F8: 'kf8',
- _curses.KEY_F9: 'kf9',
- _curses.KEY_FIND: 'kfnd',
- _curses.KEY_HELP: 'khlp',
- _curses.KEY_HOME: 'khome',
- _curses.KEY_IC: 'kich1',
- _curses.KEY_IL: 'kil1',
- _curses.KEY_LEFT: 'kcub1',
- _curses.KEY_LL: 'kll',
- _curses.KEY_MARK: 'kmrk',
- _curses.KEY_MESSAGE: 'kmsg',
- _curses.KEY_MOVE: 'kmov',
- _curses.KEY_NEXT: 'knxt',
- _curses.KEY_NPAGE: 'knp',
- _curses.KEY_OPEN: 'kopn',
- _curses.KEY_OPTIONS: 'kopt',
- _curses.KEY_PPAGE: 'kpp',
- _curses.KEY_PREVIOUS: 'kprv',
- _curses.KEY_PRINT: 'kprt',
- _curses.KEY_REDO: 'krdo',
- _curses.KEY_REFERENCE: 'kref',
- _curses.KEY_REFRESH: 'krfr',
- _curses.KEY_REPLACE: 'krpl',
- _curses.KEY_RESTART: 'krst',
- _curses.KEY_RESUME: 'kres',
- _curses.KEY_RIGHT: 'kcuf1',
- _curses.KEY_SAVE: 'ksav',
- _curses.KEY_SBEG: 'kBEG',
- _curses.KEY_SCANCEL: 'kCAN',
- _curses.KEY_SCOMMAND: 'kCMD',
- _curses.KEY_SCOPY: 'kCPY',
- _curses.KEY_SCREATE: 'kCRT',
- _curses.KEY_SDC: 'kDC',
- _curses.KEY_SDL: 'kDL',
- _curses.KEY_SELECT: 'kslt',
- _curses.KEY_SEND: 'kEND',
- _curses.KEY_SEOL: 'kEOL',
- _curses.KEY_SEXIT: 'kEXT',
- _curses.KEY_SF: 'kind',
- _curses.KEY_SFIND: 'kFND',
- _curses.KEY_SHELP: 'kHLP',
- _curses.KEY_SHOME: 'kHOM',
- _curses.KEY_SIC: 'kIC',
- _curses.KEY_SLEFT: 'kLFT',
- _curses.KEY_SMESSAGE: 'kMSG',
- _curses.KEY_SMOVE: 'kMOV',
- _curses.KEY_SNEXT: 'kNXT',
- _curses.KEY_SOPTIONS: 'kOPT',
- _curses.KEY_SPREVIOUS: 'kPRV',
- _curses.KEY_SPRINT: 'kPRT',
- _curses.KEY_SR: 'kri',
- _curses.KEY_SREDO: 'kRDO',
- _curses.KEY_SREPLACE: 'kRPL',
- _curses.KEY_SRIGHT: 'kRIT',
- _curses.KEY_SRSUME: 'kRES',
- _curses.KEY_SSAVE: 'kSAV',
- _curses.KEY_SSUSPEND: 'kSPD',
- _curses.KEY_STAB: 'khts',
- _curses.KEY_SUNDO: 'kUND',
- _curses.KEY_SUSPEND: 'kspd',
- _curses.KEY_UNDO: 'kund',
- _curses.KEY_UP: 'kcuu1'
+ _curses.KEY_A1: "ka1",
+ _curses.KEY_A3: "ka3",
+ _curses.KEY_B2: "kb2",
+ _curses.KEY_BACKSPACE: "kbs",
+ _curses.KEY_BEG: "kbeg",
+ _curses.KEY_BTAB: "kcbt",
+ _curses.KEY_C1: "kc1",
+ _curses.KEY_C3: "kc3",
+ _curses.KEY_CANCEL: "kcan",
+ _curses.KEY_CATAB: "ktbc",
+ _curses.KEY_CLEAR: "kclr",
+ _curses.KEY_CLOSE: "kclo",
+ _curses.KEY_COMMAND: "kcmd",
+ _curses.KEY_COPY: "kcpy",
+ _curses.KEY_CREATE: "kcrt",
+ _curses.KEY_CTAB: "kctab",
+ _curses.KEY_DC: "kdch1",
+ _curses.KEY_DL: "kdl1",
+ _curses.KEY_DOWN: "kcud1",
+ _curses.KEY_EIC: "krmir",
+ _curses.KEY_END: "kend",
+ _curses.KEY_ENTER: "kent",
+ _curses.KEY_EOL: "kel",
+ _curses.KEY_EOS: "ked",
+ _curses.KEY_EXIT: "kext",
+ _curses.KEY_F0: "kf0",
+ _curses.KEY_F1: "kf1",
+ _curses.KEY_F10: "kf10",
+ _curses.KEY_F11: "kf11",
+ _curses.KEY_F12: "kf12",
+ _curses.KEY_F13: "kf13",
+ _curses.KEY_F14: "kf14",
+ _curses.KEY_F15: "kf15",
+ _curses.KEY_F16: "kf16",
+ _curses.KEY_F17: "kf17",
+ _curses.KEY_F18: "kf18",
+ _curses.KEY_F19: "kf19",
+ _curses.KEY_F2: "kf2",
+ _curses.KEY_F20: "kf20",
+ _curses.KEY_F21: "kf21",
+ _curses.KEY_F22: "kf22",
+ _curses.KEY_F23: "kf23",
+ _curses.KEY_F24: "kf24",
+ _curses.KEY_F25: "kf25",
+ _curses.KEY_F26: "kf26",
+ _curses.KEY_F27: "kf27",
+ _curses.KEY_F28: "kf28",
+ _curses.KEY_F29: "kf29",
+ _curses.KEY_F3: "kf3",
+ _curses.KEY_F30: "kf30",
+ _curses.KEY_F31: "kf31",
+ _curses.KEY_F32: "kf32",
+ _curses.KEY_F33: "kf33",
+ _curses.KEY_F34: "kf34",
+ _curses.KEY_F35: "kf35",
+ _curses.KEY_F36: "kf36",
+ _curses.KEY_F37: "kf37",
+ _curses.KEY_F38: "kf38",
+ _curses.KEY_F39: "kf39",
+ _curses.KEY_F4: "kf4",
+ _curses.KEY_F40: "kf40",
+ _curses.KEY_F41: "kf41",
+ _curses.KEY_F42: "kf42",
+ _curses.KEY_F43: "kf43",
+ _curses.KEY_F44: "kf44",
+ _curses.KEY_F45: "kf45",
+ _curses.KEY_F46: "kf46",
+ _curses.KEY_F47: "kf47",
+ _curses.KEY_F48: "kf48",
+ _curses.KEY_F49: "kf49",
+ _curses.KEY_F5: "kf5",
+ _curses.KEY_F50: "kf50",
+ _curses.KEY_F51: "kf51",
+ _curses.KEY_F52: "kf52",
+ _curses.KEY_F53: "kf53",
+ _curses.KEY_F54: "kf54",
+ _curses.KEY_F55: "kf55",
+ _curses.KEY_F56: "kf56",
+ _curses.KEY_F57: "kf57",
+ _curses.KEY_F58: "kf58",
+ _curses.KEY_F59: "kf59",
+ _curses.KEY_F6: "kf6",
+ _curses.KEY_F60: "kf60",
+ _curses.KEY_F61: "kf61",
+ _curses.KEY_F62: "kf62",
+ _curses.KEY_F63: "kf63",
+ _curses.KEY_F7: "kf7",
+ _curses.KEY_F8: "kf8",
+ _curses.KEY_F9: "kf9",
+ _curses.KEY_FIND: "kfnd",
+ _curses.KEY_HELP: "khlp",
+ _curses.KEY_HOME: "khome",
+ _curses.KEY_IC: "kich1",
+ _curses.KEY_IL: "kil1",
+ _curses.KEY_LEFT: "kcub1",
+ _curses.KEY_LL: "kll",
+ _curses.KEY_MARK: "kmrk",
+ _curses.KEY_MESSAGE: "kmsg",
+ _curses.KEY_MOVE: "kmov",
+ _curses.KEY_NEXT: "knxt",
+ _curses.KEY_NPAGE: "knp",
+ _curses.KEY_OPEN: "kopn",
+ _curses.KEY_OPTIONS: "kopt",
+ _curses.KEY_PPAGE: "kpp",
+ _curses.KEY_PREVIOUS: "kprv",
+ _curses.KEY_PRINT: "kprt",
+ _curses.KEY_REDO: "krdo",
+ _curses.KEY_REFERENCE: "kref",
+ _curses.KEY_REFRESH: "krfr",
+ _curses.KEY_REPLACE: "krpl",
+ _curses.KEY_RESTART: "krst",
+ _curses.KEY_RESUME: "kres",
+ _curses.KEY_RIGHT: "kcuf1",
+ _curses.KEY_SAVE: "ksav",
+ _curses.KEY_SBEG: "kBEG",
+ _curses.KEY_SCANCEL: "kCAN",
+ _curses.KEY_SCOMMAND: "kCMD",
+ _curses.KEY_SCOPY: "kCPY",
+ _curses.KEY_SCREATE: "kCRT",
+ _curses.KEY_SDC: "kDC",
+ _curses.KEY_SDL: "kDL",
+ _curses.KEY_SELECT: "kslt",
+ _curses.KEY_SEND: "kEND",
+ _curses.KEY_SEOL: "kEOL",
+ _curses.KEY_SEXIT: "kEXT",
+ _curses.KEY_SF: "kind",
+ _curses.KEY_SFIND: "kFND",
+ _curses.KEY_SHELP: "kHLP",
+ _curses.KEY_SHOME: "kHOM",
+ _curses.KEY_SIC: "kIC",
+ _curses.KEY_SLEFT: "kLFT",
+ _curses.KEY_SMESSAGE: "kMSG",
+ _curses.KEY_SMOVE: "kMOV",
+ _curses.KEY_SNEXT: "kNXT",
+ _curses.KEY_SOPTIONS: "kOPT",
+ _curses.KEY_SPREVIOUS: "kPRV",
+ _curses.KEY_SPRINT: "kPRT",
+ _curses.KEY_SR: "kri",
+ _curses.KEY_SREDO: "kRDO",
+ _curses.KEY_SREPLACE: "kRPL",
+ _curses.KEY_SRIGHT: "kRIT",
+ _curses.KEY_SRSUME: "kRES",
+ _curses.KEY_SSAVE: "kSAV",
+ _curses.KEY_SSUSPEND: "kSPD",
+ _curses.KEY_STAB: "khts",
+ _curses.KEY_SUNDO: "kUND",
+ _curses.KEY_SUSPEND: "kspd",
+ _curses.KEY_UNDO: "kund",
+ _curses.KEY_UP: "kcuu1"
}
def has_key(ch):
@@ -175,7 +175,7 @@ def has_key(ch):
else:
return False
-if __name__ == '__main__':
+if __name__ == "__main__":
# Compare the output of this implementation and the ncurses has_key,
# on platforms where has_key is already available
try:
@@ -185,7 +185,7 @@ def has_key(ch):
system = _curses.has_key(key)
python = has_key(key)
if system != python:
- L.append( 'Mismatch for key %s, system=%i, Python=%i'
+ L.append( "Mismatch for key %s, system=%i, Python=%i"
% (_curses.keyname( key ), system, python) )
finally:
_curses.endwin()
diff --git a/.venv3.10/Lib/curses/textpad.py b/.venv3.10/Lib/curses/textpad.py
index 2079953a..0f13b1af 100644
--- a/.venv3.10/Lib/curses/textpad.py
+++ b/.venv3.10/Lib/curses/textpad.py
@@ -187,7 +187,7 @@ def edit(self, validate=None):
self.win.refresh()
return self.gather()
-if __name__ == '__main__':
+if __name__ == "__main__":
def test_editbox(stdscr):
ncols, nlines = 9, 4
uly, ulx = 15, 20
@@ -198,4 +198,4 @@ def test_editbox(stdscr):
return Textbox(win).edit()
str = curses.wrapper(test_editbox)
- print('Contents of text box:', repr(str))
+ print("Contents of text box:", repr(str))
diff --git a/.venv3.10/Lib/dataclasses.py b/.venv3.10/Lib/dataclasses.py
index 1742900e..f6d2e1df 100644
--- a/.venv3.10/Lib/dataclasses.py
+++ b/.venv3.10/Lib/dataclasses.py
@@ -4,28 +4,27 @@
import types
import inspect
import keyword
-import builtins
import functools
import abc
import _thread
from types import FunctionType, GenericAlias
-__all__ = ['dataclass',
- 'field',
- 'Field',
- 'FrozenInstanceError',
- 'InitVar',
- 'KW_ONLY',
- 'MISSING',
+__all__ = ["dataclass",
+ "field",
+ "Field",
+ "FrozenInstanceError",
+ "InitVar",
+ "KW_ONLY",
+ "MISSING",
# Helper functions.
- 'fields',
- 'asdict',
- 'astuple',
- 'make_dataclass',
- 'replace',
- 'is_dataclass',
+ "fields",
+ "asdict",
+ "astuple",
+ "make_dataclass",
+ "replace",
+ "is_dataclass",
]
# Conditions for adding methods. The boxes indicate what action the
@@ -176,7 +175,7 @@ class FrozenInstanceError(AttributeError): pass
# in the function signature of dataclasses' constructors.
class _HAS_DEFAULT_FACTORY_CLASS:
def __repr__(self):
- return ''
+ return ""
_HAS_DEFAULT_FACTORY = _HAS_DEFAULT_FACTORY_CLASS()
# A sentinel object to detect if a parameter is supplied or not. Use
@@ -201,26 +200,26 @@ def __init__(self, name):
self.name = name
def __repr__(self):
return self.name
-_FIELD = _FIELD_BASE('_FIELD')
-_FIELD_CLASSVAR = _FIELD_BASE('_FIELD_CLASSVAR')
-_FIELD_INITVAR = _FIELD_BASE('_FIELD_INITVAR')
+_FIELD = _FIELD_BASE("_FIELD")
+_FIELD_CLASSVAR = _FIELD_BASE("_FIELD_CLASSVAR")
+_FIELD_INITVAR = _FIELD_BASE("_FIELD_INITVAR")
# The name of an attribute on the class where we store the Field
# objects. Also used to check if a class is a Data Class.
-_FIELDS = '__dataclass_fields__'
+_FIELDS = "__dataclass_fields__"
# The name of an attribute on the class that stores the parameters to
# @dataclass.
-_PARAMS = '__dataclass_params__'
+_PARAMS = "__dataclass_params__"
# The name of the function, that if it exists, is called at the end of
# __init__.
-_POST_INIT_NAME = '__post_init__'
+_POST_INIT_NAME = "__post_init__"
# String regex that string annotations for ClassVar or InitVar must match.
# Allows "identifier.identifier[" or "identifier[".
# https://bugs.python.org/issue33453 for details.
-_MODULE_IDENTIFIER_RE = re.compile(r'^(?:\s*(\w+)\s*\.)?\s*(\w+)')
+_MODULE_IDENTIFIER_RE = re.compile(r"^(?:\s*(\w+)\s*\.)?\s*(\w+)")
# This function's logic is copied from "recursive_repr" function in
# reprlib module to avoid dependency.
@@ -233,7 +232,7 @@ def _recursive_repr(user_function):
def wrapper(self):
key = id(self), _thread.get_ident()
if key in repr_running:
- return '...'
+ return "..."
repr_running.add(key)
try:
result = user_function(self)
@@ -243,7 +242,7 @@ def wrapper(self):
return wrapper
class InitVar:
- __slots__ = ('type', )
+ __slots__ = ("type", )
def __init__(self, type):
self.type = type
@@ -254,7 +253,7 @@ def __repr__(self):
else:
# typing objects, e.g. List[int]
type_name = repr(self.type)
- return f'dataclasses.InitVar[{type_name}]'
+ return f"dataclasses.InitVar[{type_name}]"
def __class_getitem__(cls, type):
return InitVar(type)
@@ -270,17 +269,17 @@ def __class_getitem__(cls, type):
# When cls._FIELDS is filled in with a list of Field objects, the name
# and type fields will have been populated.
class Field:
- __slots__ = ('name',
- 'type',
- 'default',
- 'default_factory',
- 'repr',
- 'hash',
- 'init',
- 'compare',
- 'metadata',
- 'kw_only',
- '_field_type', # Private: not to be used by user code.
+ __slots__ = ("name",
+ "type",
+ "default",
+ "default_factory",
+ "repr",
+ "hash",
+ "init",
+ "compare",
+ "metadata",
+ "kw_only",
+ "_field_type", # Private: not to be used by user code.
)
def __init__(self, default, default_factory, init, repr, hash, compare,
@@ -301,19 +300,19 @@ def __init__(self, default, default_factory, init, repr, hash, compare,
@_recursive_repr
def __repr__(self):
- return ('Field('
- f'name={self.name!r},'
- f'type={self.type!r},'
- f'default={self.default!r},'
- f'default_factory={self.default_factory!r},'
- f'init={self.init!r},'
- f'repr={self.repr!r},'
- f'hash={self.hash!r},'
- f'compare={self.compare!r},'
- f'metadata={self.metadata!r},'
- f'kw_only={self.kw_only!r},'
- f'_field_type={self._field_type}'
- ')')
+ return ("Field("
+ f"name={self.name!r},"
+ f"type={self.type!r},"
+ f"default={self.default!r},"
+ f"default_factory={self.default_factory!r},"
+ f"init={self.init!r},"
+ f"repr={self.repr!r},"
+ f"hash={self.hash!r},"
+ f"compare={self.compare!r},"
+ f"metadata={self.metadata!r},"
+ f"kw_only={self.kw_only!r},"
+ f"_field_type={self._field_type}"
+ ")")
# This is used to support the PEP 487 __set_name__ protocol in the
# case where we're using a field that contains a descriptor as a
@@ -324,7 +323,7 @@ def __repr__(self):
# with the default value, so the end result is a descriptor that
# had __set_name__ called on it at the right time.
def __set_name__(self, owner, name):
- func = getattr(type(self.default), '__set_name__', None)
+ func = getattr(type(self.default), "__set_name__", None)
if func:
# There is a __set_name__ method on the descriptor, call
# it.
@@ -334,12 +333,12 @@ def __set_name__(self, owner, name):
class _DataclassParams:
- __slots__ = ('init',
- 'repr',
- 'eq',
- 'order',
- 'unsafe_hash',
- 'frozen',
+ __slots__ = ("init",
+ "repr",
+ "eq",
+ "order",
+ "unsafe_hash",
+ "frozen",
)
def __init__(self, init, repr, eq, order, unsafe_hash, frozen):
@@ -351,14 +350,14 @@ def __init__(self, init, repr, eq, order, unsafe_hash, frozen):
self.frozen = frozen
def __repr__(self):
- return ('_DataclassParams('
- f'init={self.init!r},'
- f'repr={self.repr!r},'
- f'eq={self.eq!r},'
- f'order={self.order!r},'
- f'unsafe_hash={self.unsafe_hash!r},'
- f'frozen={self.frozen!r}'
- ')')
+ return ("_DataclassParams("
+ f"init={self.init!r},"
+ f"repr={self.repr!r},"
+ f"eq={self.eq!r},"
+ f"order={self.order!r},"
+ f"unsafe_hash={self.unsafe_hash!r},"
+ f"frozen={self.frozen!r}"
+ ")")
# This function is used instead of exposing Field creation directly,
@@ -383,7 +382,7 @@ def field(*, default=MISSING, default_factory=MISSING, init=True, repr=True,
"""
if default is not MISSING and default_factory is not MISSING:
- raise ValueError('cannot specify both default and default_factory')
+ raise ValueError("cannot specify both default and default_factory")
return Field(default, default_factory, init, repr, hash, compare,
metadata, kw_only)
@@ -404,7 +403,7 @@ def _tuple_str(obj_name, fields):
# Special case for the 0-tuple.
if not fields:
- return '()'
+ return "()"
# Note the trailing comma, needed if this turns out to be a 1-tuple.
return f'({",".join([f"{obj_name}.{f.name}" for f in fields])},)'
@@ -416,21 +415,21 @@ def _create_fn(name, args, body, *, globals=None, locals=None,
# worries about external callers.
if locals is None:
locals = {}
- return_annotation = ''
+ return_annotation = ""
if return_type is not MISSING:
- locals['_return_type'] = return_type
- return_annotation = '->_return_type'
- args = ','.join(args)
- body = '\n'.join(f' {b}' for b in body)
+ locals["_return_type"] = return_type
+ return_annotation = "->_return_type"
+ args = ",".join(args)
+ body = "\n".join(f" {b}" for b in body)
# Compute the text of the entire function.
- txt = f' def {name}({args}){return_annotation}:\n{body}'
+ txt = f" def {name}({args}){return_annotation}:\n{body}"
- local_vars = ', '.join(locals.keys())
+ local_vars = ", ".join(locals.keys())
txt = f"def __create_fn__({local_vars}):\n{txt}\n return {name}"
ns = {}
exec(txt, globals, ns)
- return ns['__create_fn__'](**locals)
+ return ns["__create_fn__"](**locals)
def _field_assign(frozen, name, value, self_name):
@@ -441,23 +440,23 @@ def _field_assign(frozen, name, value, self_name):
# self_name is what "self" is called in this function: don't
# hard-code "self", since that might be a field name.
if frozen:
- return f'__dataclass_builtins_object__.__setattr__({self_name},{name!r},{value})'
- return f'{self_name}.{name}={value}'
+ return f"__dataclass_builtins_object__.__setattr__({self_name},{name!r},{value})"
+ return f"{self_name}.{name}={value}"
def _field_init(f, frozen, globals, self_name, slots):
# Return the text of the line in the body of __init__ that will
# initialize this field.
- default_name = f'_dflt_{f.name}'
+ default_name = f"_dflt_{f.name}"
if f.default_factory is not MISSING:
if f.init:
# This field has a default factory. If a parameter is
# given, use it. If not, call the factory.
globals[default_name] = f.default_factory
- value = (f'{default_name}() '
- f'if {f.name} is _HAS_DEFAULT_FACTORY '
- f'else {f.name}')
+ value = (f"{default_name}() "
+ f"if {f.name} is _HAS_DEFAULT_FACTORY "
+ f"else {f.name}")
else:
# This is a field that's not in the __init__ params, but
# has a default factory function. It needs to be
@@ -474,7 +473,7 @@ def _field_init(f, frozen, globals, self_name, slots):
# (which, after all, is why we have a factory function!).
globals[default_name] = f.default_factory
- value = f'{default_name}()'
+ value = f"{default_name}()"
else:
# No default factory.
if f.init:
@@ -513,15 +512,15 @@ def _init_param(f):
if f.default is MISSING and f.default_factory is MISSING:
# There's no default, and no default_factory, just output the
# variable name and type.
- default = ''
+ default = ""
elif f.default is not MISSING:
# There's a default, this will be the name that's used to look
# it up.
- default = f'=_dflt_{f.name}'
+ default = f"=_dflt_{f.name}"
elif f.default_factory is not MISSING:
# There's a factory function. Set a marker.
- default = '=_HAS_DEFAULT_FACTORY'
- return f'{f.name}:_type_{f.name}{default}'
+ default = "=_HAS_DEFAULT_FACTORY"
+ return f"{f.name}:_type_{f.name}{default}"
def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
@@ -541,14 +540,14 @@ def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
if not (f.default is MISSING and f.default_factory is MISSING):
seen_default = True
elif seen_default:
- raise TypeError(f'non-default argument {f.name!r} '
- 'follows default argument')
+ raise TypeError(f"non-default argument {f.name!r} "
+ "follows default argument")
- locals = {f'_type_{f.name}': f.type for f in fields}
+ locals = {f"_type_{f.name}": f.type for f in fields}
locals.update({
- 'MISSING': MISSING,
- '_HAS_DEFAULT_FACTORY': _HAS_DEFAULT_FACTORY,
- '__dataclass_builtins_object__': object,
+ "MISSING": MISSING,
+ "_HAS_DEFAULT_FACTORY": _HAS_DEFAULT_FACTORY,
+ "__dataclass_builtins_object__": object,
})
body_lines = []
@@ -561,22 +560,22 @@ def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
# Does this class have a post-init function?
if has_post_init:
- params_str = ','.join(f.name for f in fields
+ params_str = ",".join(f.name for f in fields
if f._field_type is _FIELD_INITVAR)
- body_lines.append(f'{self_name}.{_POST_INIT_NAME}({params_str})')
+ body_lines.append(f"{self_name}.{_POST_INIT_NAME}({params_str})")
# If no body lines, use 'pass'.
if not body_lines:
- body_lines = ['pass']
+ body_lines = ["pass"]
_init_params = [_init_param(f) for f in std_fields]
if kw_only_fields:
# Add the keyword-only args. Because the * can only be added if
# there's at least one keyword-only arg, there needs to be a test here
# (instead of just concatenting the lists together).
- _init_params += ['*']
+ _init_params += ["*"]
_init_params += [_init_param(f) for f in kw_only_fields]
- return _create_fn('__init__',
+ return _create_fn("__init__",
[self_name] + _init_params,
body_lines,
locals=locals,
@@ -585,10 +584,10 @@ def _init_fn(fields, std_fields, kw_only_fields, frozen, has_post_init,
def _repr_fn(fields, globals):
- fn = _create_fn('__repr__',
- ('self',),
+ fn = _create_fn("__repr__",
+ ("self",),
['return self.__class__.__qualname__ + f"(' +
- ', '.join([f"{f.name}={{self.{f.name}!r}}"
+ ", ".join([f"{f.name}={{self.{f.name}!r}}"
for f in fields]) +
')"'],
globals=globals)
@@ -596,25 +595,25 @@ def _repr_fn(fields, globals):
def _frozen_get_del_attr(cls, fields, globals):
- locals = {'cls': cls,
- 'FrozenInstanceError': FrozenInstanceError}
+ locals = {"cls": cls,
+ "FrozenInstanceError": FrozenInstanceError}
if fields:
- fields_str = '(' + ','.join(repr(f.name) for f in fields) + ',)'
+ fields_str = "(" + ",".join(repr(f.name) for f in fields) + ",)"
else:
# Special case for the zero-length tuple.
- fields_str = '()'
- return (_create_fn('__setattr__',
- ('self', 'name', 'value'),
- (f'if type(self) is cls or name in {fields_str}:',
+ fields_str = "()"
+ return (_create_fn("__setattr__",
+ ("self", "name", "value"),
+ (f"if type(self) is cls or name in {fields_str}:",
' raise FrozenInstanceError(f"cannot assign to field {name!r}")',
- f'super(cls, self).__setattr__(name, value)'),
+ "super(cls, self).__setattr__(name, value)"),
locals=locals,
globals=globals),
- _create_fn('__delattr__',
- ('self', 'name'),
- (f'if type(self) is cls or name in {fields_str}:',
+ _create_fn("__delattr__",
+ ("self", "name"),
+ (f"if type(self) is cls or name in {fields_str}:",
' raise FrozenInstanceError(f"cannot delete field {name!r}")',
- f'super(cls, self).__delattr__(name)'),
+ "super(cls, self).__delattr__(name)"),
locals=locals,
globals=globals),
)
@@ -627,18 +626,18 @@ def _cmp_fn(name, op, self_tuple, other_tuple, globals):
# '(other.x,other.y)'.
return _create_fn(name,
- ('self', 'other'),
- [ 'if other.__class__ is self.__class__:',
- f' return {self_tuple}{op}{other_tuple}',
- 'return NotImplemented'],
+ ("self", "other"),
+ [ "if other.__class__ is self.__class__:",
+ f" return {self_tuple}{op}{other_tuple}",
+ "return NotImplemented"],
globals=globals)
def _hash_fn(fields, globals):
- self_tuple = _tuple_str('self', fields)
- return _create_fn('__hash__',
- ('self',),
- [f'return hash({self_tuple})'],
+ self_tuple = _tuple_str("self", fields)
+ return _create_fn("__hash__",
+ ("self",),
+ [f"return hash({self_tuple})"],
globals=globals)
@@ -759,7 +758,7 @@ def _get_field(cls, a_name, a_type, default_kw_only):
# annotation to be a ClassVar. So, only look for ClassVar if
# typing has been imported by any module (not necessarily cls's
# module).
- typing = sys.modules.get('typing')
+ typing = sys.modules.get("typing")
if typing:
if (_is_classvar(a_type, typing)
or (isinstance(f.type, str)
@@ -786,8 +785,8 @@ def _get_field(cls, a_name, a_type, default_kw_only):
# Special restrictions for ClassVar and InitVar.
if f._field_type in (_FIELD_CLASSVAR, _FIELD_INITVAR):
if f.default_factory is not MISSING:
- raise TypeError(f'field {f.name} cannot have a '
- 'default factory')
+ raise TypeError(f"field {f.name} cannot have a "
+ "default factory")
# Should I check for other field settings? default_factory
# seems the most serious to check for. Maybe add others. For
# example, how about init=False (or really,
@@ -804,13 +803,13 @@ def _get_field(cls, a_name, a_type, default_kw_only):
# Make sure kw_only isn't set for ClassVars
assert f._field_type is _FIELD_CLASSVAR
if f.kw_only is not MISSING:
- raise TypeError(f'field {f.name} is a ClassVar but specifies '
- 'kw_only')
+ raise TypeError(f"field {f.name} is a ClassVar but specifies "
+ "kw_only")
# For real fields, disallow mutable defaults for known types.
if f._field_type is _FIELD and isinstance(f.default, (list, dict, set)):
- raise ValueError(f'mutable default {type(f.default)} for field '
- f'{f.name} is not allowed: use default_factory')
+ raise ValueError(f"mutable default {type(f.default)} for field "
+ f"{f.name} is not allowed: use default_factory")
return f
@@ -845,8 +844,8 @@ def _hash_add(cls, fields, globals):
def _hash_exception(cls, fields, globals):
# Raise an exception.
- raise TypeError(f'Cannot overwrite attribute __hash__ '
- f'in class {cls.__name__}')
+ raise TypeError(f"Cannot overwrite attribute __hash__ "
+ f"in class {cls.__name__}")
#
# +-------------------------------------- unsafe_hash?
@@ -928,7 +927,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# actual default value. Pseudo-fields ClassVars and InitVars are
# included, despite the fact that they're not real fields. That's
# dealt with later.
- cls_annotations = cls.__dict__.get('__annotations__', {})
+ cls_annotations = cls.__dict__.get("__annotations__", {})
# Now find fields in our class. While doing so, validate some
# things, and set the default values (as class attributes) where
@@ -946,8 +945,8 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# Switch the default to kw_only=True, and ignore this
# annotation: it's not a real field.
if KW_ONLY_seen:
- raise TypeError(f'{name!r} is KW_ONLY, but KW_ONLY '
- 'has already been specified')
+ raise TypeError(f"{name!r} is KW_ONLY, but KW_ONLY "
+ "has already been specified")
KW_ONLY_seen = True
kw_only = True
else:
@@ -975,20 +974,20 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# Do we have any Field members that don't also have annotations?
for name, value in cls.__dict__.items():
- if isinstance(value, Field) and not name in cls_annotations:
- raise TypeError(f'{name!r} is a field but has no type annotation')
+ if isinstance(value, Field) and name not in cls_annotations:
+ raise TypeError(f"{name!r} is a field but has no type annotation")
# Check rules that apply if we are derived from any dataclasses.
if has_dataclass_bases:
# Raise an exception if any of our bases are frozen, but we're not.
if any_frozen_base and not frozen:
- raise TypeError('cannot inherit non-frozen dataclass from a '
- 'frozen one')
+ raise TypeError("cannot inherit non-frozen dataclass from a "
+ "frozen one")
# Raise an exception if we're frozen, but none of our bases are.
if not any_frozen_base and frozen:
- raise TypeError('cannot inherit frozen dataclass from a '
- 'non-frozen one')
+ raise TypeError("cannot inherit frozen dataclass from a "
+ "non-frozen one")
# Remember all of the fields on our class (including bases). This
# also marks this class as being a dataclass.
@@ -999,14 +998,14 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# set __hash__ to None. This is a heuristic, as it's possible
# that such a __hash__ == None was not auto-generated, but it
# close enough.
- class_hash = cls.__dict__.get('__hash__', MISSING)
+ class_hash = cls.__dict__.get("__hash__", MISSING)
has_explicit_hash = not (class_hash is MISSING or
- (class_hash is None and '__eq__' in cls.__dict__))
+ (class_hash is None and "__eq__" in cls.__dict__))
# If we're generating ordering methods, we must be generating the
# eq methods.
if order and not eq:
- raise ValueError('eq must be true if order is true')
+ raise ValueError("eq must be true if order is true")
# Include InitVars and regular fields (so, not ClassVars). This is
# initialized here, outside of the "if init:" test, because std_init_fields
@@ -1020,7 +1019,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# Does this class have a post-init function?
has_post_init = hasattr(cls, _POST_INIT_NAME)
- _set_new_attribute(cls, '__init__',
+ _set_new_attribute(cls, "__init__",
_init_fn(all_init_fields,
std_init_fields,
kw_only_init_fields,
@@ -1029,8 +1028,8 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# The name to use for the "self"
# param in __init__. Use "self"
# if possible.
- '__dataclass_self__' if 'self' in fields
- else 'self',
+ "__dataclass_self__" if "self" in fields
+ else "self",
globals,
slots,
))
@@ -1041,41 +1040,41 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
if repr:
flds = [f for f in field_list if f.repr]
- _set_new_attribute(cls, '__repr__', _repr_fn(flds, globals))
+ _set_new_attribute(cls, "__repr__", _repr_fn(flds, globals))
if eq:
# Create __eq__ method. There's no need for a __ne__ method,
# since python will call __eq__ and negate it.
flds = [f for f in field_list if f.compare]
- self_tuple = _tuple_str('self', flds)
- other_tuple = _tuple_str('other', flds)
- _set_new_attribute(cls, '__eq__',
- _cmp_fn('__eq__', '==',
+ self_tuple = _tuple_str("self", flds)
+ other_tuple = _tuple_str("other", flds)
+ _set_new_attribute(cls, "__eq__",
+ _cmp_fn("__eq__", "==",
self_tuple, other_tuple,
globals=globals))
if order:
# Create and set the ordering methods.
flds = [f for f in field_list if f.compare]
- self_tuple = _tuple_str('self', flds)
- other_tuple = _tuple_str('other', flds)
- for name, op in [('__lt__', '<'),
- ('__le__', '<='),
- ('__gt__', '>'),
- ('__ge__', '>='),
+ self_tuple = _tuple_str("self", flds)
+ other_tuple = _tuple_str("other", flds)
+ for name, op in [("__lt__", "<"),
+ ("__le__", "<="),
+ ("__gt__", ">"),
+ ("__ge__", ">="),
]:
if _set_new_attribute(cls, name,
_cmp_fn(name, op, self_tuple, other_tuple,
globals=globals)):
- raise TypeError(f'Cannot overwrite attribute {name} '
- f'in class {cls.__name__}. Consider using '
- 'functools.total_ordering')
+ raise TypeError(f"Cannot overwrite attribute {name} "
+ f"in class {cls.__name__}. Consider using "
+ "functools.total_ordering")
if frozen:
for fn in _frozen_get_del_attr(cls, field_list, globals):
if _set_new_attribute(cls, fn.__name__, fn):
- raise TypeError(f'Cannot overwrite attribute {fn.__name__} '
- f'in class {cls.__name__}')
+ raise TypeError(f"Cannot overwrite attribute {fn.__name__} "
+ f"in class {cls.__name__}")
# Decide if/how we're going to create a hash function.
hash_action = _hash_action[bool(unsafe_hash),
@@ -1087,14 +1086,14 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
# we're here the overwriting is unconditional.
cls.__hash__ = hash_action(cls, field_list, globals)
- if not getattr(cls, '__doc__'):
+ if not cls.__doc__:
# Create a class doc-string.
cls.__doc__ = (cls.__name__ +
- str(inspect.signature(cls)).replace(' -> None', ''))
+ str(inspect.signature(cls)).replace(" -> None", ""))
if match_args:
# I could probably compute this once
- _set_new_attribute(cls, '__match_args__',
+ _set_new_attribute(cls, "__match_args__",
tuple(f.name for f in std_init_fields))
if slots:
@@ -1124,23 +1123,23 @@ def _add_slots(cls, is_frozen):
# after a class has been created.
# Make sure __slots__ isn't already set.
- if '__slots__' in cls.__dict__:
- raise TypeError(f'{cls.__name__} already specifies __slots__')
+ if "__slots__" in cls.__dict__:
+ raise TypeError(f"{cls.__name__} already specifies __slots__")
# Create a new dict for our new class.
cls_dict = dict(cls.__dict__)
field_names = tuple(f.name for f in fields(cls))
- cls_dict['__slots__'] = field_names
+ cls_dict["__slots__"] = field_names
for field_name in field_names:
# Remove our attributes, if present. They'll still be
# available in _MARKER.
cls_dict.pop(field_name, None)
# Remove __dict__ itself.
- cls_dict.pop('__dict__', None)
+ cls_dict.pop("__dict__", None)
# And finally create the class.
- qualname = getattr(cls, '__qualname__', None)
+ qualname = getattr(cls, "__qualname__", None)
cls = type(cls)(cls.__name__, cls.__bases__, cls_dict)
if qualname is not None:
cls.__qualname__ = qualname
@@ -1195,7 +1194,7 @@ def fields(class_or_instance):
try:
fields = getattr(class_or_instance, _FIELDS)
except AttributeError:
- raise TypeError('must be called with a dataclass type or instance') from None
+ raise TypeError("must be called with a dataclass type or instance") from None
# Exclude pseudo-fields. Note that fields is sorted by insertion
# order, so the order of the tuple is as the fields were defined.
@@ -1245,7 +1244,7 @@ def _asdict_inner(obj, dict_factory):
value = _asdict_inner(getattr(obj, f.name), dict_factory)
result.append((f.name, value))
return dict_factory(result)
- elif isinstance(obj, tuple) and hasattr(obj, '_fields'):
+ elif isinstance(obj, tuple) and hasattr(obj, "_fields"):
# obj is a namedtuple. Recurse into it, but the returned
# object is another namedtuple of the same type. This is
# similar to how other list- or tuple-derived classes are
@@ -1310,7 +1309,7 @@ def _astuple_inner(obj, tuple_factory):
value = _astuple_inner(getattr(obj, f.name), tuple_factory)
result.append(value)
return tuple_factory(result)
- elif isinstance(obj, tuple) and hasattr(obj, '_fields'):
+ elif isinstance(obj, tuple) and hasattr(obj, "_fields"):
# obj is a namedtuple. Recurse into it, but the returned
# object is another namedtuple of the same type. This is
# similar to how other list- or tuple-derived classes are
@@ -1367,21 +1366,21 @@ class C(Base):
for item in fields:
if isinstance(item, str):
name = item
- tp = 'typing.Any'
+ tp = "typing.Any"
elif len(item) == 2:
name, tp, = item
elif len(item) == 3:
name, tp, spec = item
defaults[name] = spec
else:
- raise TypeError(f'Invalid field: {item!r}')
+ raise TypeError(f"Invalid field: {item!r}")
if not isinstance(name, str) or not name.isidentifier():
- raise TypeError(f'Field names must be valid identifiers: {name!r}')
+ raise TypeError(f"Field names must be valid identifiers: {name!r}")
if keyword.iskeyword(name):
- raise TypeError(f'Field names must not be keywords: {name!r}')
+ raise TypeError(f"Field names must not be keywords: {name!r}")
if name in seen:
- raise TypeError(f'Field name duplicated: {name!r}')
+ raise TypeError(f"Field name duplicated: {name!r}")
seen.add(name)
annotations[name] = tp
@@ -1390,7 +1389,7 @@ class C(Base):
def exec_body_callback(ns):
ns.update(namespace)
ns.update(defaults)
- ns['__annotations__'] = annotations
+ ns["__annotations__"] = annotations
# We use `types.new_class()` instead of simply `type()` to allow dynamic creation
# of generic dataclasses.
@@ -1434,15 +1433,15 @@ class C:
if not f.init:
# Error if this field is specified in changes.
if f.name in changes:
- raise ValueError(f'field {f.name} is declared with '
- 'init=False, it cannot be specified with '
- 'replace()')
+ raise ValueError(f"field {f.name} is declared with "
+ "init=False, it cannot be specified with "
+ "replace()")
continue
if f.name not in changes:
if f._field_type is _FIELD_INITVAR and f.default is MISSING:
raise ValueError(f"InitVar {f.name!r} "
- 'must be specified with replace()')
+ "must be specified with replace()")
changes[f.name] = getattr(obj, f.name)
# Create the new object, which calls __init__() and
diff --git a/.venv3.10/Lib/datetime.py b/.venv3.10/Lib/datetime.py
index d087c985..baab7b1d 100644
--- a/.venv3.10/Lib/datetime.py
+++ b/.venv3.10/Lib/datetime.py
@@ -57,14 +57,14 @@ def _days_in_month(year, month):
def _days_before_month(year, month):
"year, month -> number of days in year preceding first day of month."
- assert 1 <= month <= 12, 'month must be in 1..12'
+ assert 1 <= month <= 12, "month must be in 1..12"
return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))
def _ymd2ord(year, month, day):
"year, month, day -> ordinal, considering 01-Jan-0001 as day 1."
- assert 1 <= month <= 12, 'month must be in 1..12'
+ assert 1 <= month <= 12, "month must be in 1..12"
dim = _days_in_month(year, month)
- assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
+ assert 1 <= day <= dim, ("day must be in 1..%d" % dim)
return (_days_before_year(year) +
_days_before_month(year, month) +
day)
@@ -158,29 +158,29 @@ def _build_struct_time(y, m, d, hh, mm, ss, dstflag):
dnum = _days_before_month(y, m) + d
return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))
-def _format_time(hh, mm, ss, us, timespec='auto'):
+def _format_time(hh, mm, ss, us, timespec="auto"):
specs = {
- 'hours': '{:02d}',
- 'minutes': '{:02d}:{:02d}',
- 'seconds': '{:02d}:{:02d}:{:02d}',
- 'milliseconds': '{:02d}:{:02d}:{:02d}.{:03d}',
- 'microseconds': '{:02d}:{:02d}:{:02d}.{:06d}'
+ "hours": "{:02d}",
+ "minutes": "{:02d}:{:02d}",
+ "seconds": "{:02d}:{:02d}:{:02d}",
+ "milliseconds": "{:02d}:{:02d}:{:02d}.{:03d}",
+ "microseconds": "{:02d}:{:02d}:{:02d}.{:06d}"
}
- if timespec == 'auto':
+ if timespec == "auto":
# Skip trailing microseconds when us==0.
- timespec = 'microseconds' if us else 'seconds'
- elif timespec == 'milliseconds':
+ timespec = "microseconds" if us else "seconds"
+ elif timespec == "milliseconds":
us //= 1000
try:
fmt = specs[timespec]
except KeyError:
- raise ValueError('Unknown timespec value')
+ raise ValueError("Unknown timespec value")
else:
return fmt.format(hh, mm, ss, us)
def _format_offset(off):
- s = ''
+ s = ""
if off is not None:
if off.days < 0:
sign = "-"
@@ -194,7 +194,7 @@ def _format_offset(off):
s += ":%02d" % ss.seconds
if ss.microseconds:
- s += '.%06d' % ss.microseconds
+ s += ".%06d" % ss.microseconds
return s
# Correctly substitute for %z and %Z escapes in strftime formats.
@@ -211,51 +211,51 @@ def _wrap_strftime(object, format, timetuple):
while i < n:
ch = format[i]
i += 1
- if ch == '%':
+ if ch == "%":
if i < n:
ch = format[i]
i += 1
- if ch == 'f':
+ if ch == "f":
if freplace is None:
- freplace = '%06d' % getattr(object,
- 'microsecond', 0)
+ freplace = "%06d" % getattr(object,
+ "microsecond", 0)
newformat.append(freplace)
- elif ch == 'z':
+ elif ch == "z":
if zreplace is None:
zreplace = ""
if hasattr(object, "utcoffset"):
offset = object.utcoffset()
if offset is not None:
- sign = '+'
+ sign = "+"
if offset.days < 0:
offset = -offset
- sign = '-'
+ sign = "-"
h, rest = divmod(offset, timedelta(hours=1))
m, rest = divmod(rest, timedelta(minutes=1))
s = rest.seconds
u = offset.microseconds
if u:
- zreplace = '%c%02d%02d%02d.%06d' % (sign, h, m, s, u)
+ zreplace = "%c%02d%02d%02d.%06d" % (sign, h, m, s, u)
elif s:
- zreplace = '%c%02d%02d%02d' % (sign, h, m, s)
+ zreplace = "%c%02d%02d%02d" % (sign, h, m, s)
else:
- zreplace = '%c%02d%02d' % (sign, h, m)
- assert '%' not in zreplace
+ zreplace = "%c%02d%02d" % (sign, h, m)
+ assert "%" not in zreplace
newformat.append(zreplace)
- elif ch == 'Z':
+ elif ch == "Z":
if Zreplace is None:
Zreplace = ""
if hasattr(object, "tzname"):
s = object.tzname()
if s is not None:
# strftime is going to have at this: escape %
- Zreplace = s.replace('%', '%%')
+ Zreplace = s.replace("%", "%%")
newformat.append(Zreplace)
else:
- push('%')
+ push("%")
push(ch)
else:
- push('%')
+ push("%")
else:
push(ch)
newformat = "".join(newformat)
@@ -266,13 +266,13 @@ def _parse_isoformat_date(dtstr):
# It is assumed that this function will only be called with a
# string of length exactly 10, and (though this is not used) ASCII-only
year = int(dtstr[0:4])
- if dtstr[4] != '-':
- raise ValueError('Invalid date separator: %s' % dtstr[4])
+ if dtstr[4] != "-":
+ raise ValueError("Invalid date separator: %s" % dtstr[4])
month = int(dtstr[5:7])
- if dtstr[7] != '-':
- raise ValueError('Invalid date separator')
+ if dtstr[7] != "-":
+ raise ValueError("Invalid date separator")
day = int(dtstr[8:10])
@@ -286,7 +286,7 @@ def _parse_hh_mm_ss_ff(tstr):
pos = 0
for comp in range(0, 3):
if (len_str - pos) < 2:
- raise ValueError('Incomplete time component')
+ raise ValueError("Incomplete time component")
time_comps[comp] = int(tstr[pos:pos+2])
@@ -296,20 +296,20 @@ def _parse_hh_mm_ss_ff(tstr):
if not next_char or comp >= 2:
break
- if next_char != ':':
- raise ValueError('Invalid time separator: %c' % next_char)
+ if next_char != ":":
+ raise ValueError("Invalid time separator: %c" % next_char)
pos += 1
if pos < len_str:
- if tstr[pos] != '.':
- raise ValueError('Invalid microsecond component')
+ if tstr[pos] != ".":
+ raise ValueError("Invalid microsecond component")
else:
pos += 1
len_remainder = len_str - pos
if len_remainder not in (3, 6):
- raise ValueError('Invalid microsecond component')
+ raise ValueError("Invalid microsecond component")
time_comps[3] = int(tstr[pos:])
if len_remainder == 3:
@@ -321,10 +321,10 @@ def _parse_isoformat_time(tstr):
# Format supported is HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]
len_str = len(tstr)
if len_str < 2:
- raise ValueError('Isoformat time too short')
+ raise ValueError("Isoformat time too short")
# This is equivalent to re.search('[+-]', tstr), but faster
- tz_pos = (tstr.find('-') + 1 or tstr.find('+') + 1)
+ tz_pos = (tstr.find("-") + 1 or tstr.find("+") + 1)
timestr = tstr[:tz_pos-1] if tz_pos > 0 else tstr
time_comps = _parse_hh_mm_ss_ff(timestr)
@@ -339,13 +339,13 @@ def _parse_isoformat_time(tstr):
# HH:MM:SS.ffffff len: 15
if len(tzstr) not in (5, 8, 15):
- raise ValueError('Malformed time zone string')
+ raise ValueError("Malformed time zone string")
tz_comps = _parse_hh_mm_ss_ff(tzstr)
if all(x == 0 for x in tz_comps):
tzi = timezone.utc
else:
- tzsign = -1 if tstr[tz_pos - 1] == '-' else 1
+ tzsign = -1 if tstr[tz_pos - 1] == "-" else 1
td = timedelta(hours=tz_comps[0], minutes=tz_comps[1],
seconds=tz_comps[2], microseconds=tz_comps[3])
@@ -386,12 +386,12 @@ def _check_date_fields(year, month, day):
month = _index(month)
day = _index(day)
if not MINYEAR <= year <= MAXYEAR:
- raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)
+ raise ValueError("year must be in %d..%d" % (MINYEAR, MAXYEAR), year)
if not 1 <= month <= 12:
- raise ValueError('month must be in 1..12', month)
+ raise ValueError("month must be in 1..12", month)
dim = _days_in_month(year, month)
if not 1 <= day <= dim:
- raise ValueError('day must be in 1..%d' % dim, day)
+ raise ValueError("day must be in 1..%d" % dim, day)
return year, month, day
def _check_time_fields(hour, minute, second, microsecond, fold):
@@ -400,15 +400,15 @@ def _check_time_fields(hour, minute, second, microsecond, fold):
second = _index(second)
microsecond = _index(microsecond)
if not 0 <= hour <= 23:
- raise ValueError('hour must be in 0..23', hour)
+ raise ValueError("hour must be in 0..23", hour)
if not 0 <= minute <= 59:
- raise ValueError('minute must be in 0..59', minute)
+ raise ValueError("minute must be in 0..59", minute)
if not 0 <= second <= 59:
- raise ValueError('second must be in 0..59', second)
+ raise ValueError("second must be in 0..59", second)
if not 0 <= microsecond <= 999999:
- raise ValueError('microsecond must be in 0..999999', microsecond)
+ raise ValueError("microsecond must be in 0..999999", microsecond)
if fold not in (0, 1):
- raise ValueError('fold must be either 0 or 1', fold)
+ raise ValueError("fold must be either 0 or 1", fold)
return hour, minute, second, microsecond, fold
def _check_tzinfo_arg(tz):
@@ -456,7 +456,7 @@ class timedelta:
Representation: (days, seconds, microseconds). Why? Because I
felt like it.
"""
- __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'
+ __slots__ = "_days", "_seconds", "_microseconds", "_hashcode"
def __new__(cls, days=0, seconds=0, microseconds=0,
milliseconds=0, minutes=0, hours=0, weeks=0):
@@ -568,10 +568,10 @@ def __repr__(self):
if self._microseconds:
args.append("microseconds=%d" % self._microseconds)
if not args:
- args.append('0')
+ args.append("0")
return "%s.%s(%s)" % (self.__class__.__module__,
self.__class__.__qualname__,
- ', '.join(args))
+ ", ".join(args))
def __str__(self):
mm, ss = divmod(self._seconds, 60)
@@ -787,7 +787,7 @@ class date:
Properties (readonly):
year, month, day
"""
- __slots__ = '_year', '_month', '_day', '_hashcode'
+ __slots__ = "_year", "_month", "_day", "_hashcode"
def __new__(cls, year, month=None, day=None):
"""Constructor.
@@ -802,7 +802,7 @@ def __new__(cls, year, month=None, day=None):
# Pickle support
if isinstance(year, str):
try:
- year = year.encode('latin1')
+ year = year.encode("latin1")
except UnicodeEncodeError:
# More informative error message.
raise ValueError(
@@ -849,13 +849,13 @@ def fromordinal(cls, n):
def fromisoformat(cls, date_string):
"""Construct a date from the output of date.isoformat()."""
if not isinstance(date_string, str):
- raise TypeError('fromisoformat: argument must be str')
+ raise TypeError("fromisoformat: argument must be str")
try:
assert len(date_string) == 10
return cls(*_parse_isoformat_date(date_string))
except Exception:
- raise ValueError(f'Invalid isoformat string: {date_string!r}')
+ raise ValueError(f"Invalid isoformat string: {date_string!r}")
@classmethod
def fromisocalendar(cls, year, week, day):
@@ -1203,8 +1203,8 @@ def __reduce__(self):
return (tuple, (tuple(self),))
def __repr__(self):
- return (f'{self.__class__.__name__}'
- f'(year={self[0]}, week={self[1]}, weekday={self[2]})')
+ return (f"{self.__class__.__name__}"
+ f"(year={self[0]}, week={self[1]}, weekday={self[2]})")
_IsoCalendarDate = IsoCalendarDate
@@ -1234,7 +1234,7 @@ class time:
Properties (readonly):
hour, minute, second, microsecond, tzinfo, fold
"""
- __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'
+ __slots__ = "_hour", "_minute", "_second", "_microsecond", "_tzinfo", "_hashcode", "_fold"
def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):
"""Constructor.
@@ -1251,7 +1251,7 @@ def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold
# Pickle support
if isinstance(hour, str):
try:
- hour = hour.encode('latin1')
+ hour = hour.encode("latin1")
except UnicodeEncodeError:
# More informative error message.
raise ValueError(
@@ -1414,7 +1414,7 @@ def __repr__(self):
s = s[:-1] + ", fold=1)"
return s
- def isoformat(self, timespec='auto'):
+ def isoformat(self, timespec="auto"):
"""Return the time formatted according to ISO.
The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
@@ -1437,12 +1437,12 @@ def isoformat(self, timespec='auto'):
def fromisoformat(cls, time_string):
"""Construct a time from the output of isoformat()."""
if not isinstance(time_string, str):
- raise TypeError('fromisoformat: argument must be str')
+ raise TypeError("fromisoformat: argument must be str")
try:
return cls(*_parse_isoformat_time(time_string))
except Exception:
- raise ValueError(f'Invalid isoformat string: {time_string!r}')
+ raise ValueError(f"Invalid isoformat string: {time_string!r}")
def strftime(self, fmt):
@@ -1575,7 +1575,7 @@ def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
# Pickle support
if isinstance(year, str):
try:
- year = bytes(year, 'latin1')
+ year = bytes(year, "latin1")
except UnicodeEncodeError:
# More informative error message.
raise ValueError(
@@ -1721,7 +1721,7 @@ def combine(cls, date, time, tzinfo=True):
def fromisoformat(cls, date_string):
"""Construct a datetime from the output of datetime.isoformat()."""
if not isinstance(date_string, str):
- raise TypeError('fromisoformat: argument must be str')
+ raise TypeError("fromisoformat: argument must be str")
# Split this at the separator
dstr = date_string[0:10]
@@ -1730,13 +1730,13 @@ def fromisoformat(cls, date_string):
try:
date_components = _parse_isoformat_date(dstr)
except ValueError:
- raise ValueError(f'Invalid isoformat string: {date_string!r}')
+ raise ValueError(f"Invalid isoformat string: {date_string!r}")
if tstr:
try:
time_components = _parse_isoformat_time(tstr)
except ValueError:
- raise ValueError(f'Invalid isoformat string: {date_string!r}')
+ raise ValueError(f"Invalid isoformat string: {date_string!r}")
else:
time_components = [0, 0, 0, 0, None]
@@ -1894,7 +1894,7 @@ def ctime(self):
self._hour, self._minute, self._second,
self._year)
- def isoformat(self, sep='T', timespec='auto'):
+ def isoformat(self, sep="T", timespec="auto"):
"""Return the time formatted according to ISO.
The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
@@ -1942,11 +1942,11 @@ def __repr__(self):
def __str__(self):
"Convert to string, for str()."
- return self.isoformat(sep=' ')
+ return self.isoformat(sep=" ")
@classmethod
def strptime(cls, date_string, format):
- 'string, format -> new datetime parsed from a string (like time.strptime()).'
+ "string, format -> new datetime parsed from a string (like time.strptime())."
import _strptime
return _strptime._strptime_datetime(cls, date_string, format)
@@ -2183,7 +2183,7 @@ def _isoweek1monday(year):
class timezone(tzinfo):
- __slots__ = '_offset', '_name'
+ __slots__ = "_offset", "_name"
# Sentinel value to disallow None
_Omitted = object()
@@ -2234,7 +2234,7 @@ def __repr__(self):
"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
"""
if self is self.utc:
- return 'datetime.timezone.utc'
+ return "datetime.timezone.utc"
if self._name is None:
return "%s.%s(%r)" % (self.__class__.__module__,
self.__class__.__qualname__,
@@ -2281,22 +2281,22 @@ def fromutc(self, dt):
@staticmethod
def _name_from_offset(delta):
if not delta:
- return 'UTC'
+ return "UTC"
if delta < timedelta(0):
- sign = '-'
+ sign = "-"
delta = -delta
else:
- sign = '+'
+ sign = "+"
hours, rest = divmod(delta, timedelta(hours=1))
minutes, rest = divmod(rest, timedelta(minutes=1))
seconds = rest.seconds
microseconds = rest.microseconds
if microseconds:
- return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'
- f'.{microseconds:06d}')
+ return (f"UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}"
+ f".{microseconds:06d}")
if seconds:
- return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'
- return f'UTC{sign}{hours:02d}:{minutes:02d}'
+ return f"UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}"
+ return f"UTC{sign}{hours:02d}:{minutes:02d}"
timezone.utc = timezone._create(timedelta(0))
# bpo-37642: These attributes are rounded to the nearest minute for backwards
@@ -2521,4 +2521,3 @@ def _name_from_offset(delta):
# docstring does not get overwritten. In the future, it may be
# appropriate to maintain a single module level docstring and
# remove the following line.
- from _datetime import __doc__
diff --git a/.venv3.10/Lib/dbm/__init__.py b/.venv3.10/Lib/dbm/__init__.py
index f65da521..54c6116a 100644
--- a/.venv3.10/Lib/dbm/__init__.py
+++ b/.venv3.10/Lib/dbm/__init__.py
@@ -27,7 +27,7 @@
implementations.
"""
-__all__ = ['open', 'whichdb', 'error']
+__all__ = ["open", "whichdb", "error"]
import io
import os
@@ -38,7 +38,7 @@
class error(Exception):
pass
-_names = ['dbm.gnu', 'dbm.ndbm', 'dbm.dumb']
+_names = ["dbm.gnu", "dbm.ndbm", "dbm.dumb"]
_defaultmod = None
_modules = {}
@@ -50,7 +50,7 @@ class error(Exception):
ndbm = None
-def open(file, flag='r', mode=0o666):
+def open(file, flag="r", mode=0o666):
"""Open or create database at path given by *file*.
Optional argument *flag* can be 'r' (default) for read-only access, 'w'
@@ -65,7 +65,7 @@ def open(file, flag='r', mode=0o666):
if _defaultmod is None:
for name in _names:
try:
- mod = __import__(name, fromlist=['open'])
+ mod = __import__(name, fromlist=["open"])
except ImportError:
continue
if not _defaultmod:
@@ -75,10 +75,10 @@ def open(file, flag='r', mode=0o666):
raise ImportError("no dbm clone found; tried %s" % _names)
# guess the type of an existing database, if not creating a new one
- result = whichdb(file) if 'n' not in flag else None
+ result = whichdb(file) if "n" not in flag else None
if result is None:
# db doesn't exist or 'n' flag was specified to create a new db
- if 'c' in flag or 'n' in flag:
+ if "c" in flag or "n" in flag:
# file doesn't exist and the new flag was used so use default type
mod = _defaultmod
else:
diff --git a/.venv3.10/Lib/dbm/dumb.py b/.venv3.10/Lib/dbm/dumb.py
index 864ad371..3f5a013a 100644
--- a/.venv3.10/Lib/dbm/dumb.py
+++ b/.venv3.10/Lib/dbm/dumb.py
@@ -45,23 +45,23 @@ class _Database(collections.abc.MutableMapping):
_os = _os # for _commit()
_io = _io # for _commit()
- def __init__(self, filebasename, mode, flag='c'):
+ def __init__(self, filebasename, mode, flag="c"):
self._mode = mode
- self._readonly = (flag == 'r')
+ self._readonly = (flag == "r")
# The directory file is a text file. Each line looks like
# "%r, (%d, %d)\n" % (key, pos, siz)
# where key is the string key, pos is the offset into the dat
# file of the associated value's first byte, and siz is the number
# of bytes in the associated value.
- self._dirfile = filebasename + '.dir'
+ self._dirfile = filebasename + ".dir"
# The data file is a binary file pointed into by the directory
# file, and holds the values associated with keys. Each value
# begins at a _BLOCKSIZE-aligned byte offset, and is a raw
# binary 8-bit string value.
- self._datfile = filebasename + '.dat'
- self._bakfile = filebasename + '.bak'
+ self._datfile = filebasename + ".dat"
+ self._bakfile = filebasename + ".bak"
# The index is an in-memory dict, mirroring the directory file.
self._index = None # maps keys to (pos, siz) pairs
@@ -71,7 +71,7 @@ def __init__(self, filebasename, mode, flag='c'):
self._update(flag)
def _create(self, flag):
- if flag == 'n':
+ if flag == "n":
for filename in (self._datfile, self._bakfile, self._dirfile):
try:
_os.remove(filename)
@@ -79,11 +79,11 @@ def _create(self, flag):
pass
# Mod by Jack: create data file if needed
try:
- f = _io.open(self._datfile, 'r', encoding="Latin-1")
+ f = _io.open(self._datfile, "r", encoding="Latin-1")
except OSError:
- if flag not in ('c', 'n'):
+ if flag not in ("c", "n"):
raise
- with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
+ with _io.open(self._datfile, "w", encoding="Latin-1") as f:
self._chmod(self._datfile)
else:
f.close()
@@ -93,9 +93,9 @@ def _update(self, flag):
self._modified = False
self._index = {}
try:
- f = _io.open(self._dirfile, 'r', encoding="Latin-1")
+ f = _io.open(self._dirfile, "r", encoding="Latin-1")
except OSError:
- if flag not in ('c', 'n'):
+ if flag not in ("c", "n"):
raise
self._modified = True
else:
@@ -103,7 +103,7 @@ def _update(self, flag):
for line in f:
line = line.rstrip()
key, pos_and_siz_pair = _ast.literal_eval(line)
- key = key.encode('Latin-1')
+ key = key.encode("Latin-1")
self._index[key] = pos_and_siz_pair
# Write the index dict to the directory file. The original directory
@@ -126,26 +126,26 @@ def _commit(self):
except OSError:
pass
- with self._io.open(self._dirfile, 'w', encoding="Latin-1") as f:
+ with self._io.open(self._dirfile, "w", encoding="Latin-1") as f:
self._chmod(self._dirfile)
for key, pos_and_siz_pair in self._index.items():
# Use Latin-1 since it has no qualms with any value in any
# position; UTF-8, though, does care sometimes.
- entry = "%r, %r\n" % (key.decode('Latin-1'), pos_and_siz_pair)
+ entry = "%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair)
f.write(entry)
sync = _commit
def _verify_open(self):
if self._index is None:
- raise error('DBM object has already been closed')
+ raise error("DBM object has already been closed")
def __getitem__(self, key):
if isinstance(key, str):
- key = key.encode('utf-8')
+ key = key.encode("utf-8")
self._verify_open()
pos, siz = self._index[key] # may raise KeyError
- with _io.open(self._datfile, 'rb') as f:
+ with _io.open(self._datfile, "rb") as f:
f.seek(pos)
dat = f.read(siz)
return dat
@@ -155,11 +155,11 @@ def __getitem__(self, key):
# to get to an aligned offset. Return pair
# (starting offset of val, len(val))
def _addval(self, val):
- with _io.open(self._datfile, 'rb+') as f:
+ with _io.open(self._datfile, "rb+") as f:
f.seek(0, 2)
pos = int(f.tell())
npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE
- f.write(b'\0'*(npos-pos))
+ f.write(b"\0"*(npos-pos))
pos = npos
f.write(val)
return (pos, len(val))
@@ -169,7 +169,7 @@ def _addval(self, val):
# pos to hold val, without overwriting some other value. Return
# pair (pos, len(val)).
def _setval(self, pos, val):
- with _io.open(self._datfile, 'rb+') as f:
+ with _io.open(self._datfile, "rb+") as f:
f.seek(pos)
f.write(val)
return (pos, len(val))
@@ -179,19 +179,19 @@ def _setval(self, pos, val):
# the in-memory index dict, and append one to the directory file.
def _addkey(self, key, pos_and_siz_pair):
self._index[key] = pos_and_siz_pair
- with _io.open(self._dirfile, 'a', encoding="Latin-1") as f:
+ with _io.open(self._dirfile, "a", encoding="Latin-1") as f:
self._chmod(self._dirfile)
f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair))
def __setitem__(self, key, val):
if self._readonly:
- raise error('The database is opened for reading only')
+ raise error("The database is opened for reading only")
if isinstance(key, str):
- key = key.encode('utf-8')
+ key = key.encode("utf-8")
elif not isinstance(key, (bytes, bytearray)):
raise TypeError("keys must be bytes or strings")
if isinstance(val, str):
- val = val.encode('utf-8')
+ val = val.encode("utf-8")
elif not isinstance(val, (bytes, bytearray)):
raise TypeError("values must be bytes or strings")
self._verify_open()
@@ -222,9 +222,9 @@ def __setitem__(self, key, val):
def __delitem__(self, key):
if self._readonly:
- raise error('The database is opened for reading only')
+ raise error("The database is opened for reading only")
if isinstance(key, str):
- key = key.encode('utf-8')
+ key = key.encode("utf-8")
self._verify_open()
self._modified = True
# The blocks used by the associated value are lost.
@@ -239,7 +239,7 @@ def keys(self):
try:
return list(self._index)
except TypeError:
- raise error('DBM object has already been closed') from None
+ raise error("DBM object has already been closed") from None
def items(self):
self._verify_open()
@@ -247,12 +247,12 @@ def items(self):
def __contains__(self, key):
if isinstance(key, str):
- key = key.encode('utf-8')
+ key = key.encode("utf-8")
try:
return key in self._index
except TypeError:
if self._index is None:
- raise error('DBM object has already been closed') from None
+ raise error("DBM object has already been closed") from None
else:
raise
@@ -260,14 +260,14 @@ def iterkeys(self):
try:
return iter(self._index)
except TypeError:
- raise error('DBM object has already been closed') from None
+ raise error("DBM object has already been closed") from None
__iter__ = iterkeys
def __len__(self):
try:
return len(self._index)
except TypeError:
- raise error('DBM object has already been closed') from None
+ raise error("DBM object has already been closed") from None
def close(self):
try:
@@ -287,7 +287,7 @@ def __exit__(self, *args):
self.close()
-def open(file, flag='c', mode=0o666):
+def open(file, flag="c", mode=0o666):
"""Open the database file, filename, and return corresponding object.
The flag argument, used to control how the database is opened in the
@@ -311,6 +311,6 @@ def open(file, flag='c', mode=0o666):
else:
# Turn off any bits that are set in the umask
mode = mode & (~um)
- if flag not in ('r', 'w', 'c', 'n'):
+ if flag not in ("r", "w", "c", "n"):
raise ValueError("Flag must be one of 'r', 'w', 'c', or 'n'")
return _Database(file, mode, flag=flag)
diff --git a/.venv3.10/Lib/decimal.py b/.venv3.10/Lib/decimal.py
index 7746ea26..106aa275 100644
--- a/.venv3.10/Lib/decimal.py
+++ b/.venv3.10/Lib/decimal.py
@@ -6,6 +6,3 @@
from _decimal import __libmpdec_version__
except ImportError:
from _pydecimal import *
- from _pydecimal import __doc__
- from _pydecimal import __version__
- from _pydecimal import __libmpdec_version__
diff --git a/.venv3.10/Lib/difflib.py b/.venv3.10/Lib/difflib.py
index ba0b2569..91ab1464 100644
--- a/.venv3.10/Lib/difflib.py
+++ b/.venv3.10/Lib/difflib.py
@@ -26,15 +26,15 @@
For producing HTML side by side comparison with change highlights.
"""
-__all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher',
- 'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
- 'unified_diff', 'diff_bytes', 'HtmlDiff', 'Match']
+__all__ = ["get_close_matches", "ndiff", "restore", "SequenceMatcher",
+ "Differ","IS_CHARACTER_JUNK", "IS_LINE_JUNK", "context_diff",
+ "unified_diff", "diff_bytes", "HtmlDiff", "Match"]
from heapq import nlargest as _nlargest
from collections import namedtuple as _namedtuple
from types import GenericAlias
-Match = _namedtuple('Match', 'a b size')
+Match = _namedtuple("Match", "a b size")
def _calculate_ratio(matches, length):
if length:
@@ -117,7 +117,7 @@ class SequenceMatcher:
elements the sequences have in common; best case time is linear.
"""
- def __init__(self, isjunk=None, a='', b='', autojunk=True):
+ def __init__(self, isjunk=None, a="", b="", autojunk=True):
"""Construct a SequenceMatcher.
Optional arg isjunk is None (the default), or a one-argument
@@ -528,20 +528,20 @@ def get_opcodes(self):
# a[ai:ai+size] == b[bj:bj+size]. So we need to pump
# out a diff to change a[i:ai] into b[j:bj], pump out
# the matching block, and move (i,j) beyond the match
- tag = ''
+ tag = ""
if i < ai and j < bj:
- tag = 'replace'
+ tag = "replace"
elif i < ai:
- tag = 'delete'
+ tag = "delete"
elif j < bj:
- tag = 'insert'
+ tag = "insert"
if tag:
answer.append( (tag, i, ai, j, bj) )
i, j = ai+size, bj+size
# the list of matching blocks is terminated by a
# sentinel with size 0
if size:
- answer.append( ('equal', ai, i, bj, j) )
+ answer.append( ("equal", ai, i, bj, j) )
return answer
def get_grouped_opcodes(self, n=3):
@@ -573,10 +573,10 @@ def get_grouped_opcodes(self, n=3):
if not codes:
codes = [("equal", 0, 1, 0, 1)]
# Fixup leading and trailing groups if they show no changes.
- if codes[0][0] == 'equal':
+ if codes[0][0] == "equal":
tag, i1, i2, j1, j2 = codes[0]
codes[0] = tag, max(i1, i2-n), i2, max(j1, j2-n), j2
- if codes[-1][0] == 'equal':
+ if codes[-1][0] == "equal":
tag, i1, i2, j1, j2 = codes[-1]
codes[-1] = tag, i1, min(i2, i1+n), j1, min(j2, j1+n)
@@ -585,13 +585,13 @@ def get_grouped_opcodes(self, n=3):
for tag, i1, i2, j1, j2 in codes:
# End the current group and start a new one whenever
# there is a large range with no changes.
- if tag == 'equal' and i2-i1 > nn:
+ if tag == "equal" and i2-i1 > nn:
group.append((tag, i1, min(i2, i1+n), j1, min(j2, j1+n)))
yield group
group = []
i1, j1 = max(i1, i2-n), max(j1, j2-n)
group.append((tag, i1, i2, j1 ,j2))
- if group and not (len(group)==1 and group[0][0] == 'equal'):
+ if group and not (len(group)==1 and group[0][0] == "equal"):
yield group
def ratio(self):
@@ -714,7 +714,7 @@ def get_close_matches(word, possibilities, n=3, cutoff=0.6):
def _keep_original_ws(s, tag_s):
"""Replace whitespace with the original whitespace characters in `s`"""
- return ''.join(
+ return "".join(
c if tag_c == " " and c.isspace() else tag_c
for c, tag_c in zip(s, tag_s)
)
@@ -858,34 +858,34 @@ def compare(self, a, b):
cruncher = SequenceMatcher(self.linejunk, a, b)
for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
- if tag == 'replace':
+ if tag == "replace":
g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
- elif tag == 'delete':
- g = self._dump('-', a, alo, ahi)
- elif tag == 'insert':
- g = self._dump('+', b, blo, bhi)
- elif tag == 'equal':
- g = self._dump(' ', a, alo, ahi)
+ elif tag == "delete":
+ g = self._dump("-", a, alo, ahi)
+ elif tag == "insert":
+ g = self._dump("+", b, blo, bhi)
+ elif tag == "equal":
+ g = self._dump(" ", a, alo, ahi)
else:
- raise ValueError('unknown tag %r' % (tag,))
+ raise ValueError("unknown tag %r" % (tag,))
yield from g
def _dump(self, tag, x, lo, hi):
"""Generate comparison results for a same-tagged range."""
for i in range(lo, hi):
- yield '%s %s' % (tag, x[i])
+ yield "%s %s" % (tag, x[i])
def _plain_replace(self, a, alo, ahi, b, blo, bhi):
assert alo < ahi and blo < bhi
# dump the shorter block first -- reduces the burden on short-term
# memory if the blocks are of very different sizes
if bhi - blo < ahi - alo:
- first = self._dump('+', b, blo, bhi)
- second = self._dump('-', a, alo, ahi)
+ first = self._dump("+", b, blo, bhi)
+ second = self._dump("-", a, alo, ahi)
else:
- first = self._dump('-', a, alo, ahi)
- second = self._dump('+', b, blo, bhi)
+ first = self._dump("-", a, alo, ahi)
+ second = self._dump("+", b, blo, bhi)
for g in first, second:
yield from g
@@ -964,22 +964,22 @@ def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
cruncher.set_seqs(aelt, belt)
for tag, ai1, ai2, bj1, bj2 in cruncher.get_opcodes():
la, lb = ai2 - ai1, bj2 - bj1
- if tag == 'replace':
- atags += '^' * la
- btags += '^' * lb
- elif tag == 'delete':
- atags += '-' * la
- elif tag == 'insert':
- btags += '+' * lb
- elif tag == 'equal':
- atags += ' ' * la
- btags += ' ' * lb
+ if tag == "replace":
+ atags += "^" * la
+ btags += "^" * lb
+ elif tag == "delete":
+ atags += "-" * la
+ elif tag == "insert":
+ btags += "+" * lb
+ elif tag == "equal":
+ atags += " " * la
+ btags += " " * lb
else:
- raise ValueError('unknown tag %r' % (tag,))
+ raise ValueError("unknown tag %r" % (tag,))
yield from self._qformat(aelt, belt, atags, btags)
else:
# the synch pair is identical
- yield ' ' + aelt
+ yield " " + aelt
# pump out diffs from after the synch point
yield from self._fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi)
@@ -990,9 +990,9 @@ def _fancy_helper(self, a, alo, ahi, b, blo, bhi):
if blo < bhi:
g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
else:
- g = self._dump('-', a, alo, ahi)
+ g = self._dump("-", a, alo, ahi)
elif blo < bhi:
- g = self._dump('+', b, blo, bhi)
+ g = self._dump("+", b, blo, bhi)
yield from g
@@ -1087,13 +1087,13 @@ def _format_range_unified(start, stop):
beginning = start + 1 # lines start numbering with one
length = stop - start
if length == 1:
- return '{}'.format(beginning)
+ return "{}".format(beginning)
if not length:
beginning -= 1 # empty ranges begin at line just before the range
- return '{},{}'.format(beginning, length)
+ return "{},{}".format(beginning, length)
-def unified_diff(a, b, fromfile='', tofile='', fromfiledate='',
- tofiledate='', n=3, lineterm='\n'):
+def unified_diff(a, b, fromfile="", tofile="", fromfiledate="",
+ tofiledate="", n=3, lineterm="\n"):
r"""
Compare two sequences of lines; generate the delta as a unified diff.
@@ -1138,27 +1138,27 @@ def unified_diff(a, b, fromfile='', tofile='', fromfiledate='',
for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
if not started:
started = True
- fromdate = '\t{}'.format(fromfiledate) if fromfiledate else ''
- todate = '\t{}'.format(tofiledate) if tofiledate else ''
- yield '--- {}{}{}'.format(fromfile, fromdate, lineterm)
- yield '+++ {}{}{}'.format(tofile, todate, lineterm)
+ fromdate = "\t{}".format(fromfiledate) if fromfiledate else ""
+ todate = "\t{}".format(tofiledate) if tofiledate else ""
+ yield "--- {}{}{}".format(fromfile, fromdate, lineterm)
+ yield "+++ {}{}{}".format(tofile, todate, lineterm)
first, last = group[0], group[-1]
file1_range = _format_range_unified(first[1], last[2])
file2_range = _format_range_unified(first[3], last[4])
- yield '@@ -{} +{} @@{}'.format(file1_range, file2_range, lineterm)
+ yield "@@ -{} +{} @@{}".format(file1_range, file2_range, lineterm)
for tag, i1, i2, j1, j2 in group:
- if tag == 'equal':
+ if tag == "equal":
for line in a[i1:i2]:
- yield ' ' + line
+ yield " " + line
continue
- if tag in {'replace', 'delete'}:
+ if tag in {"replace", "delete"}:
for line in a[i1:i2]:
- yield '-' + line
- if tag in {'replace', 'insert'}:
+ yield "-" + line
+ if tag in {"replace", "insert"}:
for line in b[j1:j2]:
- yield '+' + line
+ yield "+" + line
########################################################################
@@ -1173,12 +1173,12 @@ def _format_range_context(start, stop):
if not length:
beginning -= 1 # empty ranges begin at line just before the range
if length <= 1:
- return '{}'.format(beginning)
- return '{},{}'.format(beginning, beginning + length - 1)
+ return "{}".format(beginning)
+ return "{},{}".format(beginning, beginning + length - 1)
# See http://www.unix.org/single_unix_specification/
-def context_diff(a, b, fromfile='', tofile='',
- fromfiledate='', tofiledate='', n=3, lineterm='\n'):
+def context_diff(a, b, fromfile="", tofile="",
+ fromfiledate="", tofiledate="", n=3, lineterm="\n"):
r"""
Compare two sequences of lines; generate the delta as a context diff.
@@ -1222,34 +1222,34 @@ def context_diff(a, b, fromfile='', tofile='',
"""
_check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
- prefix = dict(insert='+ ', delete='- ', replace='! ', equal=' ')
+ prefix = dict(insert="+ ", delete="- ", replace="! ", equal=" ")
started = False
for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
if not started:
started = True
- fromdate = '\t{}'.format(fromfiledate) if fromfiledate else ''
- todate = '\t{}'.format(tofiledate) if tofiledate else ''
- yield '*** {}{}{}'.format(fromfile, fromdate, lineterm)
- yield '--- {}{}{}'.format(tofile, todate, lineterm)
+ fromdate = "\t{}".format(fromfiledate) if fromfiledate else ""
+ todate = "\t{}".format(tofiledate) if tofiledate else ""
+ yield "*** {}{}{}".format(fromfile, fromdate, lineterm)
+ yield "--- {}{}{}".format(tofile, todate, lineterm)
first, last = group[0], group[-1]
- yield '***************' + lineterm
+ yield "***************" + lineterm
file1_range = _format_range_context(first[1], last[2])
- yield '*** {} ****{}'.format(file1_range, lineterm)
+ yield "*** {} ****{}".format(file1_range, lineterm)
- if any(tag in {'replace', 'delete'} for tag, _, _, _, _ in group):
+ if any(tag in {"replace", "delete"} for tag, _, _, _, _ in group):
for tag, i1, i2, _, _ in group:
- if tag != 'insert':
+ if tag != "insert":
for line in a[i1:i2]:
yield prefix[tag] + line
file2_range = _format_range_context(first[3], last[4])
- yield '--- {} ----{}'.format(file2_range, lineterm)
+ yield "--- {} ----{}".format(file2_range, lineterm)
- if any(tag in {'replace', 'insert'} for tag, _, _, _, _ in group):
+ if any(tag in {"replace", "insert"} for tag, _, _, _, _ in group):
for tag, _, _, j1, j2 in group:
- if tag != 'delete':
+ if tag != "delete":
for line in b[j1:j2]:
yield prefix[tag] + line
@@ -1261,17 +1261,17 @@ def _check_types(a, b, *args):
# +++ b'newfile.txt'
# because of how str.format() incorporates bytes objects.
if a and not isinstance(a[0], str):
- raise TypeError('lines to compare must be str, not %s (%r)' %
+ raise TypeError("lines to compare must be str, not %s (%r)" %
(type(a[0]).__name__, a[0]))
if b and not isinstance(b[0], str):
- raise TypeError('lines to compare must be str, not %s (%r)' %
+ raise TypeError("lines to compare must be str, not %s (%r)" %
(type(b[0]).__name__, b[0]))
for arg in args:
if not isinstance(arg, str):
- raise TypeError('all arguments must be str, not: %r' % (arg,))
+ raise TypeError("all arguments must be str, not: %r" % (arg,))
-def diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'',
- fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n'):
+def diff_bytes(dfunc, a, b, fromfile=b"", tofile=b"",
+ fromfiledate=b"", tofiledate=b"", n=3, lineterm=b"\n"):
r"""
Compare `a` and `b`, two sequences of lines represented as bytes rather
than str. This is a wrapper for `dfunc`, which is typically either
@@ -1283,9 +1283,9 @@ def diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'',
"""
def decode(s):
try:
- return s.decode('ascii', 'surrogateescape')
+ return s.decode("ascii", "surrogateescape")
except AttributeError as err:
- msg = ('all arguments must be bytes, not %s (%r)' %
+ msg = ("all arguments must be bytes, not %s (%r)" %
(type(s).__name__, s))
raise TypeError(msg) from err
a = list(map(decode, a))
@@ -1298,7 +1298,7 @@ def decode(s):
lines = dfunc(a, b, fromfile, tofile, fromfiledate, tofiledate, n, lineterm)
for line in lines:
- yield line.encode('ascii', 'surrogateescape')
+ yield line.encode("ascii", "surrogateescape")
def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
r"""
@@ -1374,7 +1374,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None,
import re
# regular expression for finding intraline change indices
- change_re = re.compile(r'(\++|\-+|\^+)')
+ change_re = re.compile(r"(\++|\-+|\^+)")
# create the difference iterator to generate the differences
diff_lines_iterator = ndiff(fromlines,tolines,linejunk,charjunk)
@@ -1408,7 +1408,7 @@ def _make_line(lines, format_key, side, num_lines=[0,0]):
if format_key is None:
return (num_lines[side],lines.pop(0)[2:])
# Handle case of intraline changes
- if format_key == '?':
+ if format_key == "?":
text, markers = lines.pop(0), lines.pop(0)
# find intraline changes (store change type and indices in tuples)
sub_info = []
@@ -1419,7 +1419,7 @@ def record_sub_info(match_object,sub_info=sub_info):
# process each tuple inserting our special marks that won't be
# noticed by an xml/html escaper.
for key,(begin,end) in reversed(sub_info):
- text = text[0:begin]+'\0'+key+text[begin:end]+'\1'+text[end:]
+ text = text[0:begin]+"\0"+key+text[begin:end]+"\1"+text[end:]
text = text[2:]
# Handle case of add/delete entire line
else:
@@ -1427,9 +1427,9 @@ def record_sub_info(match_object,sub_info=sub_info):
# if line of text is just a newline, insert a space so there is
# something for the user to highlight and see.
if not text:
- text = ' '
+ text = " "
# insert marks that won't be noticed by an xml/html escaper.
- text = '\0' + format_key + text + '\1'
+ text = "\0" + format_key + text + "\1"
# Return line of text, first allow user's line formatter to do its
# thing (such as adding the line number) then replace the special
# marks with what the user's change markup.
@@ -1456,57 +1456,57 @@ def _line_iterator():
# are a concatenation of the first character of each of the 4 lines
# so we can do some very readable comparisons.
while len(lines) < 4:
- lines.append(next(diff_lines_iterator, 'X'))
- s = ''.join([line[0] for line in lines])
- if s.startswith('X'):
+ lines.append(next(diff_lines_iterator, "X"))
+ s = "".join([line[0] for line in lines])
+ if s.startswith("X"):
# When no more lines, pump out any remaining blank lines so the
# corresponding add/delete lines get a matching blank line so
# all line pairs get yielded at the next level.
num_blanks_to_yield = num_blanks_pending
- elif s.startswith('-?+?'):
+ elif s.startswith("-?+?"):
# simple intraline change
- yield _make_line(lines,'?',0), _make_line(lines,'?',1), True
+ yield _make_line(lines,"?",0), _make_line(lines,"?",1), True
continue
- elif s.startswith('--++'):
+ elif s.startswith("--++"):
# in delete block, add block coming: we do NOT want to get
# caught up on blank lines yet, just process the delete line
num_blanks_pending -= 1
- yield _make_line(lines,'-',0), None, True
+ yield _make_line(lines,"-",0), None, True
continue
- elif s.startswith(('--?+', '--+', '- ')):
+ elif s.startswith(("--?+", "--+", "- ")):
# in delete block and see an intraline change or unchanged line
# coming: yield the delete line and then blanks
- from_line,to_line = _make_line(lines,'-',0), None
+ from_line,to_line = _make_line(lines,"-",0), None
num_blanks_to_yield,num_blanks_pending = num_blanks_pending-1,0
- elif s.startswith('-+?'):
+ elif s.startswith("-+?"):
# intraline change
- yield _make_line(lines,None,0), _make_line(lines,'?',1), True
+ yield _make_line(lines,None,0), _make_line(lines,"?",1), True
continue
- elif s.startswith('-?+'):
+ elif s.startswith("-?+"):
# intraline change
- yield _make_line(lines,'?',0), _make_line(lines,None,1), True
+ yield _make_line(lines,"?",0), _make_line(lines,None,1), True
continue
- elif s.startswith('-'):
+ elif s.startswith("-"):
# delete FROM line
num_blanks_pending -= 1
- yield _make_line(lines,'-',0), None, True
+ yield _make_line(lines,"-",0), None, True
continue
- elif s.startswith('+--'):
+ elif s.startswith("+--"):
# in add block, delete block coming: we do NOT want to get
# caught up on blank lines yet, just process the add line
num_blanks_pending += 1
- yield None, _make_line(lines,'+',1), True
+ yield None, _make_line(lines,"+",1), True
continue
- elif s.startswith(('+ ', '+-')):
+ elif s.startswith(("+ ", "+-")):
# will be leaving an add block: yield blanks then add line
- from_line, to_line = None, _make_line(lines,'+',1)
+ from_line, to_line = None, _make_line(lines,"+",1)
num_blanks_to_yield,num_blanks_pending = num_blanks_pending+1,0
- elif s.startswith('+'):
+ elif s.startswith("+"):
# inside an add block, yield the add line
num_blanks_pending += 1
- yield None, _make_line(lines,'+',1), True
+ yield None, _make_line(lines,"+",1), True
continue
- elif s.startswith(' '):
+ elif s.startswith(" "):
# unchanged text, yield it to both sides
yield _make_line(lines[:],None,0),_make_line(lines,None,1),False
continue
@@ -1514,11 +1514,11 @@ def _line_iterator():
# pair, they are lined up.
while(num_blanks_to_yield < 0):
num_blanks_to_yield += 1
- yield None,('','\n'),True
+ yield None,("","\n"),True
while(num_blanks_to_yield > 0):
num_blanks_to_yield -= 1
- yield ('','\n'),None,True
- if s.startswith('X'):
+ yield ("","\n"),None,True
+ if s.startswith("X"):
return
else:
yield from_line,to_line,True
@@ -1702,8 +1702,8 @@ def __init__(self,tabsize=8,wrapcolumn=None,linejunk=None,
self._linejunk = linejunk
self._charjunk = charjunk
- def make_file(self, fromlines, tolines, fromdesc='', todesc='',
- context=False, numlines=5, *, charset='utf-8'):
+ def make_file(self, fromlines, tolines, fromdesc="", todesc="",
+ context=False, numlines=5, *, charset="utf-8"):
"""Returns HTML file of side by side comparison with change highlights
Arguments:
@@ -1727,7 +1727,7 @@ def make_file(self, fromlines, tolines, fromdesc='', todesc='',
table=self.make_table(fromlines, tolines, fromdesc, todesc,
context=context, numlines=numlines),
charset=charset
- )).encode(charset, 'xmlcharrefreplace').decode(charset)
+ )).encode(charset, "xmlcharrefreplace").decode(charset)
def _tab_newline_replace(self,fromlines,tolines):
"""Returns from/to line lists with tabs expanded and newlines removed.
@@ -1741,13 +1741,13 @@ def _tab_newline_replace(self,fromlines,tolines):
"""
def expand_tabs(line):
# hide real spaces
- line = line.replace(' ','\0')
+ line = line.replace(" ","\0")
# expand tabs into spaces
line = line.expandtabs(self._tabsize)
# replace spaces from expanded tabs back into tab characters
# (we'll replace them with markup after we do differencing)
- line = line.replace(' ','\t')
- return line.replace('\0',' ').rstrip('\n')
+ line = line.replace(" ","\t")
+ return line.replace("\0"," ").rstrip("\n")
fromlines = [expand_tabs(line) for line in fromlines]
tolines = [expand_tabs(line) for line in tolines]
return fromlines,tolines
@@ -1769,7 +1769,7 @@ def _split_line(self,data_list,line_num,text):
# if line text doesn't need wrapping, just add it to the output list
size = len(text)
max = self._wrapcolumn
- if (size <= max) or ((size -(text.count('\0')*3)) <= max):
+ if (size <= max) or ((size -(text.count("\0")*3)) <= max):
data_list.append((line_num,text))
return
@@ -1777,15 +1777,15 @@ def _split_line(self,data_list,line_num,text):
# point is inside markers
i = 0
n = 0
- mark = ''
+ mark = ""
while n < max and i < size:
- if text[i] == '\0':
+ if text[i] == "\0":
i += 1
mark = text[i]
i += 1
- elif text[i] == '\1':
+ elif text[i] == "\1":
i += 1
- mark = ''
+ mark = ""
else:
i += 1
n += 1
@@ -1798,14 +1798,14 @@ def _split_line(self,data_list,line_num,text):
# line and start marker at beginning of second line because each
# line will have its own table tag markup around it.
if mark:
- line1 = line1 + '\1'
- line2 = '\0' + mark + line2
+ line1 = line1 + "\1"
+ line2 = "\0" + mark + line2
# tack on first line onto the output list
data_list.append((line_num,line1))
# use this routine again to wrap the remaining text
- self._split_line(data_list,'>',line2)
+ self._split_line(data_list,">",line2)
def _line_wrapper(self,diffs):
"""Returns iterator that splits (wraps) mdiff text lines"""
@@ -1828,11 +1828,11 @@ def _line_wrapper(self,diffs):
if fromlist:
fromdata = fromlist.pop(0)
else:
- fromdata = ('',' ')
+ fromdata = (""," ")
if tolist:
todata = tolist.pop(0)
else:
- todata = ('',' ')
+ todata = (""," ")
yield fromdata,todata,flag
def _collect_lines(self,diffs):
@@ -1865,16 +1865,16 @@ def _format_line(self,side,flag,linenum,text):
text -- line text to be marked up
"""
try:
- linenum = '%d' % linenum
+ linenum = "%d" % linenum
id = ' id="%s%s"' % (self._prefix[side],linenum)
except TypeError:
# handle blank lines where linenum is '>' or ''
- id = ''
+ id = ""
# replace those things that would get confused with HTML symbols
text=text.replace("&","&").replace(">",">").replace("<","<")
# make space non-breakable so they don't get compressed or line wrapped
- text = text.replace(' ',' ').rstrip()
+ text = text.replace(" "," ").rstrip()
return '
%s
%s
' \
% (id,linenum,text)
@@ -1897,8 +1897,8 @@ def _convert_flags(self,fromlist,tolist,flaglist,context,numlines):
toprefix = self._prefix[1]
# process change flags, generating middle column of next anchors/links
- next_id = ['']*len(flaglist)
- next_href = ['']*len(flaglist)
+ next_id = [""]*len(flaglist)
+ next_href = [""]*len(flaglist)
num_chg, in_change = 0, False
last = 0
for i,flag in enumerate(flaglist):
@@ -1921,14 +1921,14 @@ def _convert_flags(self,fromlist,tolist,flaglist,context,numlines):
# check for cases where there is no content to avoid exceptions
if not flaglist:
flaglist = [False]
- next_id = ['']
- next_href = ['']
+ next_id = [""]
+ next_href = [""]
last = 0
if context:
- fromlist = ['
"]
# if not a change on first line, drop a link
if not flaglist[0]:
next_href[0] = 'f' % toprefix
@@ -1937,7 +1937,7 @@ def _convert_flags(self,fromlist,tolist,flaglist,context,numlines):
return fromlist,tolist,flaglist,next_href,next_id
- def make_table(self,fromlines,tolines,fromdesc='',todesc='',context=False,
+ def make_table(self,fromlines,tolines,fromdesc="",todesc="",context=False,
numlines=5):
"""Returns HTML table of side by side comparison with change highlights
@@ -1990,29 +1990,29 @@ def make_table(self,fromlines,tolines,fromdesc='',todesc='',context=False,
# mdiff yields None on separator lines skip the bogus ones
# generated for the first line
if i > 0:
- s.append(' \n \n')
+ s.append(" \n \n")
else:
s.append( fmt % (next_id[i],next_href[i],fromlist[i],
next_href[i],tolist[i]))
if fromdesc or todesc:
- header_row = '
%s%s%s%s
' % (
+ header_row = "
%s%s%s%s
" % (
'
',
'
%s
' % fromdesc,
'
',
'
%s
' % todesc)
else:
- header_row = ''
+ header_row = ""
table = self._table_template % dict(
- data_rows=''.join(s),
+ data_rows="".join(s),
header_row=header_row,
prefix=self._prefix[1])
- return table.replace('\0+',''). \
- replace('\0-',''). \
- replace('\0^',''). \
- replace('\1',''). \
- replace('\t',' ')
+ return table.replace("\0+",''). \
+ replace("\0-",''). \
+ replace("\0^",''). \
+ replace("\1",""). \
+ replace("\t"," ")
del re
@@ -2041,7 +2041,7 @@ def restore(delta, which):
try:
tag = {1: "- ", 2: "+ "}[int(which)]
except KeyError:
- raise ValueError('unknown delta choice (must be 1 or 2): %r'
+ raise ValueError("unknown delta choice (must be 1 or 2): %r"
% which) from None
prefixes = (" ", tag)
for line in delta:
@@ -2049,7 +2049,8 @@ def restore(delta, which):
yield line[2:]
def _test():
- import doctest, difflib
+ import doctest
+ import difflib
return doctest.testmod(difflib)
if __name__ == "__main__":
diff --git a/.venv3.10/Lib/dis.py b/.venv3.10/Lib/dis.py
index fe5d24e8..0cffcea4 100644
--- a/.venv3.10/Lib/dis.py
+++ b/.venv3.10/Lib/dis.py
@@ -16,15 +16,15 @@
_have_code = (types.MethodType, types.FunctionType, types.CodeType,
classmethod, staticmethod, type)
-FORMAT_VALUE = opmap['FORMAT_VALUE']
+FORMAT_VALUE = opmap["FORMAT_VALUE"]
FORMAT_VALUE_CONVERTERS = (
- (None, ''),
- (str, 'str'),
- (repr, 'repr'),
- (ascii, 'ascii'),
+ (None, ""),
+ (str, "str"),
+ (repr, "repr"),
+ (ascii, "ascii"),
)
-MAKE_FUNCTION = opmap['MAKE_FUNCTION']
-MAKE_FUNCTION_FLAGS = ('defaults', 'kwdefaults', 'annotations', 'closure')
+MAKE_FUNCTION = opmap["MAKE_FUNCTION"]
+MAKE_FUNCTION_FLAGS = ("defaults", "kwdefaults", "annotations", "closure")
def _try_compile(source, name):
@@ -35,9 +35,9 @@ def _try_compile(source, name):
expect code objects
"""
try:
- c = compile(source, name, 'eval')
+ c = compile(source, name, "eval")
except SyntaxError:
- c = compile(source, name, 'exec')
+ c = compile(source, name, "exec")
return c
def dis(x=None, *, file=None, depth=None):
@@ -53,19 +53,19 @@ def dis(x=None, *, file=None, depth=None):
distb(file=file)
return
# Extract functions from methods.
- if hasattr(x, '__func__'):
+ if hasattr(x, "__func__"):
x = x.__func__
# Extract compiled code objects from...
- if hasattr(x, '__code__'): # ...a function, or
+ if hasattr(x, "__code__"): # ...a function, or
x = x.__code__
- elif hasattr(x, 'gi_code'): #...a generator object, or
+ elif hasattr(x, "gi_code"): #...a generator object, or
x = x.gi_code
- elif hasattr(x, 'ag_code'): #...an asynchronous generator object, or
+ elif hasattr(x, "ag_code"): #...an asynchronous generator object, or
x = x.ag_code
- elif hasattr(x, 'cr_code'): #...a coroutine.
+ elif hasattr(x, "cr_code"): #...a coroutine.
x = x.cr_code
# Perform the disassembly.
- if hasattr(x, '__dict__'): # Class or module
+ if hasattr(x, "__dict__"): # Class or module
items = sorted(x.__dict__.items())
for name, x1 in items:
if isinstance(x1, _have_code):
@@ -75,7 +75,7 @@ def dis(x=None, *, file=None, depth=None):
except TypeError as msg:
print("Sorry:", msg, file=file)
print(file=file)
- elif hasattr(x, 'co_code'): # Code object
+ elif hasattr(x, "co_code"): # Code object
_disassemble_recursive(x, file=file, depth=depth)
elif isinstance(x, (bytes, bytearray)): # Raw bytecode
_disassemble_bytes(x, file=file)
@@ -128,22 +128,22 @@ def pretty_flags(flags):
def _get_code_object(x):
"""Helper to handle methods, compiled or raw code objects, and strings."""
# Extract functions from methods.
- if hasattr(x, '__func__'):
+ if hasattr(x, "__func__"):
x = x.__func__
# Extract compiled code objects from...
- if hasattr(x, '__code__'): # ...a function, or
+ if hasattr(x, "__code__"): # ...a function, or
x = x.__code__
- elif hasattr(x, 'gi_code'): #...a generator object, or
+ elif hasattr(x, "gi_code"): #...a generator object, or
x = x.gi_code
- elif hasattr(x, 'ag_code'): #...an asynchronous generator object, or
+ elif hasattr(x, "ag_code"): #...an asynchronous generator object, or
x = x.ag_code
- elif hasattr(x, 'cr_code'): #...a coroutine.
+ elif hasattr(x, "cr_code"): #...a coroutine.
x = x.cr_code
# Handle source code.
if isinstance(x, str):
x = _try_compile(x, "")
# By now, if we don't have a code object, we can't disassemble x.
- if hasattr(x, 'co_code'):
+ if hasattr(x, "co_code"):
return x
raise TypeError("don't know how to disassemble %s objects" %
type(x).__name__)
@@ -234,17 +234,17 @@ def _disassemble(self, lineno_width=3, mark_as_current=False, offset_width=4):
lineno_fmt = "%%%dd" % lineno_width
fields.append(lineno_fmt % self.starts_line)
else:
- fields.append(' ' * lineno_width)
+ fields.append(" " * lineno_width)
# Column: Current instruction indicator
if mark_as_current:
- fields.append('-->')
+ fields.append("-->")
else:
- fields.append(' ')
+ fields.append(" ")
# Column: Jump target marker
if self.is_jump_target:
- fields.append('>>')
+ fields.append(">>")
else:
- fields.append(' ')
+ fields.append(" ")
# Column: Instruction offset from start of code sequence
fields.append(repr(self.offset).rjust(offset_width))
# Column: Opcode name
@@ -254,8 +254,8 @@ def _disassemble(self, lineno_width=3, mark_as_current=False, offset_width=4):
fields.append(repr(self.arg).rjust(_OPARG_WIDTH))
# Column: Opcode argument details
if self.argrepr:
- fields.append('(' + self.argrepr + ')')
- return ' '.join(fields).rstrip()
+ fields.append("(" + self.argrepr + ")")
+ return " ".join(fields).rstrip()
def get_instructions(x, *, first_line=None):
@@ -327,7 +327,7 @@ def _get_instructions_bytes(code, varnames=None, names=None, constants=None,
starts_line += line_offset
is_jump_target = offset in labels
argval = None
- argrepr = ''
+ argrepr = ""
if arg is not None:
# Set argval to the dereferenced value of the argument when
# available, and argrepr to the string representation of argval.
@@ -356,10 +356,10 @@ def _get_instructions_bytes(code, varnames=None, names=None, constants=None,
argval = (argval, bool(arg & 0x4))
if argval[1]:
if argrepr:
- argrepr += ', '
- argrepr += 'with format'
+ argrepr += ", "
+ argrepr += "with format"
elif op == MAKE_FUNCTION:
- argrepr = ', '.join(s for i, s in enumerate(MAKE_FUNCTION_FLAGS)
+ argrepr = ", ".join(s for i, s in enumerate(MAKE_FUNCTION_FLAGS)
if arg & (1<'), **kwargs)
+ _disassemble_recursive(_try_compile(source, ""), **kwargs)
disco = disassemble # XXX For backwards compatibility
@@ -529,7 +529,7 @@ def _test():
import argparse
parser = argparse.ArgumentParser()
- parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
+ parser.add_argument("infile", type=argparse.FileType("rb"), nargs="?", default="-")
args = parser.parse_args()
with args.infile as infile:
source = infile.read()
diff --git a/.venv3.10/Lib/distutils/__init__.py b/.venv3.10/Lib/distutils/__init__.py
index fdad6f65..3195632e 100644
--- a/.venv3.10/Lib/distutils/__init__.py
+++ b/.venv3.10/Lib/distutils/__init__.py
@@ -11,7 +11,7 @@
import sys
import warnings
-__version__ = sys.version[:sys.version.index(' ')]
+__version__ = sys.version[:sys.version.index(" ")]
_DEPRECATION_MESSAGE = ("The distutils package is deprecated and slated for "
"removal in Python 3.12. Use setuptools or check "
diff --git a/.venv3.10/Lib/distutils/_msvccompiler.py b/.venv3.10/Lib/distutils/_msvccompiler.py
index 0b245adb..67379585 100644
--- a/.venv3.10/Lib/distutils/_msvccompiler.py
+++ b/.venv3.10/Lib/distutils/_msvccompiler.py
@@ -86,10 +86,10 @@ def _find_vc2017():
return None, None
PLAT_SPEC_TO_RUNTIME = {
- 'x86' : 'x86',
- 'x86_amd64' : 'x64',
- 'x86_arm' : 'arm',
- 'x86_arm64' : 'arm64'
+ "x86" : "x86",
+ "x86_amd64" : "x64",
+ "x86_arm" : "arm",
+ "x86_arm64" : "arm64"
}
def _find_vcvarsall(plat_spec):
@@ -125,7 +125,7 @@ def _get_vc_env(plat_spec):
out = subprocess.check_output(
'cmd /u /c "{}" {} && set'.format(vcvarsall, plat_spec),
stderr=subprocess.STDOUT,
- ).decode('utf-16le', errors='replace')
+ ).decode("utf-16le", errors="replace")
except subprocess.CalledProcessError as exc:
log.error(exc.output)
raise DistutilsPlatformError("Error executing {}"
@@ -134,7 +134,7 @@ def _get_vc_env(plat_spec):
env = {
key.lower(): value
for key, _, value in
- (line.partition('=') for line in out.splitlines())
+ (line.partition("=") for line in out.splitlines())
if key and value
}
@@ -150,7 +150,7 @@ def _find_exe(exe, paths=None):
return the original program name, 'exe'.
"""
if not paths:
- paths = os.getenv('path').split(os.pathsep)
+ paths = os.getenv("path").split(os.pathsep)
for p in paths:
fn = os.path.join(os.path.abspath(p), exe)
if os.path.isfile(fn):
@@ -161,17 +161,17 @@ def _find_exe(exe, paths=None):
# 'vcvarsall.bat'. Always cross-compile from x86 to work with the
# lighter-weight MSVC installs that do not include native 64-bit tools.
PLAT_TO_VCVARS = {
- 'win32' : 'x86',
- 'win-amd64' : 'x86_amd64',
- 'win-arm32' : 'x86_arm',
- 'win-arm64' : 'x86_arm64'
+ "win32" : "x86",
+ "win-amd64" : "x86_amd64",
+ "win-arm32" : "x86_arm",
+ "win-arm64" : "x86_arm64"
}
class MSVCCompiler(CCompiler) :
"""Concrete class that implements an interface to Microsoft Visual C++,
as defined by the CCompiler abstract class."""
- compiler_type = 'msvc'
+ compiler_type = "msvc"
# Just set this so CCompiler's constructor doesn't barf. We currently
# don't use the 'set_executables()' bureaucracy provided by CCompiler,
@@ -181,21 +181,21 @@ class MSVCCompiler(CCompiler) :
executables = {}
# Private class data (need to distinguish C from C++ source for compiler)
- _c_extensions = ['.c']
- _cpp_extensions = ['.cc', '.cpp', '.cxx']
- _rc_extensions = ['.rc']
- _mc_extensions = ['.mc']
+ _c_extensions = [".c"]
+ _cpp_extensions = [".cc", ".cpp", ".cxx"]
+ _rc_extensions = [".rc"]
+ _mc_extensions = [".mc"]
# Needed for the filename generation methods provided by the
# base class, CCompiler.
src_extensions = (_c_extensions + _cpp_extensions +
_rc_extensions + _mc_extensions)
- res_extension = '.res'
- obj_extension = '.obj'
- static_lib_extension = '.lib'
- shared_lib_extension = '.dll'
- static_lib_format = shared_lib_format = '%s%s'
- exe_extension = '.exe'
+ res_extension = ".res"
+ obj_extension = ".obj"
+ static_lib_extension = ".lib"
+ shared_lib_extension = ".dll"
+ static_lib_format = shared_lib_format = "%s%s"
+ exe_extension = ".exe"
def __init__(self, verbose=0, dry_run=0, force=0):
@@ -222,7 +222,7 @@ def initialize(self, plat_name=None):
raise DistutilsPlatformError("Unable to find a compatible "
"Visual Studio installation.")
- self._paths = vc_env.get('path', '')
+ self._paths = vc_env.get("path", "")
paths = self._paths.split(os.pathsep)
self.cc = _find_exe("cl.exe", paths)
self.linker = _find_exe("link.exe", paths)
@@ -231,11 +231,11 @@ def initialize(self, plat_name=None):
self.mc = _find_exe("mc.exe", paths) # message compiler
self.mt = _find_exe("mt.exe", paths) # message compiler
- for dir in vc_env.get('include', '').split(os.pathsep):
+ for dir in vc_env.get("include", "").split(os.pathsep):
if dir:
self.add_include_dir(dir.rstrip(os.sep))
- for dir in vc_env.get('lib', '').split(os.pathsep):
+ for dir in vc_env.get("lib", "").split(os.pathsep):
if dir:
self.add_library_dir(dir.rstrip(os.sep))
@@ -244,25 +244,25 @@ def initialize(self, plat_name=None):
# Future releases of Python 3.x will include all past
# versions of vcruntime*.dll for compatibility.
self.compile_options = [
- '/nologo', '/Ox', '/W3', '/GL', '/DNDEBUG', '/MD'
+ "/nologo", "/Ox", "/W3", "/GL", "/DNDEBUG", "/MD"
]
self.compile_options_debug = [
- '/nologo', '/Od', '/MDd', '/Zi', '/W3', '/D_DEBUG'
+ "/nologo", "/Od", "/MDd", "/Zi", "/W3", "/D_DEBUG"
]
ldflags = [
- '/nologo', '/INCREMENTAL:NO', '/LTCG'
+ "/nologo", "/INCREMENTAL:NO", "/LTCG"
]
ldflags_debug = [
- '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL'
+ "/nologo", "/INCREMENTAL:NO", "/LTCG", "/DEBUG:FULL"
]
- self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1']
- self.ldflags_exe_debug = [*ldflags_debug, '/MANIFEST:EMBED,ID=1']
- self.ldflags_shared = [*ldflags, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO']
- self.ldflags_shared_debug = [*ldflags_debug, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO']
+ self.ldflags_exe = [*ldflags, "/MANIFEST:EMBED,ID=1"]
+ self.ldflags_exe_debug = [*ldflags_debug, "/MANIFEST:EMBED,ID=1"]
+ self.ldflags_shared = [*ldflags, "/DLL", "/MANIFEST:EMBED,ID=2", "/MANIFESTUAC:NO"]
+ self.ldflags_shared_debug = [*ldflags_debug, "/DLL", "/MANIFEST:EMBED,ID=2", "/MANIFESTUAC:NO"]
self.ldflags_static = [*ldflags]
self.ldflags_static_debug = [*ldflags_debug]
@@ -285,13 +285,13 @@ def initialize(self, plat_name=None):
def object_filenames(self,
source_filenames,
strip_dir=0,
- output_dir=''):
+ output_dir=""):
ext_map = {
- **{ext: self.obj_extension for ext in self.src_extensions},
- **{ext: self.res_extension for ext in self._rc_extensions + self._mc_extensions},
+ **dict.fromkeys(self.src_extensions, self.obj_extension),
+ **dict.fromkeys(self._rc_extensions + self._mc_extensions, self.res_extension),
}
- output_dir = output_dir or ''
+ output_dir = output_dir or ""
def make_out_path(p):
base, ext = os.path.splitext(p)
@@ -326,7 +326,7 @@ def compile(self, sources,
macros, objects, extra_postargs, pp_opts, build = compile_info
compile_opts = extra_preargs or []
- compile_opts.append('/c')
+ compile_opts.append("/c")
if debug:
compile_opts.extend(self.compile_options_debug)
else:
@@ -350,8 +350,8 @@ def compile(self, sources,
# relocatable:
# https://developercommunity.visualstudio.com/comments/623156/view.html
d1trimfile_opts = []
- if 'SRC_DIR' in os.environ and os.path.basename(self.cc) == "cl.exe":
- d1trimfile_opts.append("/d1trimfile:" + os.environ['SRC_DIR'])
+ if "SRC_DIR" in os.environ and os.path.basename(self.cc) == "cl.exe":
+ d1trimfile_opts.append("/d1trimfile:" + os.environ["SRC_DIR"])
if ext in self._c_extensions:
input_opt = "/Tc" + src
@@ -383,9 +383,9 @@ def compile(self, sources,
rc_dir = os.path.dirname(obj)
try:
# first compile .MC to .RC and .H file
- self.spawn([self.mc, '-h', h_dir, '-r', rc_dir, src])
+ self.spawn([self.mc, "-h", h_dir, "-r", rc_dir, src])
base, _ = os.path.splitext(os.path.basename (src))
- rc_file = os.path.join(rc_dir, base + '.rc')
+ rc_file = os.path.join(rc_dir, base + ".rc")
# then compile .RC to .RES file
self.spawn([self.rc, "/fo" + obj, rc_file])
@@ -399,7 +399,7 @@ def compile(self, sources,
args = [self.cc] + compile_opts + pp_opts + d1trimfile_opts
if add_cpp_opts:
- args.append('/EHsc')
+ args.append("/EHsc")
args.append(input_opt)
args.append("/Fo" + obj)
args.extend(extra_postargs)
@@ -426,11 +426,11 @@ def create_static_lib(self,
output_dir=output_dir)
if self._need_link(objects, output_filename):
- lib_args = objects + ['/OUT:' + output_filename]
+ lib_args = objects + ["/OUT:" + output_filename]
if debug:
pass # XXX what goes here?
try:
- log.debug('Executing "%s" %s', self.lib, ' '.join(lib_args))
+ log.debug('Executing "%s" %s', self.lib, " ".join(lib_args))
self.spawn([self.lib] + lib_args)
except DistutilsExecError as msg:
raise LibError(msg)
@@ -476,7 +476,7 @@ def link(self,
export_opts = ["/EXPORT:" + sym for sym in (export_symbols or [])]
ld_args = (ldflags + lib_opts + export_opts +
- objects + ['/OUT:' + output_filename])
+ objects + ["/OUT:" + output_filename])
# The MSVC linker generates .lib and .exp files, which cannot be
# suppressed by any linker switches. The .lib files may even be
@@ -490,7 +490,7 @@ def link(self,
implib_file = os.path.join(
build_temp,
self.library_filename(dll_name))
- ld_args.append ('/IMPLIB:' + implib_file)
+ ld_args.append ("/IMPLIB:" + implib_file)
if extra_preargs:
ld_args[:0] = extra_preargs
@@ -500,7 +500,7 @@ def link(self,
output_dir = os.path.dirname(os.path.abspath(output_filename))
self.mkpath(output_dir)
try:
- log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
+ log.debug('Executing "%s" %s', self.linker, " ".join(ld_args))
self.spawn([self.linker] + ld_args)
except DistutilsExecError as msg:
raise LinkError(msg)
@@ -508,12 +508,12 @@ def link(self,
log.debug("skipping %s (up-to-date)", output_filename)
def spawn(self, cmd):
- old_path = os.getenv('path')
+ old_path = os.getenv("path")
try:
- os.environ['path'] = self._paths
+ os.environ["path"] = self._paths
return super().spawn(cmd)
finally:
- os.environ['path'] = old_path
+ os.environ["path"] = old_path
# -- Miscellaneous methods -----------------------------------------
# These are all used by the 'gen_lib_options() function, in
diff --git a/.venv3.10/Lib/distutils/archive_util.py b/.venv3.10/Lib/distutils/archive_util.py
index 565a3117..9886a0cc 100644
--- a/.venv3.10/Lib/distutils/archive_util.py
+++ b/.venv3.10/Lib/distutils/archive_util.py
@@ -69,10 +69,10 @@ def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
Returns the output filename.
"""
- tar_compression = {'gzip': 'gz', 'bzip2': 'bz2', 'xz': 'xz', None: '',
- 'compress': ''}
- compress_ext = {'gzip': '.gz', 'bzip2': '.bz2', 'xz': '.xz',
- 'compress': '.Z'}
+ tar_compression = {"gzip": "gz", "bzip2": "bz2", "xz": "xz", None: "",
+ "compress": ""}
+ compress_ext = {"gzip": ".gz", "bzip2": ".bz2", "xz": ".xz",
+ "compress": ".Z"}
# flags for compression program, each element of list will be an argument
if compress is not None and compress not in compress_ext.keys():
@@ -80,16 +80,16 @@ def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
"bad value for 'compress': must be None, 'gzip', 'bzip2', "
"'xz' or 'compress'")
- archive_name = base_name + '.tar'
- if compress != 'compress':
- archive_name += compress_ext.get(compress, '')
+ archive_name = base_name + ".tar"
+ if compress != "compress":
+ archive_name += compress_ext.get(compress, "")
mkpath(os.path.dirname(archive_name), dry_run=dry_run)
# creating the tarball
import tarfile # late import so Python build itself doesn't break
- log.info('Creating tar archive')
+ log.info("Creating tar archive")
uid = _get_uid(owner)
gid = _get_gid(group)
@@ -104,21 +104,21 @@ def _set_uid_gid(tarinfo):
return tarinfo
if not dry_run:
- tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
+ tar = tarfile.open(archive_name, "w|%s" % tar_compression[compress])
try:
tar.add(base_dir, filter=_set_uid_gid)
finally:
tar.close()
# compression using `compress`
- if compress == 'compress':
+ if compress == "compress":
warn("'compress' will be deprecated.", PendingDeprecationWarning)
# the option varies depending on the platform
compressed_name = archive_name + compress_ext[compress]
- if sys.platform == 'win32':
+ if sys.platform == "win32":
cmd = [compress, archive_name, compressed_name]
else:
- cmd = [compress, '-f', archive_name]
+ cmd = [compress, "-f", archive_name]
spawn(cmd, dry_run=dry_run)
return compressed_name
@@ -168,12 +168,12 @@ def make_zipfile(base_name, base_dir, verbose=0, dry_run=0):
with zip:
if base_dir != os.curdir:
- path = os.path.normpath(os.path.join(base_dir, ''))
+ path = os.path.normpath(os.path.join(base_dir, ""))
zip.write(path, path)
log.info("adding '%s'", path)
for dirpath, dirnames, filenames in os.walk(base_dir):
for name in dirnames:
- path = os.path.normpath(os.path.join(dirpath, name, ''))
+ path = os.path.normpath(os.path.join(dirpath, name, ""))
zip.write(path, path)
log.info("adding '%s'", path)
for name in filenames:
@@ -185,12 +185,12 @@ def make_zipfile(base_name, base_dir, verbose=0, dry_run=0):
return zip_filename
ARCHIVE_FORMATS = {
- 'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"),
- 'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"),
- 'xztar': (make_tarball, [('compress', 'xz')], "xz'ed tar-file"),
- 'ztar': (make_tarball, [('compress', 'compress')], "compressed tar file"),
- 'tar': (make_tarball, [('compress', None)], "uncompressed tar file"),
- 'zip': (make_zipfile, [],"ZIP file")
+ "gztar": (make_tarball, [("compress", "gzip")], "gzip'ed tar-file"),
+ "bztar": (make_tarball, [("compress", "bzip2")], "bzip2'ed tar-file"),
+ "xztar": (make_tarball, [("compress", "xz")], "xz'ed tar-file"),
+ "ztar": (make_tarball, [("compress", "compress")], "compressed tar file"),
+ "tar": (make_tarball, [("compress", None)], "uncompressed tar file"),
+ "zip": (make_zipfile, [],"ZIP file")
}
def check_archive_formats(formats):
@@ -231,7 +231,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
if base_dir is None:
base_dir = os.curdir
- kwargs = {'dry_run': dry_run}
+ kwargs = {"dry_run": dry_run}
try:
format_info = ARCHIVE_FORMATS[format]
@@ -242,9 +242,9 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
for arg, val in format_info[1]:
kwargs[arg] = val
- if format != 'zip':
- kwargs['owner'] = owner
- kwargs['group'] = group
+ if format != "zip":
+ kwargs["owner"] = owner
+ kwargs["group"] = group
try:
filename = func(base_name, base_dir, **kwargs)
diff --git a/.venv3.10/Lib/distutils/bcppcompiler.py b/.venv3.10/Lib/distutils/bcppcompiler.py
index 071fea5d..f28bfd41 100644
--- a/.venv3.10/Lib/distutils/bcppcompiler.py
+++ b/.venv3.10/Lib/distutils/bcppcompiler.py
@@ -27,7 +27,7 @@ class BCPPCompiler(CCompiler) :
compiler, as defined by the CCompiler abstract class.
"""
- compiler_type = 'bcpp'
+ compiler_type = "bcpp"
# Just set this so CCompiler's constructor doesn't barf. We currently
# don't use the 'set_executables()' bureaucracy provided by CCompiler,
@@ -37,17 +37,17 @@ class BCPPCompiler(CCompiler) :
executables = {}
# Private class data (need to distinguish C from C++ source for compiler)
- _c_extensions = ['.c']
- _cpp_extensions = ['.cc', '.cpp', '.cxx']
+ _c_extensions = [".c"]
+ _cpp_extensions = [".cc", ".cpp", ".cxx"]
# Needed for the filename generation methods provided by the
# base class, CCompiler.
src_extensions = _c_extensions + _cpp_extensions
- obj_extension = '.obj'
- static_lib_extension = '.lib'
- shared_lib_extension = '.dll'
- static_lib_format = shared_lib_format = '%s%s'
- exe_extension = '.exe'
+ obj_extension = ".obj"
+ static_lib_extension = ".lib"
+ shared_lib_extension = ".dll"
+ static_lib_format = shared_lib_format = "%s%s"
+ exe_extension = ".exe"
def __init__ (self,
@@ -66,14 +66,14 @@ def __init__ (self,
self.lib = "tlib.exe"
self.preprocess_options = None
- self.compile_options = ['/tWM', '/O2', '/q', '/g0']
- self.compile_options_debug = ['/tWM', '/Od', '/q', '/g0']
+ self.compile_options = ["/tWM", "/O2", "/q", "/g0"]
+ self.compile_options_debug = ["/tWM", "/Od", "/q", "/g0"]
- self.ldflags_shared = ['/Tpd', '/Gn', '/q', '/x']
- self.ldflags_shared_debug = ['/Tpd', '/Gn', '/q', '/x']
+ self.ldflags_shared = ["/Tpd", "/Gn", "/q", "/x"]
+ self.ldflags_shared_debug = ["/Tpd", "/Gn", "/q", "/x"]
self.ldflags_static = []
- self.ldflags_exe = ['/Gn', '/q', '/x']
- self.ldflags_exe_debug = ['/Gn', '/q', '/x','/r']
+ self.ldflags_exe = ["/Gn", "/q", "/x"]
+ self.ldflags_exe_debug = ["/Gn", "/q", "/x","/r"]
# -- Worker methods ------------------------------------------------
@@ -86,7 +86,7 @@ def compile(self, sources,
self._setup_compile(output_dir, macros, include_dirs, sources,
depends, extra_postargs)
compile_opts = extra_preargs or []
- compile_opts.append ('-c')
+ compile_opts.append ("-c")
if debug:
compile_opts.extend (self.compile_options_debug)
else:
@@ -104,10 +104,10 @@ def compile(self, sources,
# Is it possible to skip the normpath?
self.mkpath(os.path.dirname(obj))
- if ext == '.res':
+ if ext == ".res":
# This is already a binary file -- skip it.
continue # the 'for' loop
- if ext == '.rc':
+ if ext == ".rc":
# This needs to be compiled to a .res file -- do it now.
try:
self.spawn (["brcc32", "-fo", obj, src])
@@ -155,7 +155,7 @@ def create_static_lib (self,
self.library_filename (output_libname, output_dir=output_dir)
if self._need_link (objects, output_filename):
- lib_args = [output_filename, '/u'] + objects
+ lib_args = [output_filename, "/u"] + objects
if debug:
pass # XXX what goes here?
try:
@@ -201,13 +201,13 @@ def link (self,
# Figure out linker args based on type of target.
if target_desc == CCompiler.EXECUTABLE:
- startup_obj = 'c0w32'
+ startup_obj = "c0w32"
if debug:
ld_args = self.ldflags_exe_debug[:]
else:
ld_args = self.ldflags_exe[:]
else:
- startup_obj = 'c0d32'
+ startup_obj = "c0d32"
if debug:
ld_args = self.ldflags_shared_debug[:]
else:
@@ -216,15 +216,15 @@ def link (self,
# Create a temporary exports file for use by the linker
if export_symbols is None:
- def_file = ''
+ def_file = ""
else:
head, tail = os.path.split (output_filename)
modname, ext = os.path.splitext (tail)
temp_dir = os.path.dirname(objects[0]) # preserve tree structure
- def_file = os.path.join (temp_dir, '%s.def' % modname)
- contents = ['EXPORTS']
+ def_file = os.path.join (temp_dir, "%s.def" % modname)
+ contents = ["EXPORTS"]
for sym in (export_symbols or []):
- contents.append(' %s=_%s' % (sym, sym))
+ contents.append(" %s=_%s" % (sym, sym))
self.execute(write_file, (def_file, contents),
"writing %s" % def_file)
@@ -236,7 +236,7 @@ def link (self,
resources = []
for file in objects2:
(base, ext) = os.path.splitext(os.path.normcase(file))
- if ext == '.res':
+ if ext == ".res":
resources.append(file)
else:
objects.append(file)
@@ -260,9 +260,9 @@ def link (self,
# them. Arghghh!. Apparently it works fine as coded...
# name of dll/exe file
- ld_args.extend([',',output_filename])
+ ld_args.extend([",",output_filename])
# no map file and start libraries
- ld_args.append(',,')
+ ld_args.append(",,")
for lib in libraries:
# see if we find it and if there is a bcpp specific lib
@@ -276,13 +276,13 @@ def link (self,
ld_args.append(libfile)
# some default libraries
- ld_args.append ('import32')
- ld_args.append ('cw32mt')
+ ld_args.append ("import32")
+ ld_args.append ("cw32mt")
# def file for export symbols
- ld_args.extend([',',def_file])
+ ld_args.extend([",",def_file])
# add resource files
- ld_args.append(',')
+ ld_args.append(",")
ld_args.extend(resources)
@@ -334,23 +334,23 @@ def find_library_file (self, dirs, lib, debug=0):
def object_filenames (self,
source_filenames,
strip_dir=0,
- output_dir=''):
- if output_dir is None: output_dir = ''
+ output_dir=""):
+ if output_dir is None: output_dir = ""
obj_names = []
for src_name in source_filenames:
# use normcase to make sure '.rc' is really '.rc' and not '.RC'
(base, ext) = os.path.splitext (os.path.normcase(src_name))
- if ext not in (self.src_extensions + ['.rc','.res']):
+ if ext not in (self.src_extensions + [".rc",".res"]):
raise UnknownFileError("unknown file type '%s' (from '%s')" % \
(ext, src_name))
if strip_dir:
base = os.path.basename (base)
- if ext == '.res':
+ if ext == ".res":
# these can go unchanged
obj_names.append (os.path.join (output_dir, base + ext))
- elif ext == '.rc':
+ elif ext == ".rc":
# these need to be compiled to .res-files
- obj_names.append (os.path.join (output_dir, base + '.res'))
+ obj_names.append (os.path.join (output_dir, base + ".res"))
else:
obj_names.append (os.path.join (output_dir,
base + self.obj_extension))
@@ -369,9 +369,9 @@ def preprocess (self,
(_, macros, include_dirs) = \
self._fix_compile_args(None, macros, include_dirs)
pp_opts = gen_preprocess_options(macros, include_dirs)
- pp_args = ['cpp32.exe'] + pp_opts
+ pp_args = ["cpp32.exe"] + pp_opts
if output_file is not None:
- pp_args.append('-o' + output_file)
+ pp_args.append("-o" + output_file)
if extra_preargs:
pp_args[:0] = extra_preargs
if extra_postargs:
diff --git a/.venv3.10/Lib/distutils/ccompiler.py b/.venv3.10/Lib/distutils/ccompiler.py
index 4c47f2ed..6efc947d 100644
--- a/.venv3.10/Lib/distutils/ccompiler.py
+++ b/.venv3.10/Lib/distutils/ccompiler.py
@@ -3,7 +3,9 @@
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
-import sys, os, re
+import sys
+import os
+import re
from distutils.errors import *
from distutils.spawn import spawn
from distutils.file_util import move_file
@@ -352,9 +354,9 @@ def _setup_compile(self, outdir, macros, incdirs, sources, depends,
def _get_cc_args(self, pp_opts, debug, before):
# works for unixccompiler, cygwinccompiler
- cc_args = pp_opts + ['-c']
+ cc_args = pp_opts + ["-c"]
if debug:
- cc_args[:0] = ['-g']
+ cc_args[:0] = ["-g"]
if before:
cc_args[:0] = before
return cc_args
@@ -466,7 +468,7 @@ def _need_link(self, objects, output_file):
return True
else:
if self.dry_run:
- newer = newer_group (objects, output_file, missing='newer')
+ newer = newer_group (objects, output_file, missing="newer")
else:
newer = newer_group (objects, output_file)
return newer
@@ -690,7 +692,7 @@ def link_shared_lib(self,
build_temp=None,
target_lang=None):
self.link(CCompiler.SHARED_LIBRARY, objects,
- self.library_filename(output_libname, lib_type='shared'),
+ self.library_filename(output_libname, lib_type="shared"),
output_dir,
libraries, library_dirs, runtime_library_dirs,
export_symbols, debug,
@@ -844,9 +846,9 @@ def find_library_file (self, dirs, lib, debug=0):
# * exe_extension -
# extension for executable files, eg. '' or '.exe'
- def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
+ def object_filenames(self, source_filenames, strip_dir=0, output_dir=""):
if output_dir is None:
- output_dir = ''
+ output_dir = ""
obj_names = []
for src_name in source_filenames:
base, ext = os.path.splitext(src_name)
@@ -861,20 +863,20 @@ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
base + self.obj_extension))
return obj_names
- def shared_object_filename(self, basename, strip_dir=0, output_dir=''):
+ def shared_object_filename(self, basename, strip_dir=0, output_dir=""):
assert output_dir is not None
if strip_dir:
basename = os.path.basename(basename)
return os.path.join(output_dir, basename + self.shared_lib_extension)
- def executable_filename(self, basename, strip_dir=0, output_dir=''):
+ def executable_filename(self, basename, strip_dir=0, output_dir=""):
assert output_dir is not None
if strip_dir:
basename = os.path.basename(basename)
- return os.path.join(output_dir, basename + (self.exe_extension or ''))
+ return os.path.join(output_dir, basename + (self.exe_extension or ""))
- def library_filename(self, libname, lib_type='static', # or 'shared'
- strip_dir=0, output_dir=''):
+ def library_filename(self, libname, lib_type="static", # or 'shared'
+ strip_dir=0, output_dir=""):
assert output_dir is not None
if lib_type not in ("static", "shared", "dylib", "xcode_stub"):
raise ValueError(
@@ -885,7 +887,7 @@ def library_filename(self, libname, lib_type='static', # or 'shared'
dir, base = os.path.split(libname)
filename = fmt % (base, ext)
if strip_dir:
- dir = ''
+ dir = ""
return os.path.join(output_dir, dir, filename)
@@ -926,11 +928,11 @@ def mkpath (self, name, mode=0o777):
# on a cygwin built python we can use gcc like an ordinary UNIXish
# compiler
- ('cygwin.*', 'unix'),
+ ("cygwin.*", "unix"),
# OS name mappings
- ('posix', 'unix'),
- ('nt', 'msvc'),
+ ("posix", "unix"),
+ ("nt", "msvc"),
)
@@ -953,20 +955,20 @@ def get_default_compiler(osname=None, platform=None):
re.match(pattern, osname) is not None:
return compiler
# Default to Unix compiler
- return 'unix'
+ return "unix"
# Map compiler types to (module_name, class_name) pairs -- ie. where to
# find the code that implements an interface to this compiler. (The module
# is assumed to be in the 'distutils' package.)
-compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',
+compiler_class = { "unix": ("unixccompiler", "UnixCCompiler",
"standard UNIX-style compiler"),
- 'msvc': ('_msvccompiler', 'MSVCCompiler',
+ "msvc": ("_msvccompiler", "MSVCCompiler",
"Microsoft Visual C++"),
- 'cygwin': ('cygwinccompiler', 'CygwinCCompiler',
+ "cygwin": ("cygwinccompiler", "CygwinCCompiler",
"Cygwin port of GNU C Compiler for Win32"),
- 'mingw32': ('cygwinccompiler', 'Mingw32CCompiler',
+ "mingw32": ("cygwinccompiler", "Mingw32CCompiler",
"Mingw32 port of GNU C Compiler for Win32"),
- 'bcpp': ('bcppcompiler', 'BCPPCompiler',
+ "bcpp": ("bcppcompiler", "BCPPCompiler",
"Borland C++ Compiler"),
}
diff --git a/.venv3.10/Lib/distutils/cmd.py b/.venv3.10/Lib/distutils/cmd.py
index dba3191e..faa68664 100644
--- a/.venv3.10/Lib/distutils/cmd.py
+++ b/.venv3.10/Lib/distutils/cmd.py
@@ -4,7 +4,9 @@
in the distutils.command package.
"""
-import sys, os, re
+import sys
+import os
+import re
from distutils.errors import DistutilsOptionError
from distutils import util, dir_util, file_util, archive_util, dep_util
from distutils import log
@@ -93,7 +95,7 @@ def __init__(self, dist):
# XXX A more explicit way to customize dry_run would be better.
def __getattr__(self, attr):
- if attr == 'dry_run':
+ if attr == "dry_run":
myval = getattr(self, "_" + attr)
if myval is None:
return getattr(self.distribution, attr)
@@ -230,7 +232,7 @@ def ensure_string_list(self, option):
if val is None:
return
elif isinstance(val, str):
- setattr(self, option, re.split(r',\s*|\s+', val))
+ setattr(self, option, re.split(r",\s*|\s+", val))
else:
if isinstance(val, list):
ok = all(isinstance(v, str) for v in val)
@@ -263,7 +265,7 @@ def ensure_dirname(self, option):
# -- Convenience methods for commands ------------------------------
def get_command_name(self):
- if hasattr(self, 'command_name'):
+ if hasattr(self, "command_name"):
return self.command_name
else:
return self.__class__.__name__
@@ -391,7 +393,7 @@ def make_file(self, infiles, outfile, func, args,
"'infiles' must be a string, or a list or tuple of strings")
if exec_msg is None:
- exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles))
+ exec_msg = "generating %s from %s" % (outfile, ", ".join(infiles))
# If 'outfile' must be regenerated (either because it doesn't
# exist, is out-of-date, or the 'force' flag is true) then
diff --git a/.venv3.10/Lib/distutils/command/__init__.py b/.venv3.10/Lib/distutils/command/__init__.py
index fd0bfae7..98254d17 100644
--- a/.venv3.10/Lib/distutils/command/__init__.py
+++ b/.venv3.10/Lib/distutils/command/__init__.py
@@ -3,24 +3,24 @@
Package containing implementation of all the standard Distutils
commands."""
-__all__ = ['build',
- 'build_py',
- 'build_ext',
- 'build_clib',
- 'build_scripts',
- 'clean',
- 'install',
- 'install_lib',
- 'install_headers',
- 'install_scripts',
- 'install_data',
- 'sdist',
- 'register',
- 'bdist',
- 'bdist_dumb',
- 'bdist_rpm',
- 'check',
- 'upload',
+__all__ = ["build",
+ "build_py",
+ "build_ext",
+ "build_clib",
+ "build_scripts",
+ "clean",
+ "install",
+ "install_lib",
+ "install_headers",
+ "install_scripts",
+ "install_data",
+ "sdist",
+ "register",
+ "bdist",
+ "bdist_dumb",
+ "bdist_rpm",
+ "check",
+ "upload",
# These two are reserved for future use:
#'bdist_sdux',
#'bdist_pkgtool',
diff --git a/.venv3.10/Lib/distutils/command/bdist.py b/.venv3.10/Lib/distutils/command/bdist.py
index d580a809..8c3a03a0 100644
--- a/.venv3.10/Lib/distutils/command/bdist.py
+++ b/.venv3.10/Lib/distutils/command/bdist.py
@@ -25,54 +25,54 @@ class bdist(Command):
description = "create a built (binary) distribution"
- user_options = [('bdist-base=', 'b',
+ user_options = [("bdist-base=", "b",
"temporary directory for creating built distributions"),
- ('plat-name=', 'p',
+ ("plat-name=", "p",
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
- ('formats=', None,
+ ("formats=", None,
"formats for distribution (comma-separated list)"),
- ('dist-dir=', 'd',
+ ("dist-dir=", "d",
"directory to put final built distributions in "
"[default: dist]"),
- ('skip-build', None,
+ ("skip-build", None,
"skip rebuilding everything (for testing/debugging)"),
- ('owner=', 'u',
+ ("owner=", "u",
"Owner name used when creating a tar file"
" [default: current user]"),
- ('group=', 'g',
+ ("group=", "g",
"Group name used when creating a tar file"
" [default: current group]"),
]
- boolean_options = ['skip-build']
+ boolean_options = ["skip-build"]
help_options = [
- ('help-formats', None,
+ ("help-formats", None,
"lists available distribution formats", show_formats),
]
# The following commands do not take a format option from bdist
- no_format_option = ('bdist_rpm',)
+ no_format_option = ("bdist_rpm",)
# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
- default_format = {'posix': 'gztar',
- 'nt': 'zip'}
+ default_format = {"posix": "gztar",
+ "nt": "zip"}
# Establish the preferred order (for the --help-formats option).
- format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar',
- 'zip', 'msi']
+ format_commands = ["rpm", "gztar", "bztar", "xztar", "ztar", "tar",
+ "zip", "msi"]
# And the real information.
- format_command = {'rpm': ('bdist_rpm', "RPM distribution"),
- 'gztar': ('bdist_dumb', "gzip'ed tar file"),
- 'bztar': ('bdist_dumb', "bzip2'ed tar file"),
- 'xztar': ('bdist_dumb', "xz'ed tar file"),
- 'ztar': ('bdist_dumb', "compressed tar file"),
- 'tar': ('bdist_dumb', "tar file"),
- 'zip': ('bdist_dumb', "ZIP file"),
- 'msi': ('bdist_msi', "Microsoft Installer")
+ format_command = {"rpm": ("bdist_rpm", "RPM distribution"),
+ "gztar": ("bdist_dumb", "gzip'ed tar file"),
+ "bztar": ("bdist_dumb", "bzip2'ed tar file"),
+ "xztar": ("bdist_dumb", "xz'ed tar file"),
+ "ztar": ("bdist_dumb", "compressed tar file"),
+ "tar": ("bdist_dumb", "tar file"),
+ "zip": ("bdist_dumb", "ZIP file"),
+ "msi": ("bdist_msi", "Microsoft Installer")
}
@@ -91,17 +91,17 @@ def finalize_options(self):
if self.skip_build:
self.plat_name = get_platform()
else:
- self.plat_name = self.get_finalized_command('build').plat_name
+ self.plat_name = self.get_finalized_command("build").plat_name
# 'bdist_base' -- parent of per-built-distribution-format
# temporary directories (eg. we'll probably have
# "build/bdist./dumb", "build/bdist./rpm", etc.)
if self.bdist_base is None:
- build_base = self.get_finalized_command('build').build_base
+ build_base = self.get_finalized_command("build").build_base
self.bdist_base = os.path.join(build_base,
- 'bdist.' + self.plat_name)
+ "bdist." + self.plat_name)
- self.ensure_string_list('formats')
+ self.ensure_string_list("formats")
if self.formats is None:
try:
self.formats = [self.default_format[os.name]]
@@ -130,7 +130,7 @@ def run(self):
sub_cmd.format = self.formats[i]
# passing the owner and group names for tar archiving
- if cmd_name == 'bdist_dumb':
+ if cmd_name == "bdist_dumb":
sub_cmd.owner = self.owner
sub_cmd.group = self.group
diff --git a/.venv3.10/Lib/distutils/command/bdist_dumb.py b/.venv3.10/Lib/distutils/command/bdist_dumb.py
index f0d6b5b8..1e0a45ab 100644
--- a/.venv3.10/Lib/distutils/command/bdist_dumb.py
+++ b/.venv3.10/Lib/distutils/command/bdist_dumb.py
@@ -14,38 +14,38 @@
class bdist_dumb(Command):
- description = "create a \"dumb\" built distribution"
+ description = 'create a "dumb" built distribution'
- user_options = [('bdist-dir=', 'd',
+ user_options = [("bdist-dir=", "d",
"temporary directory for creating the distribution"),
- ('plat-name=', 'p',
+ ("plat-name=", "p",
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
- ('format=', 'f',
+ ("format=", "f",
"archive format to create (tar, gztar, bztar, xztar, "
"ztar, zip)"),
- ('keep-temp', 'k',
+ ("keep-temp", "k",
"keep the pseudo-installation tree around after " +
"creating the distribution archive"),
- ('dist-dir=', 'd',
+ ("dist-dir=", "d",
"directory to put final built distributions in"),
- ('skip-build', None,
+ ("skip-build", None,
"skip rebuilding everything (for testing/debugging)"),
- ('relative', None,
+ ("relative", None,
"build the archive using relative paths "
"(default: false)"),
- ('owner=', 'u',
+ ("owner=", "u",
"Owner name used when creating a tar file"
" [default: current user]"),
- ('group=', 'g',
+ ("group=", "g",
"Group name used when creating a tar file"
" [default: current group]"),
]
- boolean_options = ['keep-temp', 'skip-build', 'relative']
+ boolean_options = ["keep-temp", "skip-build", "relative"]
- default_format = { 'posix': 'gztar',
- 'nt': 'zip' }
+ default_format = { "posix": "gztar",
+ "nt": "zip" }
def initialize_options(self):
self.bdist_dir = None
@@ -60,8 +60,8 @@ def initialize_options(self):
def finalize_options(self):
if self.bdist_dir is None:
- bdist_base = self.get_finalized_command('bdist').bdist_base
- self.bdist_dir = os.path.join(bdist_base, 'dumb')
+ bdist_base = self.get_finalized_command("bdist").bdist_base
+ self.bdist_dir = os.path.join(bdist_base, "dumb")
if self.format is None:
try:
@@ -71,22 +71,22 @@ def finalize_options(self):
"don't know how to create dumb built distributions "
"on platform %s" % os.name)
- self.set_undefined_options('bdist',
- ('dist_dir', 'dist_dir'),
- ('plat_name', 'plat_name'),
- ('skip_build', 'skip_build'))
+ self.set_undefined_options("bdist",
+ ("dist_dir", "dist_dir"),
+ ("plat_name", "plat_name"),
+ ("skip_build", "skip_build"))
def run(self):
if not self.skip_build:
- self.run_command('build')
+ self.run_command("build")
- install = self.reinitialize_command('install', reinit_subcommands=1)
+ install = self.reinitialize_command("install", reinit_subcommands=1)
install.root = self.bdist_dir
install.skip_build = self.skip_build
install.warn_dir = 0
log.info("installing to %s", self.bdist_dir)
- self.run_command('install')
+ self.run_command("install")
# And make an archive relative to the root of the
# pseudo-installation tree.
@@ -115,8 +115,8 @@ def run(self):
if self.distribution.has_ext_modules():
pyversion = get_python_version()
else:
- pyversion = 'any'
- self.distribution.dist_files.append(('bdist_dumb', pyversion,
+ pyversion = "any"
+ self.distribution.dist_files.append(("bdist_dumb", pyversion,
filename))
if not self.keep_temp:
diff --git a/.venv3.10/Lib/distutils/command/bdist_msi.py b/.venv3.10/Lib/distutils/command/bdist_msi.py
index 2ed017b4..d3614bb0 100644
--- a/.venv3.10/Lib/distutils/command/bdist_msi.py
+++ b/.venv3.10/Lib/distutils/command/bdist_msi.py
@@ -84,43 +84,43 @@ class bdist_msi(Command):
description = "create a Microsoft Installer (.msi) binary distribution"
- user_options = [('bdist-dir=', None,
+ user_options = [("bdist-dir=", None,
"temporary directory for creating the distribution"),
- ('plat-name=', 'p',
+ ("plat-name=", "p",
"platform name to embed in generated filenames "
"(default: %s)" % get_platform()),
- ('keep-temp', 'k',
+ ("keep-temp", "k",
"keep the pseudo-installation tree around after " +
"creating the distribution archive"),
- ('target-version=', None,
+ ("target-version=", None,
"require a specific python version" +
" on the target system"),
- ('no-target-compile', 'c',
+ ("no-target-compile", "c",
"do not compile .py to .pyc on the target system"),
- ('no-target-optimize', 'o',
+ ("no-target-optimize", "o",
"do not compile .py to .pyo (optimized) "
"on the target system"),
- ('dist-dir=', 'd',
+ ("dist-dir=", "d",
"directory to put final built distributions in"),
- ('skip-build', None,
+ ("skip-build", None,
"skip rebuilding everything (for testing/debugging)"),
- ('install-script=', None,
+ ("install-script=", None,
"basename of installation script to be run after "
"installation or before deinstallation"),
- ('pre-install-script=', None,
+ ("pre-install-script=", None,
"Fully qualified filename of a script to be run before "
"any files are installed. This script need not be in the "
"distribution"),
]
- boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
- 'skip-build']
+ boolean_options = ["keep-temp", "no-target-compile", "no-target-optimize",
+ "skip-build"]
- all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4',
- '2.5', '2.6', '2.7', '2.8', '2.9',
- '3.0', '3.1', '3.2', '3.3', '3.4',
- '3.5', '3.6', '3.7', '3.8', '3.9']
- other_version = 'X'
+ all_versions = ["2.0", "2.1", "2.2", "2.3", "2.4",
+ "2.5", "2.6", "2.7", "2.8", "2.9",
+ "3.0", "3.1", "3.2", "3.3", "3.4",
+ "3.5", "3.6", "3.7", "3.8", "3.9"]
+ other_version = "X"
def __init__(self, *args, **kw):
super().__init__(*args, **kw)
@@ -142,11 +142,11 @@ def initialize_options(self):
self.versions = None
def finalize_options(self):
- self.set_undefined_options('bdist', ('skip_build', 'skip_build'))
+ self.set_undefined_options("bdist", ("skip_build", "skip_build"))
if self.bdist_dir is None:
- bdist_base = self.get_finalized_command('bdist').bdist_base
- self.bdist_dir = os.path.join(bdist_base, 'msi')
+ bdist_base = self.get_finalized_command("bdist").bdist_base
+ self.bdist_dir = os.path.join(bdist_base, "msi")
short_version = get_python_version()
if (not self.target_version) and self.distribution.has_ext_modules():
@@ -162,9 +162,9 @@ def finalize_options(self):
else:
self.versions = list(self.all_versions)
- self.set_undefined_options('bdist',
- ('dist_dir', 'dist_dir'),
- ('plat_name', 'plat_name'),
+ self.set_undefined_options("bdist",
+ ("dist_dir", "dist_dir"),
+ ("plat_name", "plat_name"),
)
if self.pre_install_script:
@@ -183,14 +183,14 @@ def finalize_options(self):
def run(self):
if not self.skip_build:
- self.run_command('build')
+ self.run_command("build")
- install = self.reinitialize_command('install', reinit_subcommands=1)
+ install = self.reinitialize_command("install", reinit_subcommands=1)
install.prefix = self.bdist_dir
install.skip_build = self.skip_build
install.warn_dir = 0
- install_lib = self.reinitialize_command('install_lib')
+ install_lib = self.reinitialize_command("install_lib")
# we do not want to include pyc or pyo files
install_lib.compile = 0
install_lib.optimize = 0
@@ -205,18 +205,18 @@ def run(self):
target_version = self.target_version
if not target_version:
assert self.skip_build, "Should have already checked this"
- target_version = '%d.%d' % sys.version_info[:2]
+ target_version = "%d.%d" % sys.version_info[:2]
plat_specifier = ".%s-%s" % (self.plat_name, target_version)
- build = self.get_finalized_command('build')
+ build = self.get_finalized_command("build")
build.build_lib = os.path.join(build.build_base,
- 'lib' + plat_specifier)
+ "lib" + plat_specifier)
log.info("installing to %s", self.bdist_dir)
install.ensure_finalized()
# avoid warning of 'install_lib' about installing
# into a directory not in sys.path
- sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))
+ sys.path.insert(0, os.path.join(self.bdist_dir, "PURELIB"))
install.run()
@@ -250,14 +250,14 @@ def run(self):
product_name, msilib.gen_uuid(),
sversion, author)
msilib.add_tables(self.db, sequence)
- props = [('DistVersion', version)]
+ props = [("DistVersion", version)]
email = metadata.author_email or metadata.maintainer_email
if email:
props.append(("ARPCONTACT", email))
if metadata.url:
props.append(("ARPURLINFOABOUT", metadata.url))
if props:
- add_data(self.db, 'Property', props)
+ add_data(self.db, "Property", props)
self.add_find_python()
self.add_files()
@@ -265,8 +265,8 @@ def run(self):
self.add_ui()
self.db.Commit()
- if hasattr(self.distribution, 'dist_files'):
- tup = 'bdist_msi', self.target_version or 'any', fullname
+ if hasattr(self.distribution, "dist_files"):
+ tup = "bdist_msi", self.target_version or "any", fullname
self.distribution.dist_files.append(tup)
if not self.keep_temp:
@@ -281,7 +281,7 @@ def add_files(self):
f = Feature(db, "Python", "Python", "Everything",
0, 1, directory="TARGETDIR")
- items = [(f, root, '')]
+ items = [(f, root, "")]
for version in self.versions + [self.other_version]:
target = "TARGETDIR" + version
name = default = "Python" + version
@@ -318,7 +318,7 @@ def add_files(self):
if self.install_script_key:
raise DistutilsOptionError(
"Multiple files with name %s" % file)
- self.install_script_key = '[#%s]' % key
+ self.install_script_key = "[#%s]" % key
else:
key = seen[afile]
add_data(self.db, "DuplicateFile",
@@ -463,8 +463,8 @@ def add_ui(self):
("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
("ProgressDlg", None, 1280)])
- add_data(db, 'ActionText', text.ActionText)
- add_data(db, 'UIText', text.UIText)
+ add_data(db, "ActionText", text.ActionText)
+ add_data(db, "UIText", text.UIText)
#####################################################################
# Standard dialogs: FatalError, UserExit, ExitDialog
fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
diff --git a/.venv3.10/Lib/distutils/command/bdist_rpm.py b/.venv3.10/Lib/distutils/command/bdist_rpm.py
index 550cbfa1..3db1da43 100644
--- a/.venv3.10/Lib/distutils/command/bdist_rpm.py
+++ b/.venv3.10/Lib/distutils/command/bdist_rpm.py
@@ -3,7 +3,9 @@
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
-import subprocess, sys, os
+import subprocess
+import sys
+import os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
@@ -16,27 +18,27 @@ class bdist_rpm(Command):
description = "create an RPM distribution"
user_options = [
- ('bdist-base=', None,
+ ("bdist-base=", None,
"base directory for creating built distributions"),
- ('rpm-base=', None,
- "base directory for creating RPMs (defaults to \"rpm\" under "
+ ("rpm-base=", None,
+ 'base directory for creating RPMs (defaults to "rpm" under '
"--bdist-base; must be specified for RPM 2)"),
- ('dist-dir=', 'd',
+ ("dist-dir=", "d",
"directory to put final RPM files in "
"(and .spec files if --spec-only)"),
- ('python=', None,
+ ("python=", None,
"path to Python interpreter to hard-code in the .spec file "
- "(default: \"python\")"),
- ('fix-python', None,
+ '(default: "python")'),
+ ("fix-python", None,
"hard-code the exact path to the current Python interpreter in "
"the .spec file"),
- ('spec-only', None,
+ ("spec-only", None,
"only regenerate spec file"),
- ('source-only', None,
+ ("source-only", None,
"only generate source RPM"),
- ('binary-only', None,
+ ("binary-only", None,
"only generate binary RPM"),
- ('use-bzip2', None,
+ ("use-bzip2", None,
"use bzip2 instead of gzip to create source distribution"),
# More meta-data: too RPM-specific to put in the setup script,
@@ -44,92 +46,92 @@ class bdist_rpm(Command):
# to "bdist_rpm". The idea is that packagers would put this
# info in setup.cfg, although they are of course free to
# supply it on the command line.
- ('distribution-name=', None,
+ ("distribution-name=", None,
"name of the (Linux) distribution to which this "
"RPM applies (*not* the name of the module distribution!)"),
- ('group=', None,
- "package classification [default: \"Development/Libraries\"]"),
- ('release=', None,
+ ("group=", None,
+ 'package classification [default: "Development/Libraries"]'),
+ ("release=", None,
"RPM release number"),
- ('serial=', None,
+ ("serial=", None,
"RPM serial number"),
- ('vendor=', None,
- "RPM \"vendor\" (eg. \"Joe Blow \") "
+ ("vendor=", None,
+ 'RPM "vendor" (eg. "Joe Blow ") '
"[default: maintainer or author from setup script]"),
- ('packager=', None,
- "RPM packager (eg. \"Jane Doe \") "
+ ("packager=", None,
+ 'RPM packager (eg. "Jane Doe ") '
"[default: vendor]"),
- ('doc-files=', None,
+ ("doc-files=", None,
"list of documentation files (space or comma-separated)"),
- ('changelog=', None,
+ ("changelog=", None,
"RPM changelog"),
- ('icon=', None,
+ ("icon=", None,
"name of icon file"),
- ('provides=', None,
+ ("provides=", None,
"capabilities provided by this package"),
- ('requires=', None,
+ ("requires=", None,
"capabilities required by this package"),
- ('conflicts=', None,
+ ("conflicts=", None,
"capabilities which conflict with this package"),
- ('build-requires=', None,
+ ("build-requires=", None,
"capabilities required to build this package"),
- ('obsoletes=', None,
+ ("obsoletes=", None,
"capabilities made obsolete by this package"),
- ('no-autoreq', None,
+ ("no-autoreq", None,
"do not automatically calculate dependencies"),
# Actions to take when building RPM
- ('keep-temp', 'k',
+ ("keep-temp", "k",
"don't clean up RPM build directory"),
- ('no-keep-temp', None,
+ ("no-keep-temp", None,
"clean up RPM build directory [default]"),
- ('use-rpm-opt-flags', None,
+ ("use-rpm-opt-flags", None,
"compile with RPM_OPT_FLAGS when building from source RPM"),
- ('no-rpm-opt-flags', None,
+ ("no-rpm-opt-flags", None,
"do not pass any RPM CFLAGS to compiler"),
- ('rpm3-mode', None,
+ ("rpm3-mode", None,
"RPM 3 compatibility mode (default)"),
- ('rpm2-mode', None,
+ ("rpm2-mode", None,
"RPM 2 compatibility mode"),
# Add the hooks necessary for specifying custom scripts
- ('prep-script=', None,
+ ("prep-script=", None,
"Specify a script for the PREP phase of RPM building"),
- ('build-script=', None,
+ ("build-script=", None,
"Specify a script for the BUILD phase of RPM building"),
- ('pre-install=', None,
+ ("pre-install=", None,
"Specify a script for the pre-INSTALL phase of RPM building"),
- ('install-script=', None,
+ ("install-script=", None,
"Specify a script for the INSTALL phase of RPM building"),
- ('post-install=', None,
+ ("post-install=", None,
"Specify a script for the post-INSTALL phase of RPM building"),
- ('pre-uninstall=', None,
+ ("pre-uninstall=", None,
"Specify a script for the pre-UNINSTALL phase of RPM building"),
- ('post-uninstall=', None,
+ ("post-uninstall=", None,
"Specify a script for the post-UNINSTALL phase of RPM building"),
- ('clean-script=', None,
+ ("clean-script=", None,
"Specify a script for the CLEAN phase of RPM building"),
- ('verify-script=', None,
+ ("verify-script=", None,
"Specify a script for the VERIFY phase of the RPM build"),
# Allow a packager to explicitly force an architecture
- ('force-arch=', None,
+ ("force-arch=", None,
"Force an architecture onto the RPM build process"),
- ('quiet', 'q',
+ ("quiet", "q",
"Run the INSTALL phase of RPM building in quiet mode"),
]
- boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode',
- 'no-autoreq', 'quiet']
+ boolean_options = ["keep-temp", "use-rpm-opt-flags", "rpm3-mode",
+ "no-autoreq", "quiet"]
- negative_opt = {'no-keep-temp': 'keep-temp',
- 'no-rpm-opt-flags': 'use-rpm-opt-flags',
- 'rpm2-mode': 'rpm3-mode'}
+ negative_opt = {"no-keep-temp": "keep-temp",
+ "no-rpm-opt-flags": "use-rpm-opt-flags",
+ "rpm2-mode": "rpm3-mode"}
def initialize_options(self):
@@ -178,7 +180,7 @@ def initialize_options(self):
self.quiet = 0
def finalize_options(self):
- self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
+ self.set_undefined_options("bdist", ("bdist_base", "bdist_base"))
if self.rpm_base is None:
if not self.rpm3_mode:
raise DistutilsOptionError(
@@ -194,7 +196,7 @@ def finalize_options(self):
raise DistutilsOptionError(
"--python and --fix-python are mutually exclusive options")
- if os.name != 'posix':
+ if os.name != "posix":
raise DistutilsPlatformError("don't know how to create RPM "
"distributions on platform %s" % os.name)
if self.binary_only and self.source_only:
@@ -205,53 +207,53 @@ def finalize_options(self):
if not self.distribution.has_ext_modules():
self.use_rpm_opt_flags = 0
- self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
+ self.set_undefined_options("bdist", ("dist_dir", "dist_dir"))
self.finalize_package_data()
def finalize_package_data(self):
- self.ensure_string('group', "Development/Libraries")
- self.ensure_string('vendor',
+ self.ensure_string("group", "Development/Libraries")
+ self.ensure_string("vendor",
"%s <%s>" % (self.distribution.get_contact(),
self.distribution.get_contact_email()))
- self.ensure_string('packager')
- self.ensure_string_list('doc_files')
+ self.ensure_string("packager")
+ self.ensure_string_list("doc_files")
if isinstance(self.doc_files, list):
- for readme in ('README', 'README.txt'):
+ for readme in ("README", "README.txt"):
if os.path.exists(readme) and readme not in self.doc_files:
self.doc_files.append(readme)
- self.ensure_string('release', "1")
- self.ensure_string('serial') # should it be an int?
+ self.ensure_string("release", "1")
+ self.ensure_string("serial") # should it be an int?
- self.ensure_string('distribution_name')
+ self.ensure_string("distribution_name")
- self.ensure_string('changelog')
+ self.ensure_string("changelog")
# Format changelog correctly
self.changelog = self._format_changelog(self.changelog)
- self.ensure_filename('icon')
+ self.ensure_filename("icon")
- self.ensure_filename('prep_script')
- self.ensure_filename('build_script')
- self.ensure_filename('install_script')
- self.ensure_filename('clean_script')
- self.ensure_filename('verify_script')
- self.ensure_filename('pre_install')
- self.ensure_filename('post_install')
- self.ensure_filename('pre_uninstall')
- self.ensure_filename('post_uninstall')
+ self.ensure_filename("prep_script")
+ self.ensure_filename("build_script")
+ self.ensure_filename("install_script")
+ self.ensure_filename("clean_script")
+ self.ensure_filename("verify_script")
+ self.ensure_filename("pre_install")
+ self.ensure_filename("post_install")
+ self.ensure_filename("pre_uninstall")
+ self.ensure_filename("post_uninstall")
# XXX don't forget we punted on summaries and descriptions -- they
# should be handled here eventually!
# Now *this* is some meta-data that belongs in the setup script...
- self.ensure_string_list('provides')
- self.ensure_string_list('requires')
- self.ensure_string_list('conflicts')
- self.ensure_string_list('build_requires')
- self.ensure_string_list('obsoletes')
+ self.ensure_string_list("provides")
+ self.ensure_string_list("requires")
+ self.ensure_string_list("conflicts")
+ self.ensure_string_list("build_requires")
+ self.ensure_string_list("obsoletes")
- self.ensure_string('force_arch')
+ self.ensure_string("force_arch")
def run(self):
if DEBUG:
@@ -267,10 +269,10 @@ def run(self):
self.mkpath(spec_dir)
else:
rpm_dir = {}
- for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'):
+ for d in ("SOURCES", "SPECS", "BUILD", "RPMS", "SRPMS"):
rpm_dir[d] = os.path.join(self.rpm_base, d)
self.mkpath(rpm_dir[d])
- spec_dir = rpm_dir['SPECS']
+ spec_dir = rpm_dir["SPECS"]
# Spec file goes into 'dist_dir' if '--spec-only specified',
# build/rpm. otherwise.
@@ -287,16 +289,16 @@ def run(self):
# Make a source distribution and copy to SOURCES directory with
# optional icon.
saved_dist_files = self.distribution.dist_files[:]
- sdist = self.reinitialize_command('sdist')
+ sdist = self.reinitialize_command("sdist")
if self.use_bzip2:
- sdist.formats = ['bztar']
+ sdist.formats = ["bztar"]
else:
- sdist.formats = ['gztar']
- self.run_command('sdist')
+ sdist.formats = ["gztar"]
+ self.run_command("sdist")
self.distribution.dist_files = saved_dist_files
source = sdist.get_archive_files()[0]
- source_dir = rpm_dir['SOURCES']
+ source_dir = rpm_dir["SOURCES"]
self.copy_file(source, source_dir)
if self.icon:
@@ -308,23 +310,23 @@ def run(self):
# build package
log.info("building RPMs")
- rpm_cmd = ['rpmbuild']
+ rpm_cmd = ["rpmbuild"]
if self.source_only: # what kind of RPMs?
- rpm_cmd.append('-bs')
+ rpm_cmd.append("-bs")
elif self.binary_only:
- rpm_cmd.append('-bb')
+ rpm_cmd.append("-bb")
else:
- rpm_cmd.append('-ba')
- rpm_cmd.extend(['--define', '__python %s' % self.python])
+ rpm_cmd.append("-ba")
+ rpm_cmd.extend(["--define", "__python %s" % self.python])
if self.rpm3_mode:
- rpm_cmd.extend(['--define',
- '_topdir %s' % os.path.abspath(self.rpm_base)])
+ rpm_cmd.extend(["--define",
+ "_topdir %s" % os.path.abspath(self.rpm_base)])
if not self.keep_temp:
- rpm_cmd.append('--clean')
+ rpm_cmd.append("--clean")
if self.quiet:
- rpm_cmd.append('--quiet')
+ rpm_cmd.append("--quiet")
rpm_cmd.append(spec_path)
# Determine the binary rpm names that should be built out of this spec
@@ -365,25 +367,25 @@ def run(self):
if self.distribution.has_ext_modules():
pyversion = get_python_version()
else:
- pyversion = 'any'
+ pyversion = "any"
if not self.binary_only:
- srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
+ srpm = os.path.join(rpm_dir["SRPMS"], source_rpm)
assert(os.path.exists(srpm))
self.move_file(srpm, self.dist_dir)
filename = os.path.join(self.dist_dir, source_rpm)
self.distribution.dist_files.append(
- ('bdist_rpm', pyversion, filename))
+ ("bdist_rpm", pyversion, filename))
if not self.source_only:
for rpm in binary_rpms:
- rpm = os.path.join(rpm_dir['RPMS'], rpm)
+ rpm = os.path.join(rpm_dir["RPMS"], rpm)
if os.path.exists(rpm):
self.move_file(rpm, self.dist_dir)
filename = os.path.join(self.dist_dir,
os.path.basename(rpm))
self.distribution.dist_files.append(
- ('bdist_rpm', pyversion, filename))
+ ("bdist_rpm", pyversion, filename))
def _dist_path(self, path):
return os.path.join(self.dist_dir, os.path.basename(path))
@@ -394,28 +396,28 @@ def _make_spec_file(self):
"""
# definitions and headers
spec_file = [
- '%define name ' + self.distribution.get_name(),
- '%define version ' + self.distribution.get_version().replace('-','_'),
- '%define unmangled_version ' + self.distribution.get_version(),
- '%define release ' + self.release.replace('-','_'),
- '',
- 'Summary: ' + self.distribution.get_description(),
+ "%define name " + self.distribution.get_name(),
+ "%define version " + self.distribution.get_version().replace("-","_"),
+ "%define unmangled_version " + self.distribution.get_version(),
+ "%define release " + self.release.replace("-","_"),
+ "",
+ "Summary: " + self.distribution.get_description(),
]
# Workaround for #14443 which affects some RPM based systems such as
# RHEL6 (and probably derivatives)
- vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}')
+ vendor_hook = subprocess.getoutput("rpm --eval %{__os_install_post}")
# Generate a potential replacement value for __os_install_post (whilst
# normalizing the whitespace to simplify the test for whether the
# invocation of brp-python-bytecompile passes in __python):
- vendor_hook = '\n'.join([' %s \\' % line.strip()
+ vendor_hook = "\n".join([" %s \\" % line.strip()
for line in vendor_hook.splitlines()])
problem = "brp-python-bytecompile \\\n"
fixed = "brp-python-bytecompile %{__python} \\\n"
fixed_hook = vendor_hook.replace(problem, fixed)
if fixed_hook != vendor_hook:
- spec_file.append('# Workaround for http://bugs.python.org/issue14443')
- spec_file.append('%define __os_install_post ' + fixed_hook + '\n')
+ spec_file.append("# Workaround for http://bugs.python.org/issue14443")
+ spec_file.append("%define __os_install_post " + fixed_hook + "\n")
# put locale summaries into spec file
# XXX not supported for now (hard to put a dictionary
@@ -425,64 +427,64 @@ def _make_spec_file(self):
# self.summaries[locale]))
spec_file.extend([
- 'Name: %{name}',
- 'Version: %{version}',
- 'Release: %{release}',])
+ "Name: %{name}",
+ "Version: %{version}",
+ "Release: %{release}",])
# XXX yuck! this filename is available from the "sdist" command,
# but only after it has run: and we create the spec file before
# running "sdist", in case of --spec-only.
if self.use_bzip2:
- spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
+ spec_file.append("Source0: %{name}-%{unmangled_version}.tar.bz2")
else:
- spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
+ spec_file.append("Source0: %{name}-%{unmangled_version}.tar.gz")
spec_file.extend([
- 'License: ' + self.distribution.get_license(),
- 'Group: ' + self.group,
- 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot',
- 'Prefix: %{_prefix}', ])
+ "License: " + self.distribution.get_license(),
+ "Group: " + self.group,
+ "BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot",
+ "Prefix: %{_prefix}", ])
if not self.force_arch:
# noarch if no extension modules
if not self.distribution.has_ext_modules():
- spec_file.append('BuildArch: noarch')
+ spec_file.append("BuildArch: noarch")
else:
- spec_file.append( 'BuildArch: %s' % self.force_arch )
-
- for field in ('Vendor',
- 'Packager',
- 'Provides',
- 'Requires',
- 'Conflicts',
- 'Obsoletes',
+ spec_file.append( "BuildArch: %s" % self.force_arch )
+
+ for field in ("Vendor",
+ "Packager",
+ "Provides",
+ "Requires",
+ "Conflicts",
+ "Obsoletes",
):
val = getattr(self, field.lower())
if isinstance(val, list):
- spec_file.append('%s: %s' % (field, ' '.join(val)))
+ spec_file.append("%s: %s" % (field, " ".join(val)))
elif val is not None:
- spec_file.append('%s: %s' % (field, val))
+ spec_file.append("%s: %s" % (field, val))
- if self.distribution.get_url() != 'UNKNOWN':
- spec_file.append('Url: ' + self.distribution.get_url())
+ if self.distribution.get_url() != "UNKNOWN":
+ spec_file.append("Url: " + self.distribution.get_url())
if self.distribution_name:
- spec_file.append('Distribution: ' + self.distribution_name)
+ spec_file.append("Distribution: " + self.distribution_name)
if self.build_requires:
- spec_file.append('BuildRequires: ' +
- ' '.join(self.build_requires))
+ spec_file.append("BuildRequires: " +
+ " ".join(self.build_requires))
if self.icon:
- spec_file.append('Icon: ' + os.path.basename(self.icon))
+ spec_file.append("Icon: " + os.path.basename(self.icon))
if self.no_autoreq:
- spec_file.append('AutoReq: 0')
+ spec_file.append("AutoReq: 0")
spec_file.extend([
- '',
- '%description',
+ "",
+ "%description",
self.distribution.get_long_description()
])
@@ -509,19 +511,19 @@ def _make_spec_file(self):
# that we open and interpolate into the spec file, but the defaults
# are just text that we drop in as-is. Hmmm.
- install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
- '--record=INSTALLED_FILES') % def_setup_call
+ install_cmd = ("%s install -O1 --root=$RPM_BUILD_ROOT "
+ "--record=INSTALLED_FILES") % def_setup_call
script_options = [
- ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
- ('build', 'build_script', def_build),
- ('install', 'install_script', install_cmd),
- ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
- ('verifyscript', 'verify_script', None),
- ('pre', 'pre_install', None),
- ('post', 'post_install', None),
- ('preun', 'pre_uninstall', None),
- ('postun', 'post_uninstall', None),
+ ("prep", "prep_script", "%setup -n %{name}-%{unmangled_version}"),
+ ("build", "build_script", def_build),
+ ("install", "install_script", install_cmd),
+ ("clean", "clean_script", "rm -rf $RPM_BUILD_ROOT"),
+ ("verifyscript", "verify_script", None),
+ ("pre", "pre_install", None),
+ ("post", "post_install", None),
+ ("preun", "pre_uninstall", None),
+ ("postun", "post_uninstall", None),
]
for (rpm_opt, attr, default) in script_options:
@@ -530,29 +532,29 @@ def _make_spec_file(self):
val = getattr(self, attr)
if val or default:
spec_file.extend([
- '',
- '%' + rpm_opt,])
+ "",
+ "%" + rpm_opt,])
if val:
with open(val) as f:
- spec_file.extend(f.read().split('\n'))
+ spec_file.extend(f.read().split("\n"))
else:
spec_file.append(default)
# files section
spec_file.extend([
- '',
- '%files -f INSTALLED_FILES',
- '%defattr(-,root,root)',
+ "",
+ "%files -f INSTALLED_FILES",
+ "%defattr(-,root,root)",
])
if self.doc_files:
- spec_file.append('%doc ' + ' '.join(self.doc_files))
+ spec_file.append("%doc " + " ".join(self.doc_files))
if self.changelog:
spec_file.extend([
- '',
- '%changelog',])
+ "",
+ "%changelog",])
spec_file.extend(self.changelog)
return spec_file
@@ -563,14 +565,14 @@ def _format_changelog(self, changelog):
if not changelog:
return changelog
new_changelog = []
- for line in changelog.strip().split('\n'):
+ for line in changelog.strip().split("\n"):
line = line.strip()
- if line[0] == '*':
- new_changelog.extend(['', line])
- elif line[0] == '-':
+ if line[0] == "*":
+ new_changelog.extend(["", line])
+ elif line[0] == "-":
new_changelog.append(line)
else:
- new_changelog.append(' ' + line)
+ new_changelog.append(" " + line)
# strip trailing newline inserted by first changelog entry
if not new_changelog[0]:
diff --git a/.venv3.10/Lib/distutils/command/build.py b/.venv3.10/Lib/distutils/command/build.py
index a86df0bc..1574f64a 100644
--- a/.venv3.10/Lib/distutils/command/build.py
+++ b/.venv3.10/Lib/distutils/command/build.py
@@ -2,7 +2,8 @@
Implements the Distutils 'build' command."""
-import sys, os
+import sys
+import os
from distutils.core import Command
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
@@ -18,43 +19,43 @@ class build(Command):
description = "build everything needed to install"
user_options = [
- ('build-base=', 'b',
+ ("build-base=", "b",
"base directory for build library"),
- ('build-purelib=', None,
+ ("build-purelib=", None,
"build directory for platform-neutral distributions"),
- ('build-platlib=', None,
+ ("build-platlib=", None,
"build directory for platform-specific distributions"),
- ('build-lib=', None,
+ ("build-lib=", None,
"build directory for all distribution (defaults to either " +
"build-purelib or build-platlib"),
- ('build-scripts=', None,
+ ("build-scripts=", None,
"build directory for scripts"),
- ('build-temp=', 't',
+ ("build-temp=", "t",
"temporary build directory"),
- ('plat-name=', 'p',
+ ("plat-name=", "p",
"platform name to build for, if supported "
"(default: %s)" % get_platform()),
- ('compiler=', 'c',
+ ("compiler=", "c",
"specify the compiler type"),
- ('parallel=', 'j',
+ ("parallel=", "j",
"number of parallel build jobs"),
- ('debug', 'g',
+ ("debug", "g",
"compile extensions and libraries with debugging information"),
- ('force', 'f',
+ ("force", "f",
"forcibly build everything (ignore file timestamps)"),
- ('executable=', 'e',
+ ("executable=", "e",
"specify final destination interpreter path (build.py)"),
]
- boolean_options = ['debug', 'force']
+ boolean_options = ["debug", "force"]
help_options = [
- ('help-compiler', None,
+ ("help-compiler", None,
"list available compilers", show_compilers),
]
def initialize_options(self):
- self.build_base = 'build'
+ self.build_base = "build"
# these are decided only after 'build_base' has its final value
# (unless overridden by the user or client)
self.build_purelib = None
@@ -76,7 +77,7 @@ def finalize_options(self):
# plat-name only supported for windows (other platforms are
# supported via ./configure flags, if at all). Avoid misleading
# other platforms.
- if os.name != 'nt':
+ if os.name != "nt":
raise DistutilsOptionError(
"--plat-name only supported on Windows (try "
"using './configure --help' on your platform)")
@@ -86,17 +87,17 @@ def finalize_options(self):
# Make it so Python 2.x and Python 2.x with --with-pydebug don't
# share the same build directories. Doing so confuses the build
# process for C modules
- if hasattr(sys, 'gettotalrefcount'):
- plat_specifier += '-pydebug'
+ if hasattr(sys, "gettotalrefcount"):
+ plat_specifier += "-pydebug"
# 'build_purelib' and 'build_platlib' just default to 'lib' and
# 'lib.' under the base build directory. We only use one of
# them for a given distribution, though --
if self.build_purelib is None:
- self.build_purelib = os.path.join(self.build_base, 'lib')
+ self.build_purelib = os.path.join(self.build_base, "lib")
if self.build_platlib is None:
self.build_platlib = os.path.join(self.build_base,
- 'lib' + plat_specifier)
+ "lib" + plat_specifier)
# 'build_lib' is the actual directory that we will use for this
# particular module distribution -- if user didn't supply it, pick
@@ -111,10 +112,10 @@ def finalize_options(self):
# "build/temp."
if self.build_temp is None:
self.build_temp = os.path.join(self.build_base,
- 'temp' + plat_specifier)
+ "temp" + plat_specifier)
if self.build_scripts is None:
self.build_scripts = os.path.join(self.build_base,
- 'scripts-%d.%d' % sys.version_info[:2])
+ "scripts-%d.%d" % sys.version_info[:2])
if self.executable is None and sys.executable:
self.executable = os.path.normpath(sys.executable)
@@ -150,8 +151,8 @@ def has_scripts(self):
return self.distribution.has_scripts()
- sub_commands = [('build_py', has_pure_modules),
- ('build_clib', has_c_libraries),
- ('build_ext', has_ext_modules),
- ('build_scripts', has_scripts),
+ sub_commands = [("build_py", has_pure_modules),
+ ("build_clib", has_c_libraries),
+ ("build_ext", has_ext_modules),
+ ("build_scripts", has_scripts),
]
diff --git a/.venv3.10/Lib/distutils/command/build_clib.py b/.venv3.10/Lib/distutils/command/build_clib.py
index 3e20ef23..ee0472ef 100644
--- a/.venv3.10/Lib/distutils/command/build_clib.py
+++ b/.venv3.10/Lib/distutils/command/build_clib.py
@@ -30,22 +30,22 @@ class build_clib(Command):
description = "build C/C++ libraries used by Python extensions"
user_options = [
- ('build-clib=', 'b',
+ ("build-clib=", "b",
"directory to build C/C++ libraries to"),
- ('build-temp=', 't',
+ ("build-temp=", "t",
"directory to put temporary build by-products"),
- ('debug', 'g',
+ ("debug", "g",
"compile with debugging information"),
- ('force', 'f',
+ ("force", "f",
"forcibly build everything (ignore file timestamps)"),
- ('compiler=', 'c',
+ ("compiler=", "c",
"specify the compiler type"),
]
- boolean_options = ['debug', 'force']
+ boolean_options = ["debug", "force"]
help_options = [
- ('help-compiler', None,
+ ("help-compiler", None,
"list available compilers", show_compilers),
]
@@ -71,12 +71,12 @@ def finalize_options(self):
# I think that C libraries are really just temporary build
# by-products, at least from the point of view of building Python
# extensions -- but I want to keep my options open.
- self.set_undefined_options('build',
- ('build_temp', 'build_clib'),
- ('build_temp', 'build_temp'),
- ('compiler', 'compiler'),
- ('debug', 'debug'),
- ('force', 'force'))
+ self.set_undefined_options("build",
+ ("build_temp", "build_clib"),
+ ("build_temp", "build_temp"),
+ ("compiler", "compiler"),
+ ("debug", "debug"),
+ ("force", "force"))
self.libraries = self.distribution.libraries
if self.libraries:
@@ -141,7 +141,7 @@ def check_library_list(self, libraries):
"first element of each tuple in 'libraries' "
"must be a string (the library name)")
- if '/' in name or (os.sep != '/' and os.sep in name):
+ if "/" in name or (os.sep != "/" and os.sep in name):
raise DistutilsSetupError("bad library name '%s': "
"may not contain directory separators" % lib[0])
@@ -167,7 +167,7 @@ def get_source_files(self):
self.check_library_list(self.libraries)
filenames = []
for (lib_name, build_info) in self.libraries:
- sources = build_info.get('sources')
+ sources = build_info.get("sources")
if sources is None or not isinstance(sources, (list, tuple)):
raise DistutilsSetupError(
"in 'libraries' option (library '%s'), "
@@ -180,7 +180,7 @@ def get_source_files(self):
def build_libraries(self, libraries):
for (lib_name, build_info) in libraries:
- sources = build_info.get('sources')
+ sources = build_info.get("sources")
if sources is None or not isinstance(sources, (list, tuple)):
raise DistutilsSetupError(
"in 'libraries' option (library '%s'), "
@@ -193,8 +193,8 @@ def build_libraries(self, libraries):
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
- macros = build_info.get('macros')
- include_dirs = build_info.get('include_dirs')
+ macros = build_info.get("macros")
+ include_dirs = build_info.get("include_dirs")
objects = self.compiler.compile(sources,
output_dir=self.build_temp,
macros=macros,
diff --git a/.venv3.10/Lib/distutils/command/build_ext.py b/.venv3.10/Lib/distutils/command/build_ext.py
index 1a9bd120..3467690c 100644
--- a/.venv3.10/Lib/distutils/command/build_ext.py
+++ b/.venv3.10/Lib/distutils/command/build_ext.py
@@ -22,7 +22,7 @@
# An extension name is just a dot-separated list of Python NAMEs (ie.
# the same as a fully-qualified module name).
extension_name_re = re.compile \
- (r'^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$')
+ (r"^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$")
def show_compilers ():
@@ -54,52 +54,52 @@ class build_ext(Command):
sep_by = " (separated by '%s')" % os.pathsep
user_options = [
- ('build-lib=', 'b',
+ ("build-lib=", "b",
"directory for compiled extension modules"),
- ('build-temp=', 't',
+ ("build-temp=", "t",
"directory for temporary files (build by-products)"),
- ('plat-name=', 'p',
+ ("plat-name=", "p",
"platform name to cross-compile for, if supported "
"(default: %s)" % get_platform()),
- ('inplace', 'i',
+ ("inplace", "i",
"ignore build-lib and put compiled extensions into the source " +
"directory alongside your pure Python modules"),
- ('include-dirs=', 'I',
+ ("include-dirs=", "I",
"list of directories to search for header files" + sep_by),
- ('define=', 'D',
+ ("define=", "D",
"C preprocessor macros to define"),
- ('undef=', 'U',
+ ("undef=", "U",
"C preprocessor macros to undefine"),
- ('libraries=', 'l',
+ ("libraries=", "l",
"external C libraries to link with"),
- ('library-dirs=', 'L',
+ ("library-dirs=", "L",
"directories to search for external C libraries" + sep_by),
- ('rpath=', 'R',
+ ("rpath=", "R",
"directories to search for shared C libraries at runtime"),
- ('link-objects=', 'O',
+ ("link-objects=", "O",
"extra explicit link objects to include in the link"),
- ('debug', 'g',
+ ("debug", "g",
"compile/link with debugging information"),
- ('force', 'f',
+ ("force", "f",
"forcibly build everything (ignore file timestamps)"),
- ('compiler=', 'c',
+ ("compiler=", "c",
"specify the compiler type"),
- ('parallel=', 'j',
+ ("parallel=", "j",
"number of parallel build jobs"),
- ('swig-cpp', None,
+ ("swig-cpp", None,
"make SWIG create C++ files (default is C)"),
- ('swig-opts=', None,
+ ("swig-opts=", None,
"list of SWIG command line options"),
- ('swig=', None,
+ ("swig=", None,
"path to the SWIG executable"),
- ('user', None,
+ ("user", None,
"add user include, library and rpath")
]
- boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user']
+ boolean_options = ["inplace", "debug", "force", "swig-cpp", "user"]
help_options = [
- ('help-compiler', None,
+ ("help-compiler", None,
"list available compilers", show_compilers),
]
@@ -130,14 +130,14 @@ def initialize_options(self):
def finalize_options(self):
from distutils import sysconfig
- self.set_undefined_options('build',
- ('build_lib', 'build_lib'),
- ('build_temp', 'build_temp'),
- ('compiler', 'compiler'),
- ('debug', 'debug'),
- ('force', 'force'),
- ('parallel', 'parallel'),
- ('plat_name', 'plat_name'),
+ self.set_undefined_options("build",
+ ("build_lib", "build_lib"),
+ ("build_temp", "build_temp"),
+ ("compiler", "compiler"),
+ ("debug", "debug"),
+ ("force", "force"),
+ ("parallel", "parallel"),
+ ("plat_name", "plat_name"),
)
if self.package is None:
@@ -157,7 +157,7 @@ def finalize_options(self):
# If in a virtualenv, add its include directory
# Issue 16116
if sys.exec_prefix != sys.base_exec_prefix:
- self.include_dirs.append(os.path.join(sys.exec_prefix, 'include'))
+ self.include_dirs.append(os.path.join(sys.exec_prefix, "include"))
# Put the Python "system" include dir at the end, so that
# any local include dirs take precedence.
@@ -166,8 +166,8 @@ def finalize_options(self):
self.include_dirs.extend(
plat_py_include.split(os.path.pathsep))
- self.ensure_string_list('libraries')
- self.ensure_string_list('link_objects')
+ self.ensure_string_list("libraries")
+ self.ensure_string_list("link_objects")
# Life is easier if we're not forever checking for None, so
# simplify these options to empty lists if unset
@@ -186,13 +186,13 @@ def finalize_options(self):
# for extensions under windows use different directories
# for Release and Debug builds.
# also Python's library directory must be appended to library_dirs
- if os.name == 'nt':
+ if os.name == "nt":
# the 'libs' directory is for binary installs - we assume that
# must be the *native* platform. But we don't really support
# cross-compiling via a binary install anyway, so we let it go.
- self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
+ self.library_dirs.append(os.path.join(sys.exec_prefix, "libs"))
if sys.base_exec_prefix != sys.prefix: # Issue 16116
- self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs'))
+ self.library_dirs.append(os.path.join(sys.base_exec_prefix, "libs"))
if self.debug:
self.build_temp = os.path.join(self.build_temp, "Debug")
else:
@@ -201,24 +201,24 @@ def finalize_options(self):
# Append the source distribution include and library directories,
# this allows distutils on windows to work in the source tree
self.include_dirs.append(os.path.dirname(get_config_h_filename()))
- _sys_home = getattr(sys, '_home', None)
+ _sys_home = getattr(sys, "_home", None)
if _sys_home:
self.library_dirs.append(_sys_home)
# Use the .lib files for the correct architecture
- if self.plat_name == 'win32':
- suffix = 'win32'
+ if self.plat_name == "win32":
+ suffix = "win32"
else:
# win-amd64
suffix = self.plat_name[4:]
- new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
+ new_lib = os.path.join(sys.exec_prefix, "PCbuild")
if suffix:
new_lib = os.path.join(new_lib, suffix)
self.library_dirs.append(new_lib)
# For extensions under Cygwin, Python's library directory must be
# appended to library_dirs
- if sys.platform[:6] == 'cygwin':
+ if sys.platform[:6] == "cygwin":
if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
# building third party extensions
self.library_dirs.append(os.path.join(sys.prefix, "lib",
@@ -226,18 +226,18 @@ def finalize_options(self):
"config"))
else:
# building python standard extensions
- self.library_dirs.append('.')
+ self.library_dirs.append(".")
# For building extensions with a shared Python library,
# Python's library directory must be appended to library_dirs
# See Issues: #1600860, #4366
- if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
+ if (sysconfig.get_config_var("Py_ENABLE_SHARED")):
if not sysconfig.python_build:
# building third party extensions
- self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
+ self.library_dirs.append(sysconfig.get_config_var("LIBDIR"))
else:
# building python standard extensions
- self.library_dirs.append('.')
+ self.library_dirs.append(".")
# The argument parsing will result in self.define being a string, but
# it has to be a list of 2-tuples. All the preprocessor symbols
@@ -245,19 +245,19 @@ def finalize_options(self):
# symbols can be separated with commas.
if self.define:
- defines = self.define.split(',')
- self.define = [(symbol, '1') for symbol in defines]
+ defines = self.define.split(",")
+ self.define = [(symbol, "1") for symbol in defines]
# The option for macros to undefine is also a string from the
# option parsing, but has to be a list. Multiple symbols can also
# be separated with commas here.
if self.undef:
- self.undef = self.undef.split(',')
+ self.undef = self.undef.split(",")
if self.swig_opts is None:
self.swig_opts = []
else:
- self.swig_opts = self.swig_opts.split(' ')
+ self.swig_opts = self.swig_opts.split(" ")
# Finally add the user include and library directories if requested
if self.user:
@@ -297,7 +297,7 @@ def run(self):
# directory where we put them is in the library search path for
# linking extensions.
if self.distribution.has_c_libraries():
- build_clib = self.get_finalized_command('build_clib')
+ build_clib = self.get_finalized_command("build_clib")
self.libraries.extend(build_clib.get_library_names() or [])
self.library_dirs.append(build_clib.build_clib)
@@ -311,7 +311,7 @@ def run(self):
# If we are cross-compiling, init the compiler now (if we are not
# cross-compiling, init would not hurt, but people may rely on
# late initialization of compiler even if they shouldn't...)
- if os.name == 'nt' and self.plat_name != get_platform():
+ if os.name == "nt" and self.plat_name != get_platform():
self.compiler.initialize(self.plat_name)
# And make sure that any compile/link-related options (which might
@@ -382,26 +382,26 @@ def check_extensions_list(self, extensions):
# OK, the (ext_name, build_info) dict is type-safe: convert it
# to an Extension instance.
- ext = Extension(ext_name, build_info['sources'])
+ ext = Extension(ext_name, build_info["sources"])
# Easy stuff: one-to-one mapping from dict elements to
# instance attributes.
- for key in ('include_dirs', 'library_dirs', 'libraries',
- 'extra_objects', 'extra_compile_args',
- 'extra_link_args'):
+ for key in ("include_dirs", "library_dirs", "libraries",
+ "extra_objects", "extra_compile_args",
+ "extra_link_args"):
val = build_info.get(key)
if val is not None:
setattr(ext, key, val)
# Medium-easy stuff: same syntax/semantics, different names.
- ext.runtime_library_dirs = build_info.get('rpath')
- if 'def_file' in build_info:
+ ext.runtime_library_dirs = build_info.get("rpath")
+ if "def_file" in build_info:
log.warn("'def_file' element of build info dict "
"no longer supported")
# Non-trivial stuff: 'macros' split into 'define_macros'
# and 'undef_macros'.
- macros = build_info.get('macros')
+ macros = build_info.get("macros")
if macros:
ext.define_macros = []
ext.undef_macros = []
@@ -495,7 +495,7 @@ def build_extension(self, ext):
ext_path = self.get_ext_fullpath(ext.name)
depends = sources + ext.depends
- if not (self.force or newer_group(depends, ext_path, 'newer')):
+ if not (self.force or newer_group(depends, ext_path, "newer")):
log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
@@ -577,16 +577,16 @@ def swig_sources(self, sources, extension):
if self.swig_cpp:
log.warn("--swig-cpp is deprecated - use --swig-opts=-c++")
- if self.swig_cpp or ('-c++' in self.swig_opts) or \
- ('-c++' in extension.swig_opts):
- target_ext = '.cpp'
+ if self.swig_cpp or ("-c++" in self.swig_opts) or \
+ ("-c++" in extension.swig_opts):
+ target_ext = ".cpp"
else:
- target_ext = '.c'
+ target_ext = ".c"
for source in sources:
(base, ext) = os.path.splitext(source)
if ext == ".i": # SWIG interface file
- new_sources.append(base + '_wrap' + target_ext)
+ new_sources.append(base + "_wrap" + target_ext)
swig_sources.append(source)
swig_targets[source] = new_sources[-1]
else:
@@ -644,7 +644,7 @@ def get_ext_fullpath(self, ext_name):
(inplace option).
"""
fullname = self.get_ext_fullname(ext_name)
- modpath = fullname.split('.')
+ modpath = fullname.split(".")
filename = self.get_ext_filename(modpath[-1])
if not self.inplace:
@@ -656,8 +656,8 @@ def get_ext_fullpath(self, ext_name):
# the inplace option requires to find the package directory
# using the build_py command for that
- package = '.'.join(modpath[0:-1])
- build_py = self.get_finalized_command('build_py')
+ package = ".".join(modpath[0:-1])
+ build_py = self.get_finalized_command("build_py")
package_dir = os.path.abspath(build_py.get_package_dir(package))
# returning
@@ -671,7 +671,7 @@ def get_ext_fullname(self, ext_name):
if self.package is None:
return ext_name
else:
- return self.package + '.' + ext_name
+ return self.package + "." + ext_name
def get_ext_filename(self, ext_name):
r"""Convert the name of an extension (eg. "foo.bar") into the name
@@ -679,8 +679,8 @@ def get_ext_filename(self, ext_name):
"foo\bar.pyd").
"""
from distutils.sysconfig import get_config_var
- ext_path = ext_name.split('.')
- ext_suffix = get_config_var('EXT_SUFFIX')
+ ext_path = ext_name.split(".")
+ ext_suffix = get_config_var("EXT_SUFFIX")
return os.path.join(*ext_path) + ext_suffix
def get_export_symbols(self, ext):
@@ -689,13 +689,13 @@ def get_export_symbols(self, ext):
provided, "PyInit_" + module_name. Only relevant on Windows, where
the .pyd file (DLL) must export the module "PyInit_" function.
"""
- suffix = '_' + ext.name.split('.')[-1]
+ suffix = "_" + ext.name.split(".")[-1]
try:
# Unicode module name support as defined in PEP-489
# https://www.python.org/dev/peps/pep-0489/#export-hook-name
- suffix.encode('ascii')
+ suffix.encode("ascii")
except UnicodeEncodeError:
- suffix = 'U' + suffix.encode('punycode').replace(b'-', b'_').decode('ascii')
+ suffix = "U" + suffix.encode("punycode").replace(b"-", b"_").decode("ascii")
initfunc_name = "PyInit" + suffix
if initfunc_name not in ext.export_symbols:
@@ -717,7 +717,7 @@ def get_libraries(self, ext):
if not isinstance(self.compiler, MSVCCompiler):
template = "python%d%d"
if self.debug:
- template = template + '_d'
+ template = template + "_d"
pythonlib = (template %
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
# don't extend ext.libraries, it may be shared with other
@@ -734,21 +734,21 @@ def get_libraries(self, ext):
# shared libraries are resolved at link time.
from distutils.sysconfig import get_config_var
link_libpython = False
- if get_config_var('Py_ENABLE_SHARED'):
+ if get_config_var("Py_ENABLE_SHARED"):
# A native build on an Android device or on Cygwin
- if hasattr(sys, 'getandroidapilevel'):
+ if hasattr(sys, "getandroidapilevel"):
link_libpython = True
- elif sys.platform == 'cygwin':
+ elif sys.platform == "cygwin":
link_libpython = True
- elif '_PYTHON_HOST_PLATFORM' in os.environ:
+ elif "_PYTHON_HOST_PLATFORM" in os.environ:
# We are cross-compiling for one of the relevant platforms
- if get_config_var('ANDROID_API_LEVEL') != 0:
+ if get_config_var("ANDROID_API_LEVEL") != 0:
link_libpython = True
- elif get_config_var('MACHDEP') == 'cygwin':
+ elif get_config_var("MACHDEP") == "cygwin":
link_libpython = True
if link_libpython:
- ldversion = get_config_var('LDVERSION')
- return ext.libraries + ['python' + ldversion]
+ ldversion = get_config_var("LDVERSION")
+ return ext.libraries + ["python" + ldversion]
return ext.libraries
diff --git a/.venv3.10/Lib/distutils/command/build_py.py b/.venv3.10/Lib/distutils/command/build_py.py
index edc2171c..8c8b8c62 100644
--- a/.venv3.10/Lib/distutils/command/build_py.py
+++ b/.venv3.10/Lib/distutils/command/build_py.py
@@ -14,20 +14,20 @@
class build_py (Command):
- description = "\"build\" pure Python modules (copy to build directory)"
+ description = '"build" pure Python modules (copy to build directory)'
user_options = [
- ('build-lib=', 'd', "directory to \"build\" (copy) to"),
- ('compile', 'c', "compile .py to .pyc"),
- ('no-compile', None, "don't compile .py files [default]"),
- ('optimize=', 'O',
- "also compile with optimization: -O1 for \"python -O\", "
- "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
- ('force', 'f', "forcibly build everything (ignore file timestamps)"),
+ ("build-lib=", "d", 'directory to "build" (copy) to'),
+ ("compile", "c", "compile .py to .pyc"),
+ ("no-compile", None, "don't compile .py files [default]"),
+ ("optimize=", "O",
+ 'also compile with optimization: -O1 for "python -O", '
+ '-O2 for "python -OO", and -O0 to disable [default: -O0]'),
+ ("force", "f", "forcibly build everything (ignore file timestamps)"),
]
- boolean_options = ['compile', 'force']
- negative_opt = {'no-compile' : 'compile'}
+ boolean_options = ["compile", "force"]
+ negative_opt = {"no-compile" : "compile"}
def initialize_options(self):
self.build_lib = None
@@ -40,9 +40,9 @@ def initialize_options(self):
self.force = None
def finalize_options(self):
- self.set_undefined_options('build',
- ('build_lib', 'build_lib'),
- ('force', 'force'))
+ self.set_undefined_options("build",
+ ("build_lib", "build_lib"),
+ ("force", "force"))
# Get the distribution options that are aliases for build_py
# options -- list of packages and list of modules.
@@ -104,7 +104,7 @@ def get_data_files(self):
src_dir = self.get_package_dir(package)
# Compute package build directory
- build_dir = os.path.join(*([self.build_lib] + package.split('.')))
+ build_dir = os.path.join(*([self.build_lib] + package.split(".")))
# Length of path to strip from found files
plen = 0
@@ -120,7 +120,7 @@ def get_data_files(self):
def find_data_files(self, package, src_dir):
"""Return filenames for package's data files in 'src_dir'"""
- globs = (self.package_data.get('', [])
+ globs = (self.package_data.get("", [])
+ self.package_data.get(package, []))
files = []
for pattern in globs:
@@ -145,18 +145,18 @@ def get_package_dir(self, package):
"""Return the directory, relative to the top of the source
distribution, where package 'package' should be found
(at least according to the 'package_dir' option, if any)."""
- path = package.split('.')
+ path = package.split(".")
if not self.package_dir:
if path:
return os.path.join(*path)
else:
- return ''
+ return ""
else:
tail = []
while path:
try:
- pdir = self.package_dir['.'.join(path)]
+ pdir = self.package_dir[".".join(path)]
except KeyError:
tail.insert(0, path[-1])
del path[-1]
@@ -171,14 +171,14 @@ def get_package_dir(self, package):
# package_dir at all, as we just use the directory implied
# by 'tail' (which should be the same as the original value
# of 'path' at this point).
- pdir = self.package_dir.get('')
+ pdir = self.package_dir.get("")
if pdir is not None:
tail.insert(0, pdir)
if tail:
return os.path.join(*tail)
else:
- return ''
+ return ""
def check_package(self, package, package_dir):
# Empty dir name means current directory, which we can probably
@@ -254,8 +254,8 @@ def find_modules(self):
# string or empty list, depending on context). Differences:
# - don't check for __init__.py in directory for empty package
for module in self.py_modules:
- path = module.split('.')
- package = '.'.join(path[0:-1])
+ path = module.split(".")
+ package = ".".join(path[0:-1])
module_base = path[-1]
try:
@@ -308,13 +308,13 @@ def get_outputs(self, include_bytecode=1):
modules = self.find_all_modules()
outputs = []
for (package, module, module_file) in modules:
- package = package.split('.')
+ package = package.split(".")
filename = self.get_module_outfile(self.build_lib, package, module)
outputs.append(filename)
if include_bytecode:
if self.compile:
outputs.append(importlib.util.cache_from_source(
- filename, optimization=''))
+ filename, optimization=""))
if self.optimize > 0:
outputs.append(importlib.util.cache_from_source(
filename, optimization=self.optimize))
@@ -329,7 +329,7 @@ def get_outputs(self, include_bytecode=1):
def build_module(self, module, module_file, package):
if isinstance(package, str):
- package = package.split('.')
+ package = package.split(".")
elif not isinstance(package, (list, tuple)):
raise TypeError(
"'package' must be a string (dot-separated), list, or tuple")
@@ -373,7 +373,7 @@ def build_packages(self):
def byte_compile(self, files):
if sys.dont_write_bytecode:
- self.warn('byte-compiling is disabled, skipping.')
+ self.warn("byte-compiling is disabled, skipping.")
return
from distutils.util import byte_compile
diff --git a/.venv3.10/Lib/distutils/command/build_scripts.py b/.venv3.10/Lib/distutils/command/build_scripts.py
index ccc70e64..5c72b530 100644
--- a/.venv3.10/Lib/distutils/command/build_scripts.py
+++ b/.venv3.10/Lib/distutils/command/build_scripts.py
@@ -2,7 +2,8 @@
Implements the Distutils 'build_scripts' command."""
-import os, re
+import os
+import re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
@@ -12,19 +13,19 @@
import tokenize
# check if Python is called on the first line with this expression
-first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$')
+first_line_re = re.compile(b"^#!.*python[0-9.]*([ \t].*)?$")
class build_scripts(Command):
- description = "\"build\" scripts (copy and fixup #! line)"
+ description = '"build" scripts (copy and fixup #! line)'
user_options = [
- ('build-dir=', 'd', "directory to \"build\" (copy) to"),
- ('force', 'f', "forcibly build everything (ignore file timestamps"),
- ('executable=', 'e', "specify final destination interpreter path"),
+ ("build-dir=", "d", 'directory to "build" (copy) to'),
+ ("force", "f", "forcibly build everything (ignore file timestamps"),
+ ("executable=", "e", "specify final destination interpreter path"),
]
- boolean_options = ['force']
+ boolean_options = ["force"]
def initialize_options(self):
@@ -35,10 +36,10 @@ def initialize_options(self):
self.outfiles = None
def finalize_options(self):
- self.set_undefined_options('build',
- ('build_scripts', 'build_dir'),
- ('force', 'force'),
- ('executable', 'executable'))
+ self.set_undefined_options("build",
+ ("build_scripts", "build_dir"),
+ ("force", "force"),
+ ("executable", "executable"))
self.scripts = self.distribution.scripts
def get_source_files(self):
@@ -89,7 +90,7 @@ def copy_scripts(self):
match = first_line_re.match(first_line)
if match:
adjust = True
- post_interp = match.group(1) or b''
+ post_interp = match.group(1) or b""
if adjust:
log.info("copying and adjusting %s -> %s", script,
@@ -111,7 +112,7 @@ def copy_scripts(self):
# written before. So the shebang has to be decodable from
# UTF-8.
try:
- shebang.decode('utf-8')
+ shebang.decode("utf-8")
except UnicodeDecodeError:
raise ValueError(
"The shebang ({!r}) is not decodable "
@@ -137,7 +138,7 @@ def copy_scripts(self):
updated_files.append(outfile)
self.copy_file(script, outfile)
- if os.name == 'posix':
+ if os.name == "posix":
for file in outfiles:
if self.dry_run:
log.info("changing mode of %s", file)
diff --git a/.venv3.10/Lib/distutils/command/check.py b/.venv3.10/Lib/distutils/command/check.py
index 73a30f3a..6962a588 100644
--- a/.venv3.10/Lib/distutils/command/check.py
+++ b/.venv3.10/Lib/distutils/command/check.py
@@ -15,7 +15,7 @@
class SilentReporter(Reporter):
def __init__(self, source, report_level, halt_level, stream=None,
- debug=0, encoding='ascii', error_handler='replace'):
+ debug=0, encoding="ascii", error_handler="replace"):
self.messages = []
Reporter.__init__(self, source, report_level, halt_level, stream,
debug, encoding, error_handler)
@@ -36,14 +36,14 @@ class check(Command):
"""This command checks the meta-data of the package.
"""
description = ("perform some checks on the package")
- user_options = [('metadata', 'm', 'Verify meta-data'),
- ('restructuredtext', 'r',
- ('Checks if long string meta-data syntax '
- 'are reStructuredText-compliant')),
- ('strict', 's',
- 'Will exit with an error if a check fails')]
+ user_options = [("metadata", "m", "Verify meta-data"),
+ ("restructuredtext", "r",
+ ("Checks if long string meta-data syntax "
+ "are reStructuredText-compliant")),
+ ("strict", "s",
+ "Will exit with an error if a check fails")]
- boolean_options = ['metadata', 'restructuredtext', 'strict']
+ boolean_options = ["metadata", "restructuredtext", "strict"]
def initialize_options(self):
"""Sets default values for options."""
@@ -69,12 +69,12 @@ def run(self):
if HAS_DOCUTILS:
self.check_restructuredtext()
elif self.strict:
- raise DistutilsSetupError('The docutils package is needed.')
+ raise DistutilsSetupError("The docutils package is needed.")
# let's raise an error in strict mode, if we have at least
# one warning
if self.strict and self._warnings > 0:
- raise DistutilsSetupError('Please correct your package.')
+ raise DistutilsSetupError("Please correct your package.")
def check_metadata(self):
"""Ensures that all required elements of meta-data are supplied.
@@ -90,12 +90,12 @@ def check_metadata(self):
metadata = self.distribution.metadata
missing = []
- for attr in ('name', 'version', 'url'):
+ for attr in ("name", "version", "url"):
if not (hasattr(metadata, attr) and getattr(metadata, attr)):
missing.append(attr)
if missing:
- self.warn("missing required meta-data: %s" % ', '.join(missing))
+ self.warn("missing required meta-data: %s" % ", ".join(missing))
if metadata.author:
if not metadata.author_email:
self.warn("missing meta-data: if 'author' supplied, " +
@@ -113,17 +113,17 @@ def check_restructuredtext(self):
"""Checks if the long string fields are reST-compliant."""
data = self.distribution.get_long_description()
for warning in self._check_rst_data(data):
- line = warning[-1].get('line')
+ line = warning[-1].get("line")
if line is None:
warning = warning[1]
else:
- warning = '%s (line %s)' % (warning[1], line)
+ warning = "%s (line %s)" % (warning[1], line)
self.warn(warning)
def _check_rst_data(self, data):
"""Returns warnings when the provided data doesn't compile."""
# the include and csv_table directives need this to be a path
- source_path = self.distribution.script_name or 'setup.py'
+ source_path = self.distribution.script_name or "setup.py"
parser = Parser()
settings = frontend.OptionParser(components=(Parser,)).get_default_values()
settings.tab_width = 4
@@ -143,6 +143,6 @@ def _check_rst_data(self, data):
parser.parse(data, document)
except AttributeError as e:
reporter.messages.append(
- (-1, 'Could not finish the parsing: %s.' % e, '', {}))
+ (-1, "Could not finish the parsing: %s." % e, "", {}))
return reporter.messages
diff --git a/.venv3.10/Lib/distutils/command/clean.py b/.venv3.10/Lib/distutils/command/clean.py
index 0cb27016..4bbb08d1 100644
--- a/.venv3.10/Lib/distutils/command/clean.py
+++ b/.venv3.10/Lib/distutils/command/clean.py
@@ -13,21 +13,21 @@ class clean(Command):
description = "clean up temporary files from 'build' command"
user_options = [
- ('build-base=', 'b',
+ ("build-base=", "b",
"base build directory (default: 'build.build-base')"),
- ('build-lib=', None,
+ ("build-lib=", None,
"build directory for all modules (default: 'build.build-lib')"),
- ('build-temp=', 't',
+ ("build-temp=", "t",
"temporary build directory (default: 'build.build-temp')"),
- ('build-scripts=', None,
+ ("build-scripts=", None,
"build directory for scripts (default: 'build.build-scripts')"),
- ('bdist-base=', None,
+ ("bdist-base=", None,
"temporary directory for built distributions"),
- ('all', 'a',
+ ("all", "a",
"remove all build output, not just temporary by-products")
]
- boolean_options = ['all']
+ boolean_options = ["all"]
def initialize_options(self):
self.build_base = None
@@ -38,13 +38,13 @@ def initialize_options(self):
self.all = None
def finalize_options(self):
- self.set_undefined_options('build',
- ('build_base', 'build_base'),
- ('build_lib', 'build_lib'),
- ('build_scripts', 'build_scripts'),
- ('build_temp', 'build_temp'))
- self.set_undefined_options('bdist',
- ('bdist_base', 'bdist_base'))
+ self.set_undefined_options("build",
+ ("build_base", "build_base"),
+ ("build_lib", "build_lib"),
+ ("build_scripts", "build_scripts"),
+ ("build_temp", "build_temp"))
+ self.set_undefined_options("bdist",
+ ("bdist_base", "bdist_base"))
def run(self):
# remove the build/temp. directory (unless it's already
diff --git a/.venv3.10/Lib/distutils/command/config.py b/.venv3.10/Lib/distutils/command/config.py
index aeda408e..a50e046c 100644
--- a/.venv3.10/Lib/distutils/command/config.py
+++ b/.venv3.10/Lib/distutils/command/config.py
@@ -9,7 +9,8 @@
this header file lives".
"""
-import os, re
+import os
+import re
from distutils.core import Command
from distutils.errors import DistutilsExecError
@@ -23,24 +24,24 @@ class config(Command):
description = "prepare to build"
user_options = [
- ('compiler=', None,
+ ("compiler=", None,
"specify the compiler type"),
- ('cc=', None,
+ ("cc=", None,
"specify the compiler executable"),
- ('include-dirs=', 'I',
+ ("include-dirs=", "I",
"list of directories to search for header files"),
- ('define=', 'D',
+ ("define=", "D",
"C preprocessor macros to define"),
- ('undef=', 'U',
+ ("undef=", "U",
"C preprocessor macros to undefine"),
- ('libraries=', 'l',
+ ("libraries=", "l",
"external C libraries to link with"),
- ('library-dirs=', 'L',
+ ("library-dirs=", "L",
"directories to search for external C libraries"),
- ('noisy', None,
+ ("noisy", None,
"show every action (compile, link, run, ...) taken"),
- ('dump-source', None,
+ ("dump-source", None,
"dump generated source files before attempting to compile them"),
]
@@ -151,7 +152,7 @@ def _clean(self, *filenames):
if not filenames:
filenames = self.temp_files
self.temp_files = []
- log.info("removing: %s", ' '.join(filenames))
+ log.info("removing: %s", " ".join(filenames))
for filename in filenames:
try:
os.remove(filename)
@@ -206,7 +207,7 @@ def search_cpp(self, pattern, body=None, headers=None, include_dirs=None,
match = False
while True:
line = file.readline()
- if line == '':
+ if line == "":
break
if pattern.search(line):
match = True
@@ -334,7 +335,7 @@ def dump_file(filename, head=None):
If head is not None, will be dumped before the file content.
"""
if head is None:
- log.info('%s', filename)
+ log.info("%s", filename)
else:
log.info(head)
file = open(filename)
diff --git a/.venv3.10/Lib/distutils/command/install.py b/.venv3.10/Lib/distutils/command/install.py
index 01d5331a..ce9fa6b7 100644
--- a/.venv3.10/Lib/distutils/command/install.py
+++ b/.venv3.10/Lib/distutils/command/install.py
@@ -25,7 +25,7 @@
# The keys to an installation scheme; if any new types of files are to be
# installed, be sure to add an entry to every scheme in
# sysconfig._INSTALL_SCHEMES, and to SCHEME_KEYS here.
-SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data')
+SCHEME_KEYS = ("purelib", "platlib", "headers", "scripts", "data")
# The following code provides backward-compatible INSTALL_SCHEMES
# while making the sysconfig module the single point of truth.
@@ -48,7 +48,7 @@
# building CPython)
# - Install .h files to 'include'
# When 'headers' is missing, fall back to 'include'
- sys_key = 'include'
+ sys_key = "include"
INSTALL_SCHEMES[distutils_scheme_name][key] = sys_scheme[sys_key]
# Transformation to different template format
@@ -69,21 +69,21 @@
# than the one in sysconfig, but because both depend on the site module,
# the outcomes should be the same.
if HAS_USER_SITE:
- INSTALL_SCHEMES['nt_user'] = {
- 'purelib': '$usersite',
- 'platlib': '$usersite',
- 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
- 'scripts': '$userbase/Python$py_version_nodot/Scripts',
- 'data' : '$userbase',
+ INSTALL_SCHEMES["nt_user"] = {
+ "purelib": "$usersite",
+ "platlib": "$usersite",
+ "headers": "$userbase/Python$py_version_nodot/Include/$dist_name",
+ "scripts": "$userbase/Python$py_version_nodot/Scripts",
+ "data" : "$userbase",
}
- INSTALL_SCHEMES['unix_user'] = {
- 'purelib': '$usersite',
- 'platlib': '$usersite',
- 'headers':
- '$userbase/include/python$py_version_short$abiflags/$dist_name',
- 'scripts': '$userbase/bin',
- 'data' : '$userbase',
+ INSTALL_SCHEMES["unix_user"] = {
+ "purelib": "$usersite",
+ "platlib": "$usersite",
+ "headers":
+ "$userbase/include/python$py_version_short$abiflags/$dist_name",
+ "scripts": "$userbase/bin",
+ "data" : "$userbase",
}
@@ -93,51 +93,51 @@ class install(Command):
user_options = [
# Select installation scheme and set base director(y|ies)
- ('prefix=', None,
+ ("prefix=", None,
"installation prefix"),
- ('exec-prefix=', None,
+ ("exec-prefix=", None,
"(Unix only) prefix for platform-specific files"),
- ('home=', None,
+ ("home=", None,
"(Unix only) home directory to install under"),
# Or, just set the base director(y|ies)
- ('install-base=', None,
+ ("install-base=", None,
"base installation directory (instead of --prefix or --home)"),
- ('install-platbase=', None,
+ ("install-platbase=", None,
"base installation directory for platform-specific files " +
"(instead of --exec-prefix or --home)"),
- ('root=', None,
+ ("root=", None,
"install everything relative to this alternate root directory"),
# Or, explicitly set the installation scheme
- ('install-purelib=', None,
+ ("install-purelib=", None,
"installation directory for pure Python module distributions"),
- ('install-platlib=', None,
+ ("install-platlib=", None,
"installation directory for non-pure module distributions"),
- ('install-lib=', None,
+ ("install-lib=", None,
"installation directory for all module distributions " +
"(overrides --install-purelib and --install-platlib)"),
- ('install-headers=', None,
+ ("install-headers=", None,
"installation directory for C/C++ headers"),
- ('install-scripts=', None,
+ ("install-scripts=", None,
"installation directory for Python scripts"),
- ('install-data=', None,
+ ("install-data=", None,
"installation directory for data files"),
# Byte-compilation options -- see install_lib.py for details, as
# these are duplicated from there (but only install_lib does
# anything with them).
- ('compile', 'c', "compile .py to .pyc [default]"),
- ('no-compile', None, "don't compile .py files"),
- ('optimize=', 'O',
- "also compile with optimization: -O1 for \"python -O\", "
- "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
+ ("compile", "c", "compile .py to .pyc [default]"),
+ ("no-compile", None, "don't compile .py files"),
+ ("optimize=", "O",
+ 'also compile with optimization: -O1 for "python -O", '
+ '-O2 for "python -OO", and -O0 to disable [default: -O0]'),
# Miscellaneous control options
- ('force', 'f',
+ ("force", "f",
"force installation (overwrite any existing files)"),
- ('skip-build', None,
+ ("skip-build", None,
"skip rebuilding everything (for testing/debugging)"),
# Where to install documentation (eventually!)
@@ -146,18 +146,18 @@ class install(Command):
#('install-html=', None, "directory for HTML documentation"),
#('install-info=', None, "directory for GNU info files"),
- ('record=', None,
+ ("record=", None,
"filename in which to record list of installed files"),
]
- boolean_options = ['compile', 'force', 'skip-build']
+ boolean_options = ["compile", "force", "skip-build"]
if HAS_USER_SITE:
- user_options.append(('user', None,
+ user_options.append(("user", None,
"install in user site-package '%s'" % USER_SITE))
- boolean_options.append('user')
+ boolean_options.append("user")
- negative_opt = {'no-compile' : 'compile'}
+ negative_opt = {"no-compile" : "compile"}
def initialize_options(self):
@@ -286,7 +286,7 @@ def finalize_options(self):
self.dump_dirs("pre-finalize_{unix,other}")
- if os.name == 'posix':
+ if os.name == "posix":
self.finalize_unix()
else:
self.finalize_other()
@@ -299,32 +299,32 @@ def finalize_options(self):
# about needing recursive variable expansion (shudder).
py_version = sys.version.split()[0]
- (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
+ (prefix, exec_prefix) = get_config_vars("prefix", "exec_prefix")
try:
abiflags = sys.abiflags
except AttributeError:
# sys.abiflags may not be defined on all platforms.
- abiflags = ''
- self.config_vars = {'dist_name': self.distribution.get_name(),
- 'dist_version': self.distribution.get_version(),
- 'dist_fullname': self.distribution.get_fullname(),
- 'py_version': py_version,
- 'py_version_short': '%d.%d' % sys.version_info[:2],
- 'py_version_nodot': '%d%d' % sys.version_info[:2],
- 'sys_prefix': prefix,
- 'prefix': prefix,
- 'sys_exec_prefix': exec_prefix,
- 'exec_prefix': exec_prefix,
- 'abiflags': abiflags,
- 'platlibdir': sys.platlibdir,
+ abiflags = ""
+ self.config_vars = {"dist_name": self.distribution.get_name(),
+ "dist_version": self.distribution.get_version(),
+ "dist_fullname": self.distribution.get_fullname(),
+ "py_version": py_version,
+ "py_version_short": "%d.%d" % sys.version_info[:2],
+ "py_version_nodot": "%d%d" % sys.version_info[:2],
+ "sys_prefix": prefix,
+ "prefix": prefix,
+ "sys_exec_prefix": exec_prefix,
+ "exec_prefix": exec_prefix,
+ "abiflags": abiflags,
+ "platlibdir": sys.platlibdir,
}
if HAS_USER_SITE:
- self.config_vars['userbase'] = self.install_userbase
- self.config_vars['usersite'] = self.install_usersite
+ self.config_vars["userbase"] = self.install_userbase
+ self.config_vars["usersite"] = self.install_usersite
if sysconfig.is_python_build(True):
- self.config_vars['srcdir'] = sysconfig.get_config_var('srcdir')
+ self.config_vars["srcdir"] = sysconfig.get_config_var("srcdir")
self.expand_basedirs()
@@ -332,8 +332,8 @@ def finalize_options(self):
# Now define config vars for the base directories so we can expand
# everything else.
- self.config_vars['base'] = self.install_base
- self.config_vars['platbase'] = self.install_platbase
+ self.config_vars["base"] = self.install_base
+ self.config_vars["platbase"] = self.install_platbase
if DEBUG:
from pprint import pprint
@@ -363,10 +363,10 @@ def finalize_options(self):
# Convert directories from Unix /-separated syntax to the local
# convention.
- self.convert_paths('lib', 'purelib', 'platlib',
- 'scripts', 'data', 'headers')
+ self.convert_paths("lib", "purelib", "platlib",
+ "scripts", "data", "headers")
if HAS_USER_SITE:
- self.convert_paths('userbase', 'usersite')
+ self.convert_paths("userbase", "usersite")
# Deprecated
# Well, we're not actually fully completely finalized yet: we still
@@ -380,15 +380,15 @@ def finalize_options(self):
# If a new root directory was supplied, make all the installation
# dirs relative to it.
if self.root is not None:
- self.change_roots('libbase', 'lib', 'purelib', 'platlib',
- 'scripts', 'data', 'headers')
+ self.change_roots("libbase", "lib", "purelib", "platlib",
+ "scripts", "data", "headers")
self.dump_dirs("after prepending root")
# Find out the build directories, ie. where to install from.
- self.set_undefined_options('build',
- ('build_base', 'build_base'),
- ('build_lib', 'build_lib'))
+ self.set_undefined_options("build",
+ ("build_base", "build_base"),
+ ("build_lib", "build_lib"))
# Punt on doc directories for now -- after all, we're punting on
# documentation completely!
@@ -479,7 +479,7 @@ def select_scheme(self, name):
# it's the caller's problem if they supply a bad name!
scheme = INSTALL_SCHEMES[name]
for key in SCHEME_KEYS:
- attrname = 'install_' + key
+ attrname = "install_" + key
if getattr(self, attrname) is None:
setattr(self, attrname, scheme[key])
@@ -487,7 +487,7 @@ def _expand_attrs(self, attrs):
for attr in attrs:
val = getattr(self, attr)
if val is not None:
- if os.name == 'posix' or os.name == 'nt':
+ if os.name == "posix" or os.name == "nt":
val = os.path.expanduser(val)
val = subst_vars(val, self.config_vars)
setattr(self, attr, val)
@@ -495,13 +495,13 @@ def _expand_attrs(self, attrs):
def expand_basedirs(self):
"""Calls `os.path.expanduser` on install_base, install_platbase and
root."""
- self._expand_attrs(['install_base', 'install_platbase', 'root'])
+ self._expand_attrs(["install_base", "install_platbase", "root"])
def expand_dirs(self):
"""Calls `os.path.expanduser` on install dirs."""
- self._expand_attrs(['install_purelib', 'install_platlib',
- 'install_lib', 'install_headers',
- 'install_scripts', 'install_data',])
+ self._expand_attrs(["install_purelib", "install_platlib",
+ "install_lib", "install_headers",
+ "install_scripts", "install_data",])
def convert_paths(self, *names):
"""Call `convert_path` over `names`."""
@@ -520,7 +520,7 @@ def handle_extra_path(self):
"See issue27919 for details."
)
if isinstance(self.extra_path, str):
- self.extra_path = self.extra_path.split(',')
+ self.extra_path = self.extra_path.split(",")
if len(self.extra_path) == 1:
path_file = extra_dirs = self.extra_path[0]
@@ -536,7 +536,7 @@ def handle_extra_path(self):
extra_dirs = convert_path(extra_dirs)
else:
path_file = None
- extra_dirs = ''
+ extra_dirs = ""
# XXX should we warn if path_file and not extra_dirs? (in which
# case the path file would be harmless but pointless)
@@ -565,9 +565,9 @@ def run(self):
"""Runs the command."""
# Obviously have to build before we can install
if not self.skip_build:
- self.run_command('build')
+ self.run_command("build")
# If we built for any other platform, we can't install.
- build_plat = self.distribution.get_command_obj('build').plat_name
+ build_plat = self.distribution.get_command_obj("build").plat_name
# check warn_dir - it is a clue that the 'install' is happening
# internally, and not to sys.path, so we don't check the platform
# matches what we are running.
@@ -671,9 +671,9 @@ def has_data(self):
# 'sub_commands': a list of commands this command might have to run to
# get its work done. See cmd.py for more info.
- sub_commands = [('install_lib', has_lib),
- ('install_headers', has_headers),
- ('install_scripts', has_scripts),
- ('install_data', has_data),
- ('install_egg_info', lambda self:True),
+ sub_commands = [("install_lib", has_lib),
+ ("install_headers", has_headers),
+ ("install_scripts", has_scripts),
+ ("install_data", has_data),
+ ("install_egg_info", lambda self:True),
]
diff --git a/.venv3.10/Lib/distutils/command/install_data.py b/.venv3.10/Lib/distutils/command/install_data.py
index 947cd76a..71e97689 100644
--- a/.venv3.10/Lib/distutils/command/install_data.py
+++ b/.venv3.10/Lib/distutils/command/install_data.py
@@ -14,15 +14,15 @@ class install_data(Command):
description = "install data files"
user_options = [
- ('install-dir=', 'd',
+ ("install-dir=", "d",
"base directory for installing data files "
"(default: installation base dir)"),
- ('root=', None,
+ ("root=", None,
"install everything relative to this alternate root directory"),
- ('force', 'f', "force installation (overwrite existing files)"),
+ ("force", "f", "force installation (overwrite existing files)"),
]
- boolean_options = ['force']
+ boolean_options = ["force"]
def initialize_options(self):
self.install_dir = None
@@ -33,10 +33,10 @@ def initialize_options(self):
self.warn_dir = 1
def finalize_options(self):
- self.set_undefined_options('install',
- ('install_data', 'install_dir'),
- ('root', 'root'),
- ('force', 'force'),
+ self.set_undefined_options("install",
+ ("install_data", "install_dir"),
+ ("root", "root"),
+ ("force", "force"),
)
def run(self):
diff --git a/.venv3.10/Lib/distutils/command/install_egg_info.py b/.venv3.10/Lib/distutils/command/install_egg_info.py
index 0ddc7367..5df3d108 100644
--- a/.venv3.10/Lib/distutils/command/install_egg_info.py
+++ b/.venv3.10/Lib/distutils/command/install_egg_info.py
@@ -6,21 +6,23 @@
from distutils.cmd import Command
from distutils import log, dir_util
-import os, sys, re
+import os
+import sys
+import re
class install_egg_info(Command):
"""Install an .egg-info file for the package"""
description = "Install package's PKG-INFO metadata as an .egg-info file"
user_options = [
- ('install-dir=', 'd', "directory to install to"),
+ ("install-dir=", "d", "directory to install to"),
]
def initialize_options(self):
self.install_dir = None
def finalize_options(self):
- self.set_undefined_options('install_lib',('install_dir','install_dir'))
+ self.set_undefined_options("install_lib",("install_dir","install_dir"))
basename = "%s-%s-py%d.%d.egg-info" % (
to_filename(safe_name(self.distribution.get_name())),
to_filename(safe_version(self.distribution.get_version())),
@@ -40,7 +42,7 @@ def run(self):
"Creating "+self.install_dir)
log.info("Writing %s", target)
if not self.dry_run:
- with open(target, 'w', encoding='UTF-8') as f:
+ with open(target, "w", encoding="UTF-8") as f:
self.distribution.metadata.write_pkg_file(f)
def get_outputs(self):
@@ -56,7 +58,7 @@ def safe_name(name):
Any runs of non-alphanumeric/. characters are replaced with a single '-'.
"""
- return re.sub('[^A-Za-z0-9.]+', '-', name)
+ return re.sub("[^A-Za-z0-9.]+", "-", name)
def safe_version(version):
@@ -65,8 +67,8 @@ def safe_version(version):
Spaces become dots, and all other non-alphanumeric characters become
dashes, with runs of multiple dashes condensed to a single dash.
"""
- version = version.replace(' ','.')
- return re.sub('[^A-Za-z0-9.]+', '-', version)
+ version = version.replace(" ",".")
+ return re.sub("[^A-Za-z0-9.]+", "-", version)
def to_filename(name):
@@ -74,4 +76,4 @@ def to_filename(name):
Any '-' characters are currently replaced with '_'.
"""
- return name.replace('-','_')
+ return name.replace("-","_")
diff --git a/.venv3.10/Lib/distutils/command/install_headers.py b/.venv3.10/Lib/distutils/command/install_headers.py
index 9bb0b18d..efa8fd6b 100644
--- a/.venv3.10/Lib/distutils/command/install_headers.py
+++ b/.venv3.10/Lib/distutils/command/install_headers.py
@@ -11,13 +11,13 @@ class install_headers(Command):
description = "install C/C++ header files"
- user_options = [('install-dir=', 'd',
+ user_options = [("install-dir=", "d",
"directory to install header files to"),
- ('force', 'f',
+ ("force", "f",
"force installation (overwrite existing files)"),
]
- boolean_options = ['force']
+ boolean_options = ["force"]
def initialize_options(self):
self.install_dir = None
@@ -25,9 +25,9 @@ def initialize_options(self):
self.outfiles = []
def finalize_options(self):
- self.set_undefined_options('install',
- ('install_headers', 'install_dir'),
- ('force', 'force'))
+ self.set_undefined_options("install",
+ ("install_headers", "install_dir"),
+ ("force", "force"))
def run(self):
diff --git a/.venv3.10/Lib/distutils/command/install_lib.py b/.venv3.10/Lib/distutils/command/install_lib.py
index 6154cf09..977db8a9 100644
--- a/.venv3.10/Lib/distutils/command/install_lib.py
+++ b/.venv3.10/Lib/distutils/command/install_lib.py
@@ -34,19 +34,19 @@ class install_lib(Command):
# optimization to use.
user_options = [
- ('install-dir=', 'd', "directory to install to"),
- ('build-dir=','b', "build directory (where to install from)"),
- ('force', 'f', "force installation (overwrite existing files)"),
- ('compile', 'c', "compile .py to .pyc [default]"),
- ('no-compile', None, "don't compile .py files"),
- ('optimize=', 'O',
- "also compile with optimization: -O1 for \"python -O\", "
- "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
- ('skip-build', None, "skip the build steps"),
+ ("install-dir=", "d", "directory to install to"),
+ ("build-dir=","b", "build directory (where to install from)"),
+ ("force", "f", "force installation (overwrite existing files)"),
+ ("compile", "c", "compile .py to .pyc [default]"),
+ ("no-compile", None, "don't compile .py files"),
+ ("optimize=", "O",
+ 'also compile with optimization: -O1 for "python -O", '
+ '-O2 for "python -OO", and -O0 to disable [default: -O0]'),
+ ("skip-build", None, "skip the build steps"),
]
- boolean_options = ['force', 'compile', 'skip-build']
- negative_opt = {'no-compile' : 'compile'}
+ boolean_options = ["force", "compile", "skip-build"]
+ negative_opt = {"no-compile" : "compile"}
def initialize_options(self):
# let the 'install' command dictate our installation directory
@@ -61,13 +61,13 @@ def finalize_options(self):
# Get all the information we need to install pure Python modules
# from the umbrella 'install' command -- build (source) directory,
# install (target) directory, and whether to compile .py files.
- self.set_undefined_options('install',
- ('build_lib', 'build_dir'),
- ('install_lib', 'install_dir'),
- ('force', 'force'),
- ('compile', 'compile'),
- ('optimize', 'optimize'),
- ('skip_build', 'skip_build'),
+ self.set_undefined_options("install",
+ ("build_lib", "build_dir"),
+ ("install_lib", "install_dir"),
+ ("force", "force"),
+ ("compile", "compile"),
+ ("optimize", "optimize"),
+ ("skip_build", "skip_build"),
)
if self.compile is None:
@@ -102,9 +102,9 @@ def run(self):
def build(self):
if not self.skip_build:
if self.distribution.has_pure_modules():
- self.run_command('build_py')
+ self.run_command("build_py")
if self.distribution.has_ext_modules():
- self.run_command('build_ext')
+ self.run_command("build_ext")
def install(self):
if os.path.isdir(self.build_dir):
@@ -117,7 +117,7 @@ def install(self):
def byte_compile(self, files):
if sys.dont_write_bytecode:
- self.warn('byte-compiling is disabled, skipping.')
+ self.warn("byte-compiling is disabled, skipping.")
return
from distutils.util import byte_compile
@@ -126,7 +126,7 @@ def byte_compile(self, files):
# and use it as a prefix to strip off the purported filename
# encoded in bytecode files. This is far from complete, but it
# should at least generate usable bytecode in RPM distributions.
- install_root = self.get_finalized_command('install').root
+ install_root = self.get_finalized_command("install").root
if self.compile:
byte_compile(files, optimize=0,
@@ -166,7 +166,7 @@ def _bytecode_filenames(self, py_filenames):
continue
if self.compile:
bytecode_files.append(importlib.util.cache_from_source(
- py_file, optimization=''))
+ py_file, optimization=""))
if self.optimize > 0:
bytecode_files.append(importlib.util.cache_from_source(
py_file, optimization=self.optimize))
@@ -184,7 +184,7 @@ def get_outputs(self):
"""
pure_outputs = \
self._mutate_outputs(self.distribution.has_pure_modules(),
- 'build_py', 'build_lib',
+ "build_py", "build_lib",
self.install_dir)
if self.compile:
bytecode_outputs = self._bytecode_filenames(pure_outputs)
@@ -193,7 +193,7 @@ def get_outputs(self):
ext_outputs = \
self._mutate_outputs(self.distribution.has_ext_modules(),
- 'build_ext', 'build_lib',
+ "build_ext", "build_lib",
self.install_dir)
return pure_outputs + bytecode_outputs + ext_outputs
@@ -207,11 +207,11 @@ def get_inputs(self):
inputs = []
if self.distribution.has_pure_modules():
- build_py = self.get_finalized_command('build_py')
+ build_py = self.get_finalized_command("build_py")
inputs.extend(build_py.get_outputs())
if self.distribution.has_ext_modules():
- build_ext = self.get_finalized_command('build_ext')
+ build_ext = self.get_finalized_command("build_ext")
inputs.extend(build_ext.get_outputs())
return inputs
diff --git a/.venv3.10/Lib/distutils/command/install_scripts.py b/.venv3.10/Lib/distutils/command/install_scripts.py
index 31a1130e..63cb16b3 100644
--- a/.venv3.10/Lib/distutils/command/install_scripts.py
+++ b/.venv3.10/Lib/distutils/command/install_scripts.py
@@ -16,13 +16,13 @@ class install_scripts(Command):
description = "install scripts (Python or otherwise)"
user_options = [
- ('install-dir=', 'd', "directory to install scripts to"),
- ('build-dir=','b', "build directory (where to install from)"),
- ('force', 'f', "force installation (overwrite existing files)"),
- ('skip-build', None, "skip the build steps"),
+ ("install-dir=", "d", "directory to install scripts to"),
+ ("build-dir=","b", "build directory (where to install from)"),
+ ("force", "f", "force installation (overwrite existing files)"),
+ ("skip-build", None, "skip the build steps"),
]
- boolean_options = ['force', 'skip-build']
+ boolean_options = ["force", "skip-build"]
def initialize_options(self):
self.install_dir = None
@@ -31,18 +31,18 @@ def initialize_options(self):
self.skip_build = None
def finalize_options(self):
- self.set_undefined_options('build', ('build_scripts', 'build_dir'))
- self.set_undefined_options('install',
- ('install_scripts', 'install_dir'),
- ('force', 'force'),
- ('skip_build', 'skip_build'),
+ self.set_undefined_options("build", ("build_scripts", "build_dir"))
+ self.set_undefined_options("install",
+ ("install_scripts", "install_dir"),
+ ("force", "force"),
+ ("skip_build", "skip_build"),
)
def run(self):
if not self.skip_build:
- self.run_command('build_scripts')
+ self.run_command("build_scripts")
self.outfiles = self.copy_tree(self.build_dir, self.install_dir)
- if os.name == 'posix':
+ if os.name == "posix":
# Set the executable bits (owner, group, and world) on
# all the scripts we just installed.
for file in self.get_outputs():
diff --git a/.venv3.10/Lib/distutils/command/register.py b/.venv3.10/Lib/distutils/command/register.py
index 0fac94e9..0d3dec68 100644
--- a/.venv3.10/Lib/distutils/command/register.py
+++ b/.venv3.10/Lib/distutils/command/register.py
@@ -7,7 +7,8 @@
import getpass
import io
-import urllib.parse, urllib.request
+import urllib.parse
+import urllib.request
from warnings import warn
from distutils.core import PyPIRCCommand
@@ -18,15 +19,15 @@ class register(PyPIRCCommand):
description = ("register the distribution with the Python package index")
user_options = PyPIRCCommand.user_options + [
- ('list-classifiers', None,
- 'list the valid Trove classifiers'),
- ('strict', None ,
- 'Will stop the registering if the meta-data are not fully compliant')
+ ("list-classifiers", None,
+ "list the valid Trove classifiers"),
+ ("strict", None ,
+ "Will stop the registering if the meta-data are not fully compliant")
]
boolean_options = PyPIRCCommand.boolean_options + [
- 'verify', 'list-classifiers', 'strict']
+ "verify", "list-classifiers", "strict"]
- sub_commands = [('check', lambda self: True)]
+ sub_commands = [("check", lambda self: True)]
def initialize_options(self):
PyPIRCCommand.initialize_options(self)
@@ -36,9 +37,9 @@ def initialize_options(self):
def finalize_options(self):
PyPIRCCommand.finalize_options(self)
# setting options for the `check` subcommand
- check_options = {'strict': ('register', self.strict),
- 'restructuredtext': ('register', 1)}
- self.distribution.command_options['check'] = check_options
+ check_options = {"strict": ("register", self.strict),
+ "restructuredtext": ("register", 1)}
+ self.distribution.command_options["check"] = check_options
def run(self):
self.finalize_options()
@@ -59,45 +60,45 @@ def check_metadata(self):
"""Deprecated API."""
warn("distutils.command.register.check_metadata is deprecated, \
use the check command instead", PendingDeprecationWarning)
- check = self.distribution.get_command_obj('check')
+ check = self.distribution.get_command_obj("check")
check.ensure_finalized()
check.strict = self.strict
check.restructuredtext = 1
check.run()
def _set_config(self):
- ''' Reads the configuration file and set attributes.
- '''
+ """ Reads the configuration file and set attributes.
+ """
config = self._read_pypirc()
if config != {}:
- self.username = config['username']
- self.password = config['password']
- self.repository = config['repository']
- self.realm = config['realm']
+ self.username = config["username"]
+ self.password = config["password"]
+ self.repository = config["repository"]
+ self.realm = config["realm"]
self.has_config = True
else:
- if self.repository not in ('pypi', self.DEFAULT_REPOSITORY):
- raise ValueError('%s not found in .pypirc' % self.repository)
- if self.repository == 'pypi':
+ if self.repository not in ("pypi", self.DEFAULT_REPOSITORY):
+ raise ValueError("%s not found in .pypirc" % self.repository)
+ if self.repository == "pypi":
self.repository = self.DEFAULT_REPOSITORY
self.has_config = False
def classifiers(self):
- ''' Fetch the list of classifiers from the server.
- '''
- url = self.repository+'?:action=list_classifiers'
+ """ Fetch the list of classifiers from the server.
+ """
+ url = self.repository+"?:action=list_classifiers"
response = urllib.request.urlopen(url)
log.info(self._read_pypi_response(response))
def verify_metadata(self):
- ''' Send the metadata to the package index server to be checked.
- '''
+ """ Send the metadata to the package index server to be checked.
+ """
# send the info to the server and report the result
- (code, result) = self.post_to_server(self.build_post_data('verify'))
- log.info('Server response (%s): %s', code, result)
+ (code, result) = self.post_to_server(self.build_post_data("verify"))
+ log.info("Server response (%s): %s", code, result)
def send_metadata(self):
- ''' Send the metadata to the package index server.
+ """ Send the metadata to the package index server.
Well, do the following:
1. figure who the user is, and then
@@ -123,48 +124,48 @@ def send_metadata(self):
2. register as a new user, or
3. set the password to a random string and email the user.
- '''
+ """
# see if we can short-cut and get the username/password from the
# config
if self.has_config:
- choice = '1'
+ choice = "1"
username = self.username
password = self.password
else:
- choice = 'x'
- username = password = ''
+ choice = "x"
+ username = password = ""
# get the user's login info
- choices = '1 2 3 4'.split()
+ choices = "1 2 3 4".split()
while choice not in choices:
- self.announce('''\
+ self.announce("""\
We need to know who you are, so please choose either:
1. use your existing login,
2. register as a new user,
3. have the server generate a new password for you (and email it to you), or
4. quit
-Your selection [default 1]: ''', log.INFO)
+Your selection [default 1]: """, log.INFO)
choice = input()
if not choice:
- choice = '1'
+ choice = "1"
elif choice not in choices:
- print('Please choose one of the four options!')
+ print("Please choose one of the four options!")
- if choice == '1':
+ if choice == "1":
# get the username and password
while not username:
- username = input('Username: ')
+ username = input("Username: ")
while not password:
- password = getpass.getpass('Password: ')
+ password = getpass.getpass("Password: ")
# set up the authentication
auth = urllib.request.HTTPPasswordMgr()
host = urllib.parse.urlparse(self.repository)[1]
auth.add_password(self.realm, host, username, password)
# send the info to the server and report the result
- code, result = self.post_to_server(self.build_post_data('submit'),
+ code, result = self.post_to_server(self.build_post_data("submit"),
auth)
- self.announce('Server response (%s): %s' % (code, result),
+ self.announce("Server response (%s): %s" % (code, result),
log.INFO)
# possibly save the login
@@ -174,89 +175,89 @@ def send_metadata(self):
# so the upload command can reuse it
self.distribution.password = password
else:
- self.announce(('I can store your PyPI login so future '
- 'submissions will be faster.'), log.INFO)
- self.announce('(the login will be stored in %s)' % \
+ self.announce(("I can store your PyPI login so future "
+ "submissions will be faster."), log.INFO)
+ self.announce("(the login will be stored in %s)" % \
self._get_rc_file(), log.INFO)
- choice = 'X'
- while choice.lower() not in 'yn':
- choice = input('Save your login (y/N)?')
+ choice = "X"
+ while choice.lower() not in "yn":
+ choice = input("Save your login (y/N)?")
if not choice:
- choice = 'n'
- if choice.lower() == 'y':
+ choice = "n"
+ if choice.lower() == "y":
self._store_pypirc(username, password)
- elif choice == '2':
- data = {':action': 'user'}
- data['name'] = data['password'] = data['email'] = ''
- data['confirm'] = None
- while not data['name']:
- data['name'] = input('Username: ')
- while data['password'] != data['confirm']:
- while not data['password']:
- data['password'] = getpass.getpass('Password: ')
- while not data['confirm']:
- data['confirm'] = getpass.getpass(' Confirm: ')
- if data['password'] != data['confirm']:
- data['password'] = ''
- data['confirm'] = None
+ elif choice == "2":
+ data = {":action": "user"}
+ data["name"] = data["password"] = data["email"] = ""
+ data["confirm"] = None
+ while not data["name"]:
+ data["name"] = input("Username: ")
+ while data["password"] != data["confirm"]:
+ while not data["password"]:
+ data["password"] = getpass.getpass("Password: ")
+ while not data["confirm"]:
+ data["confirm"] = getpass.getpass(" Confirm: ")
+ if data["password"] != data["confirm"]:
+ data["password"] = ""
+ data["confirm"] = None
print("Password and confirm don't match!")
- while not data['email']:
- data['email'] = input(' EMail: ')
+ while not data["email"]:
+ data["email"] = input(" EMail: ")
code, result = self.post_to_server(data)
if code != 200:
- log.info('Server response (%s): %s', code, result)
+ log.info("Server response (%s): %s", code, result)
else:
- log.info('You will receive an email shortly.')
- log.info(('Follow the instructions in it to '
- 'complete registration.'))
- elif choice == '3':
- data = {':action': 'password_reset'}
- data['email'] = ''
- while not data['email']:
- data['email'] = input('Your email address: ')
+ log.info("You will receive an email shortly.")
+ log.info(("Follow the instructions in it to "
+ "complete registration."))
+ elif choice == "3":
+ data = {":action": "password_reset"}
+ data["email"] = ""
+ while not data["email"]:
+ data["email"] = input("Your email address: ")
code, result = self.post_to_server(data)
- log.info('Server response (%s): %s', code, result)
+ log.info("Server response (%s): %s", code, result)
def build_post_data(self, action):
# figure the data to send - the metadata plus some additional
# information used by the package server
meta = self.distribution.metadata
data = {
- ':action': action,
- 'metadata_version' : '1.0',
- 'name': meta.get_name(),
- 'version': meta.get_version(),
- 'summary': meta.get_description(),
- 'home_page': meta.get_url(),
- 'author': meta.get_contact(),
- 'author_email': meta.get_contact_email(),
- 'license': meta.get_licence(),
- 'description': meta.get_long_description(),
- 'keywords': meta.get_keywords(),
- 'platform': meta.get_platforms(),
- 'classifiers': meta.get_classifiers(),
- 'download_url': meta.get_download_url(),
+ ":action": action,
+ "metadata_version" : "1.0",
+ "name": meta.get_name(),
+ "version": meta.get_version(),
+ "summary": meta.get_description(),
+ "home_page": meta.get_url(),
+ "author": meta.get_contact(),
+ "author_email": meta.get_contact_email(),
+ "license": meta.get_licence(),
+ "description": meta.get_long_description(),
+ "keywords": meta.get_keywords(),
+ "platform": meta.get_platforms(),
+ "classifiers": meta.get_classifiers(),
+ "download_url": meta.get_download_url(),
# PEP 314
- 'provides': meta.get_provides(),
- 'requires': meta.get_requires(),
- 'obsoletes': meta.get_obsoletes(),
+ "provides": meta.get_provides(),
+ "requires": meta.get_requires(),
+ "obsoletes": meta.get_obsoletes(),
}
- if data['provides'] or data['requires'] or data['obsoletes']:
- data['metadata_version'] = '1.1'
+ if data["provides"] or data["requires"] or data["obsoletes"]:
+ data["metadata_version"] = "1.1"
return data
def post_to_server(self, data, auth=None):
- ''' Post a query to the server, and return a string response.
- '''
- if 'name' in data:
- self.announce('Registering %s to %s' % (data['name'],
+ """ Post a query to the server, and return a string response.
+ """
+ if "name" in data:
+ self.announce("Registering %s to %s" % (data["name"],
self.repository),
log.INFO)
# Build up the MIME payload for the urllib2 POST data
- boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
- sep_boundary = '\n--' + boundary
- end_boundary = sep_boundary + '--'
+ boundary = "--------------GHSKFJDLGDS7543FJKLFHRE75642756743254"
+ sep_boundary = "\n--" + boundary
+ end_boundary = sep_boundary + "--"
body = io.StringIO()
for key, value in data.items():
# handle multiple entries for the same name
@@ -268,16 +269,16 @@ def post_to_server(self, data, auth=None):
body.write('\nContent-Disposition: form-data; name="%s"'%key)
body.write("\n\n")
body.write(value)
- if value and value[-1] == '\r':
- body.write('\n') # write an extra newline (lurve Macs)
+ if value and value[-1] == "\r":
+ body.write("\n") # write an extra newline (lurve Macs)
body.write(end_boundary)
body.write("\n")
body = body.getvalue().encode("utf-8")
# build the Request
headers = {
- 'Content-type': 'multipart/form-data; boundary=%s; charset=utf-8'%boundary,
- 'Content-length': str(len(body))
+ "Content-type": "multipart/form-data; boundary=%s; charset=utf-8"%boundary,
+ "Content-length": str(len(body))
}
req = urllib.request.Request(self.repository, body, headers)
@@ -285,7 +286,7 @@ def post_to_server(self, data, auth=None):
opener = urllib.request.build_opener(
urllib.request.HTTPBasicAuthHandler(password_mgr=auth)
)
- data = ''
+ data = ""
try:
result = opener.open(req)
except urllib.error.HTTPError as e:
@@ -297,8 +298,8 @@ def post_to_server(self, data, auth=None):
else:
if self.show_response:
data = self._read_pypi_response(result)
- result = 200, 'OK'
+ result = 200, "OK"
if self.show_response:
- msg = '\n'.join(('-' * 75, data, '-' * 75))
+ msg = "\n".join(("-" * 75, data, "-" * 75))
self.announce(msg, log.INFO)
return result
diff --git a/.venv3.10/Lib/distutils/command/sdist.py b/.venv3.10/Lib/distutils/command/sdist.py
index b4996fcb..ca76d3cd 100644
--- a/.venv3.10/Lib/distutils/command/sdist.py
+++ b/.venv3.10/Lib/distutils/command/sdist.py
@@ -44,59 +44,59 @@ def checking_metadata(self):
return self.metadata_check
user_options = [
- ('template=', 't',
+ ("template=", "t",
"name of manifest template file [default: MANIFEST.in]"),
- ('manifest=', 'm',
+ ("manifest=", "m",
"name of manifest file [default: MANIFEST]"),
- ('use-defaults', None,
+ ("use-defaults", None,
"include the default file set in the manifest "
"[default; disable with --no-defaults]"),
- ('no-defaults', None,
+ ("no-defaults", None,
"don't include the default file set"),
- ('prune', None,
+ ("prune", None,
"specifically exclude files/directories that should not be "
"distributed (build tree, RCS/CVS dirs, etc.) "
"[default; disable with --no-prune]"),
- ('no-prune', None,
+ ("no-prune", None,
"don't automatically exclude anything"),
- ('manifest-only', 'o',
+ ("manifest-only", "o",
"just regenerate the manifest and then stop "
"(implies --force-manifest)"),
- ('force-manifest', 'f',
+ ("force-manifest", "f",
"forcibly regenerate the manifest and carry on as usual. "
"Deprecated: now the manifest is always regenerated."),
- ('formats=', None,
+ ("formats=", None,
"formats for source distribution (comma-separated list)"),
- ('keep-temp', 'k',
+ ("keep-temp", "k",
"keep the distribution tree around after creating " +
"archive file(s)"),
- ('dist-dir=', 'd',
+ ("dist-dir=", "d",
"directory to put the source distribution archive(s) in "
"[default: dist]"),
- ('metadata-check', None,
+ ("metadata-check", None,
"Ensure that all required elements of meta-data "
"are supplied. Warn if any missing. [default]"),
- ('owner=', 'u',
+ ("owner=", "u",
"Owner name used when creating a tar file [default: current user]"),
- ('group=', 'g',
+ ("group=", "g",
"Group name used when creating a tar file [default: current group]"),
]
- boolean_options = ['use-defaults', 'prune',
- 'manifest-only', 'force-manifest',
- 'keep-temp', 'metadata-check']
+ boolean_options = ["use-defaults", "prune",
+ "manifest-only", "force-manifest",
+ "keep-temp", "metadata-check"]
help_options = [
- ('help-formats', None,
+ ("help-formats", None,
"list available distribution formats", show_formats),
]
- negative_opt = {'no-defaults': 'use-defaults',
- 'no-prune': 'prune' }
+ negative_opt = {"no-defaults": "use-defaults",
+ "no-prune": "prune" }
- sub_commands = [('check', checking_metadata)]
+ sub_commands = [("check", checking_metadata)]
- READMES = ('README', 'README.txt', 'README.rst')
+ READMES = ("README", "README.txt", "README.rst")
def initialize_options(self):
# 'template' and 'manifest' are, respectively, the names of
@@ -112,7 +112,7 @@ def initialize_options(self):
self.manifest_only = 0
self.force_manifest = 0
- self.formats = ['gztar']
+ self.formats = ["gztar"]
self.keep_temp = 0
self.dist_dir = None
@@ -127,7 +127,7 @@ def finalize_options(self):
if self.template is None:
self.template = "MANIFEST.in"
- self.ensure_string_list('formats')
+ self.ensure_string_list("formats")
bad_format = archive_util.check_archive_formats(self.formats)
if bad_format:
@@ -163,7 +163,7 @@ def check_metadata(self):
"""Deprecated API."""
warn("distutils.command.sdist.check_metadata is deprecated, \
use the check command instead", PendingDeprecationWarning)
- check = self.distribution.get_command_obj('check')
+ check = self.distribution.get_command_obj("check")
check.ensure_finalized()
check.run()
@@ -260,7 +260,7 @@ def _add_defaults_standards(self):
if not got_it:
self.warn("standard file not found: should have one of " +
- ', '.join(alts))
+ ", ".join(alts))
else:
if self._cs_path_exists(fn):
self.filelist.append(fn)
@@ -268,7 +268,7 @@ def _add_defaults_standards(self):
self.warn("standard file '%s' not found" % fn)
def _add_defaults_optional(self):
- optional = ['test/test*.py', 'setup.cfg']
+ optional = ["test/test*.py", "setup.cfg"]
for pattern in optional:
files = filter(os.path.isfile, glob(pattern))
self.filelist.extend(files)
@@ -277,7 +277,7 @@ def _add_defaults_python(self):
# build_py is used to get:
# - python modules
# - files defined in package_data
- build_py = self.get_finalized_command('build_py')
+ build_py = self.get_finalized_command("build_py")
# getting python files
if self.distribution.has_pure_modules():
@@ -308,17 +308,17 @@ def _add_defaults_data_files(self):
def _add_defaults_ext(self):
if self.distribution.has_ext_modules():
- build_ext = self.get_finalized_command('build_ext')
+ build_ext = self.get_finalized_command("build_ext")
self.filelist.extend(build_ext.get_source_files())
def _add_defaults_c_libs(self):
if self.distribution.has_c_libraries():
- build_clib = self.get_finalized_command('build_clib')
+ build_clib = self.get_finalized_command("build_clib")
self.filelist.extend(build_clib.get_source_files())
def _add_defaults_scripts(self):
if self.distribution.has_scripts():
- build_scripts = self.get_finalized_command('build_scripts')
+ build_scripts = self.get_finalized_command("build_scripts")
self.filelist.extend(build_scripts.get_source_files())
def read_template(self):
@@ -358,20 +358,20 @@ def prune_file_list(self):
previously with --keep-temp, or it aborted)
* any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
"""
- build = self.get_finalized_command('build')
+ build = self.get_finalized_command("build")
base_dir = self.distribution.get_fullname()
self.filelist.exclude_pattern(None, prefix=build.build_base)
self.filelist.exclude_pattern(None, prefix=base_dir)
- if sys.platform == 'win32':
- seps = r'/|\\'
+ if sys.platform == "win32":
+ seps = r"/|\\"
else:
- seps = '/'
+ seps = "/"
- vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr',
- '_darcs']
- vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps)
+ vcs_dirs = ["RCS", "CVS", r"\.svn", r"\.hg", r"\.git", r"\.bzr",
+ "_darcs"]
+ vcs_ptrn = r"(^|%s)(%s)(%s).*" % (seps, "|".join(vcs_dirs), seps)
self.filelist.exclude_pattern(vcs_ptrn, is_regex=1)
def write_manifest(self):
@@ -385,7 +385,7 @@ def write_manifest(self):
return
content = self.filelist.files[:]
- content.insert(0, '# file GENERATED by distutils, do NOT edit')
+ content.insert(0, "# file GENERATED by distutils, do NOT edit")
self.execute(file_util.write_file, (self.manifest, content),
"writing manifest file '%s'" % self.manifest)
@@ -399,7 +399,7 @@ def _manifest_is_not_generated(self):
first_line = fp.readline()
finally:
fp.close()
- return first_line != '# file GENERATED by distutils, do NOT edit\n'
+ return first_line != "# file GENERATED by distutils, do NOT edit\n"
def read_manifest(self):
"""Read the manifest file (named by 'self.manifest') and use it to
@@ -411,7 +411,7 @@ def read_manifest(self):
for line in manifest:
# ignore comments and blank lines
line = line.strip()
- if line.startswith('#') or not line:
+ if line.startswith("#") or not line:
continue
self.filelist.append(line)
@@ -437,8 +437,8 @@ def make_release_tree(self, base_dir, files):
# out-of-date, because by default we blow away 'base_dir' when
# we're done making the distribution archives.)
- if hasattr(os, 'link'): # can make hard links on this system
- link = 'hard'
+ if hasattr(os, "link"): # can make hard links on this system
+ link = "hard"
msg = "making hard links in %s..." % base_dir
else: # nope, have to copy
link = None
@@ -473,14 +473,14 @@ def make_distribution(self):
self.make_release_tree(base_dir, self.filelist.files)
archive_files = [] # remember names of files we create
# tar archive must be created last to avoid overwrite and remove
- if 'tar' in self.formats:
- self.formats.append(self.formats.pop(self.formats.index('tar')))
+ if "tar" in self.formats:
+ self.formats.append(self.formats.pop(self.formats.index("tar")))
for fmt in self.formats:
file = self.make_archive(base_name, fmt, base_dir=base_dir,
owner=self.owner, group=self.group)
archive_files.append(file)
- self.distribution.dist_files.append(('sdist', '', file))
+ self.distribution.dist_files.append(("sdist", "", file))
self.archive_files = archive_files
diff --git a/.venv3.10/Lib/distutils/command/upload.py b/.venv3.10/Lib/distutils/command/upload.py
index e0ecb655..6d6837af 100644
--- a/.venv3.10/Lib/distutils/command/upload.py
+++ b/.venv3.10/Lib/distutils/command/upload.py
@@ -32,17 +32,17 @@ class upload(PyPIRCCommand):
description = "upload binary package to PyPI"
user_options = PyPIRCCommand.user_options + [
- ('sign', 's',
- 'sign files to upload using gpg'),
- ('identity=', 'i', 'GPG identity used to sign files'),
+ ("sign", "s",
+ "sign files to upload using gpg"),
+ ("identity=", "i", "GPG identity used to sign files"),
]
- boolean_options = PyPIRCCommand.boolean_options + ['sign']
+ boolean_options = PyPIRCCommand.boolean_options + ["sign"]
def initialize_options(self):
PyPIRCCommand.initialize_options(self)
- self.username = ''
- self.password = ''
+ self.username = ""
+ self.password = ""
self.show_response = 0
self.sign = False
self.identity = None
@@ -55,10 +55,10 @@ def finalize_options(self):
)
config = self._read_pypirc()
if config != {}:
- self.username = config['username']
- self.password = config['password']
- self.repository = config['repository']
- self.realm = config['realm']
+ self.username = config["username"]
+ self.password = config["password"]
+ self.repository = config["repository"]
+ self.realm = config["realm"]
# getting the password from the distribution
# if previously set by the register command
@@ -80,7 +80,7 @@ def upload_file(self, command, pyversion, filename):
if params or query or fragments:
raise AssertionError("Incompatible url %s" % self.repository)
- if schema not in ('http', 'https'):
+ if schema not in ("http", "https"):
raise AssertionError("unsupported schema " + schema)
# Sign if requested
@@ -93,7 +93,7 @@ def upload_file(self, command, pyversion, filename):
# Fill in the data - send all the meta-data in case we need to
# register a new release
- f = open(filename,'rb')
+ f = open(filename,"rb")
try:
content = f.read()
finally:
@@ -102,37 +102,37 @@ def upload_file(self, command, pyversion, filename):
meta = self.distribution.metadata
data = {
# action
- ':action': 'file_upload',
- 'protocol_version': '1',
+ ":action": "file_upload",
+ "protocol_version": "1",
# identify release
- 'name': meta.get_name(),
- 'version': meta.get_version(),
+ "name": meta.get_name(),
+ "version": meta.get_version(),
# file content
- 'content': (os.path.basename(filename),content),
- 'filetype': command,
- 'pyversion': pyversion,
+ "content": (os.path.basename(filename),content),
+ "filetype": command,
+ "pyversion": pyversion,
# additional meta-data
- 'metadata_version': '1.0',
- 'summary': meta.get_description(),
- 'home_page': meta.get_url(),
- 'author': meta.get_contact(),
- 'author_email': meta.get_contact_email(),
- 'license': meta.get_licence(),
- 'description': meta.get_long_description(),
- 'keywords': meta.get_keywords(),
- 'platform': meta.get_platforms(),
- 'classifiers': meta.get_classifiers(),
- 'download_url': meta.get_download_url(),
+ "metadata_version": "1.0",
+ "summary": meta.get_description(),
+ "home_page": meta.get_url(),
+ "author": meta.get_contact(),
+ "author_email": meta.get_contact_email(),
+ "license": meta.get_licence(),
+ "description": meta.get_long_description(),
+ "keywords": meta.get_keywords(),
+ "platform": meta.get_platforms(),
+ "classifiers": meta.get_classifiers(),
+ "download_url": meta.get_download_url(),
# PEP 314
- 'provides': meta.get_provides(),
- 'requires': meta.get_requires(),
- 'obsoletes': meta.get_obsoletes(),
+ "provides": meta.get_provides(),
+ "requires": meta.get_requires(),
+ "obsoletes": meta.get_obsoletes(),
}
- data['comment'] = ''
+ data["comment"] = ""
# file content digests
for digest_name, digest_cons in _FILE_CONTENT_DIGESTS.items():
@@ -146,19 +146,19 @@ def upload_file(self, command, pyversion, filename):
if self.sign:
with open(filename + ".asc", "rb") as f:
- data['gpg_signature'] = (os.path.basename(filename) + ".asc",
+ data["gpg_signature"] = (os.path.basename(filename) + ".asc",
f.read())
# set up the authentication
- user_pass = (self.username + ":" + self.password).encode('ascii')
+ user_pass = (self.username + ":" + self.password).encode("ascii")
# The exact encoding of the authentication string is debated.
# Anyway PyPI only accepts ascii for both username or password.
- auth = "Basic " + standard_b64encode(user_pass).decode('ascii')
+ auth = "Basic " + standard_b64encode(user_pass).decode("ascii")
# Build up the MIME payload for the POST data
- boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
- sep_boundary = b'\r\n--' + boundary.encode('ascii')
- end_boundary = sep_boundary + b'--\r\n'
+ boundary = "--------------GHSKFJDLGDS7543FJKLFHRE75642756743254"
+ sep_boundary = b"\r\n--" + boundary.encode("ascii")
+ end_boundary = sep_boundary + b"--\r\n"
body = io.BytesIO()
for key, value in data.items():
title = '\r\nContent-Disposition: form-data; name="%s"' % key
@@ -170,9 +170,9 @@ def upload_file(self, command, pyversion, filename):
title += '; filename="%s"' % value[0]
value = value[1]
else:
- value = str(value).encode('utf-8')
+ value = str(value).encode("utf-8")
body.write(sep_boundary)
- body.write(title.encode('utf-8'))
+ body.write(title.encode("utf-8"))
body.write(b"\r\n\r\n")
body.write(value)
body.write(end_boundary)
@@ -183,9 +183,9 @@ def upload_file(self, command, pyversion, filename):
# build the Request
headers = {
- 'Content-type': 'multipart/form-data; boundary=%s' % boundary,
- 'Content-length': str(len(body)),
- 'Authorization': auth,
+ "Content-type": "multipart/form-data; boundary=%s" % boundary,
+ "Content-length": str(len(body)),
+ "Authorization": auth,
}
request = Request(self.repository, data=body,
@@ -203,13 +203,13 @@ def upload_file(self, command, pyversion, filename):
raise
if status == 200:
- self.announce('Server response (%s): %s' % (status, reason),
+ self.announce("Server response (%s): %s" % (status, reason),
log.INFO)
if self.show_response:
text = self._read_pypi_response(result)
- msg = '\n'.join(('-' * 75, text, '-' * 75))
+ msg = "\n".join(("-" * 75, text, "-" * 75))
self.announce(msg, log.INFO)
else:
- msg = 'Upload failed (%s): %s' % (status, reason)
+ msg = "Upload failed (%s): %s" % (status, reason)
self.announce(msg, log.ERROR)
raise DistutilsError(msg)
diff --git a/.venv3.10/Lib/distutils/config.py b/.venv3.10/Lib/distutils/config.py
index 2171abd6..36fd1050 100644
--- a/.venv3.10/Lib/distutils/config.py
+++ b/.venv3.10/Lib/distutils/config.py
@@ -21,63 +21,63 @@
class PyPIRCCommand(Command):
"""Base command that knows how to handle the .pypirc file
"""
- DEFAULT_REPOSITORY = 'https://upload.pypi.org/legacy/'
- DEFAULT_REALM = 'pypi'
+ DEFAULT_REPOSITORY = "https://upload.pypi.org/legacy/"
+ DEFAULT_REALM = "pypi"
repository = None
realm = None
user_options = [
- ('repository=', 'r',
+ ("repository=", "r",
"url of repository [default: %s]" % \
DEFAULT_REPOSITORY),
- ('show-response', None,
- 'display full response text from server')]
+ ("show-response", None,
+ "display full response text from server")]
- boolean_options = ['show-response']
+ boolean_options = ["show-response"]
def _get_rc_file(self):
"""Returns rc file path."""
- return os.path.join(os.path.expanduser('~'), '.pypirc')
+ return os.path.join(os.path.expanduser("~"), ".pypirc")
def _store_pypirc(self, username, password):
"""Creates a default .pypirc file."""
rc = self._get_rc_file()
- with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
+ with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0o600), "w") as f:
f.write(DEFAULT_PYPIRC % (username, password))
def _read_pypirc(self):
"""Reads the .pypirc file."""
rc = self._get_rc_file()
if os.path.exists(rc):
- self.announce('Using PyPI login from %s' % rc)
+ self.announce("Using PyPI login from %s" % rc)
repository = self.repository or self.DEFAULT_REPOSITORY
config = RawConfigParser()
config.read(rc)
sections = config.sections()
- if 'distutils' in sections:
+ if "distutils" in sections:
# let's get the list of servers
- index_servers = config.get('distutils', 'index-servers')
+ index_servers = config.get("distutils", "index-servers")
_servers = [server.strip() for server in
- index_servers.split('\n')
- if server.strip() != '']
+ index_servers.split("\n")
+ if server.strip() != ""]
if _servers == []:
# nothing set, let's try to get the default pypi
- if 'pypi' in sections:
- _servers = ['pypi']
+ if "pypi" in sections:
+ _servers = ["pypi"]
else:
# the file is not properly defined, returning
# an empty dict
return {}
for server in _servers:
- current = {'server': server}
- current['username'] = config.get(server, 'username')
+ current = {"server": server}
+ current["username"] = config.get(server, "username")
# optional params
- for key, default in (('repository',
+ for key, default in (("repository",
self.DEFAULT_REPOSITORY),
- ('realm', self.DEFAULT_REALM),
- ('password', None)):
+ ("realm", self.DEFAULT_REALM),
+ ("password", None)):
if config.has_option(server, key):
current[key] = config.get(server, key)
else:
@@ -86,34 +86,34 @@ def _read_pypirc(self):
# work around people having "repository" for the "pypi"
# section of their config set to the HTTP (rather than
# HTTPS) URL
- if (server == 'pypi' and
- repository in (self.DEFAULT_REPOSITORY, 'pypi')):
- current['repository'] = self.DEFAULT_REPOSITORY
+ if (server == "pypi" and
+ repository in (self.DEFAULT_REPOSITORY, "pypi")):
+ current["repository"] = self.DEFAULT_REPOSITORY
return current
- if (current['server'] == repository or
- current['repository'] == repository):
+ if (current["server"] == repository or
+ current["repository"] == repository):
return current
- elif 'server-login' in sections:
+ elif "server-login" in sections:
# old format
- server = 'server-login'
- if config.has_option(server, 'repository'):
- repository = config.get(server, 'repository')
+ server = "server-login"
+ if config.has_option(server, "repository"):
+ repository = config.get(server, "repository")
else:
repository = self.DEFAULT_REPOSITORY
- return {'username': config.get(server, 'username'),
- 'password': config.get(server, 'password'),
- 'repository': repository,
- 'server': server,
- 'realm': self.DEFAULT_REALM}
+ return {"username": config.get(server, "username"),
+ "password": config.get(server, "password"),
+ "repository": repository,
+ "server": server,
+ "realm": self.DEFAULT_REALM}
return {}
def _read_pypi_response(self, response):
"""Read and decode a PyPI HTTP response."""
import cgi
- content_type = response.getheader('content-type', 'text/plain')
- encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii')
+ content_type = response.getheader("content-type", "text/plain")
+ encoding = cgi.parse_header(content_type)[1].get("charset", "ascii")
return response.read().decode(encoding)
def initialize_options(self):
diff --git a/.venv3.10/Lib/distutils/core.py b/.venv3.10/Lib/distutils/core.py
index d603d4a4..0365d7de 100644
--- a/.venv3.10/Lib/distutils/core.py
+++ b/.venv3.10/Lib/distutils/core.py
@@ -14,9 +14,6 @@
# Mainly import these so setup scripts can "from distutils.core import" them.
from distutils.dist import Distribution
-from distutils.cmd import Command
-from distutils.config import PyPIRCCommand
-from distutils.extension import Extension
# This is a barebones help message generated displayed when the user
# runs the setup script with no arguments at all. More useful help
@@ -39,20 +36,20 @@ def gen_usage (script_name):
_setup_distribution = None
# Legal keyword arguments for the setup() function
-setup_keywords = ('distclass', 'script_name', 'script_args', 'options',
- 'name', 'version', 'author', 'author_email',
- 'maintainer', 'maintainer_email', 'url', 'license',
- 'description', 'long_description', 'keywords',
- 'platforms', 'classifiers', 'download_url',
- 'requires', 'provides', 'obsoletes',
+setup_keywords = ("distclass", "script_name", "script_args", "options",
+ "name", "version", "author", "author_email",
+ "maintainer", "maintainer_email", "url", "license",
+ "description", "long_description", "keywords",
+ "platforms", "classifiers", "download_url",
+ "requires", "provides", "obsoletes",
)
# Legal keyword arguments for the Extension constructor
-extension_keywords = ('name', 'sources', 'include_dirs',
- 'define_macros', 'undef_macros',
- 'library_dirs', 'libraries', 'runtime_library_dirs',
- 'extra_objects', 'extra_compile_args', 'extra_link_args',
- 'swig_opts', 'export_symbols', 'depends', 'language')
+extension_keywords = ("name", "sources", "include_dirs",
+ "define_macros", "undef_macros",
+ "library_dirs", "libraries", "runtime_library_dirs",
+ "extra_objects", "extra_compile_args", "extra_link_args",
+ "swig_opts", "export_symbols", "depends", "language")
def setup (**attrs):
"""The gateway to the Distutils: do everything your setup script needs
@@ -91,27 +88,27 @@ class found in 'cmdclass' is used in place of the default, which is
# Determine the distribution class -- either caller-supplied or
# our Distribution (see below).
- klass = attrs.get('distclass')
+ klass = attrs.get("distclass")
if klass:
- del attrs['distclass']
+ del attrs["distclass"]
else:
klass = Distribution
- if 'script_name' not in attrs:
- attrs['script_name'] = os.path.basename(sys.argv[0])
- if 'script_args' not in attrs:
- attrs['script_args'] = sys.argv[1:]
+ if "script_name" not in attrs:
+ attrs["script_name"] = os.path.basename(sys.argv[0])
+ if "script_args" not in attrs:
+ attrs["script_args"] = sys.argv[1:]
# Create the Distribution instance, using the remaining arguments
# (ie. everything except distclass) to initialize it
try:
_setup_distribution = dist = klass(attrs)
except DistutilsSetupError as msg:
- if 'name' not in attrs:
+ if "name" not in attrs:
raise SystemExit("error in setup command: %s" % msg)
else:
raise SystemExit("error in %s setup command: %s" % \
- (attrs['name'], msg))
+ (attrs["name"], msg))
if _setup_stop_after == "init":
return dist
@@ -198,20 +195,20 @@ def run_setup (script_name, script_args=None, stop_after="run"):
Returns the Distribution instance, which provides all information
used to drive the Distutils.
"""
- if stop_after not in ('init', 'config', 'commandline', 'run'):
+ if stop_after not in ("init", "config", "commandline", "run"):
raise ValueError("invalid value for 'stop_after': %r" % (stop_after,))
global _setup_stop_after, _setup_distribution
_setup_stop_after = stop_after
save_argv = sys.argv.copy()
- g = {'__file__': script_name}
+ g = {"__file__": script_name}
try:
try:
sys.argv[0] = script_name
if script_args is not None:
sys.argv[1:] = script_args
- with open(script_name, 'rb') as f:
+ with open(script_name, "rb") as f:
exec(f.read(), g)
finally:
sys.argv = save_argv
diff --git a/.venv3.10/Lib/distutils/cygwinccompiler.py b/.venv3.10/Lib/distutils/cygwinccompiler.py
index e6c79011..cccc3008 100644
--- a/.venv3.10/Lib/distutils/cygwinccompiler.py
+++ b/.venv3.10/Lib/distutils/cygwinccompiler.py
@@ -62,27 +62,27 @@ def get_msvcr():
"""Include the appropriate MSVC runtime library if Python was built
with MSVC 7.0 or later.
"""
- msc_pos = sys.version.find('MSC v.')
+ msc_pos = sys.version.find("MSC v.")
if msc_pos != -1:
msc_ver = sys.version[msc_pos+6:msc_pos+10]
- if msc_ver == '1300':
+ if msc_ver == "1300":
# MSVC 7.0
- return ['msvcr70']
- elif msc_ver == '1310':
+ return ["msvcr70"]
+ elif msc_ver == "1310":
# MSVC 7.1
- return ['msvcr71']
- elif msc_ver == '1400':
+ return ["msvcr71"]
+ elif msc_ver == "1400":
# VS2005 / MSVC 8.0
- return ['msvcr80']
- elif msc_ver == '1500':
+ return ["msvcr80"]
+ elif msc_ver == "1500":
# VS2008 / MSVC 9.0
- return ['msvcr90']
- elif msc_ver == '1600':
+ return ["msvcr90"]
+ elif msc_ver == "1600":
# VS2010 / MSVC 10.0
- return ['msvcr100']
+ return ["msvcr100"]
elif int(msc_ver) >= 1900:
# VS2015 / MSVC 14.0
- return ['msvcr140']
+ return ["msvcr140"]
else:
raise ValueError("Unknown MS Compiler version %s " % msc_ver)
@@ -90,7 +90,7 @@ def get_msvcr():
class CygwinCCompiler(UnixCCompiler):
""" Handles the Cygwin port of the GNU C compiler to Windows.
"""
- compiler_type = 'cygwin'
+ compiler_type = "cygwin"
obj_extension = ".o"
static_lib_extension = ".a"
shared_lib_extension = ".dll"
@@ -138,11 +138,11 @@ def __init__(self, verbose=0, dry_run=0, force=0):
# Hard-code GCC because that's what this is all about.
# XXX optimization, warnings etc. should be customizable.
- self.set_executables(compiler='gcc -mcygwin -O -Wall',
- compiler_so='gcc -mcygwin -mdll -O -Wall',
- compiler_cxx='g++ -mcygwin -O -Wall',
- linker_exe='gcc -mcygwin',
- linker_so=('%s -mcygwin %s' %
+ self.set_executables(compiler="gcc -mcygwin -O -Wall",
+ compiler_so="gcc -mcygwin -mdll -O -Wall",
+ compiler_cxx="g++ -mcygwin -O -Wall",
+ linker_exe="gcc -mcygwin",
+ linker_so=("%s -mcygwin %s" %
(self.linker_dll, shared_option)))
# cygwin and mingw32 need different sets of libraries
@@ -159,7 +159,7 @@ def __init__(self, verbose=0, dry_run=0, force=0):
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
"""Compiles the source by spawning GCC and windres if needed."""
- if ext == '.rc' or ext == '.res':
+ if ext == ".rc" or ext == ".res":
# gcc needs '.res' and '.rc' compiled to object files !!!
try:
self.spawn(["windres", "-i", src, "-o", obj])
@@ -167,7 +167,7 @@ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
raise CompileError(msg)
else: # for other files use the C-compiler
try:
- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
+ self.spawn(self.compiler_so + cc_args + [src, "-o", obj] +
extra_postargs)
except DistutilsExecError as msg:
raise CompileError(msg)
@@ -204,7 +204,7 @@ def link(self, target_desc, objects, output_filename, output_dir=None,
# generate the filenames for these files
def_file = os.path.join(temp_dir, dll_name + ".def")
- lib_file = os.path.join(temp_dir, 'lib' + dll_name + ".a")
+ lib_file = os.path.join(temp_dir, "lib" + dll_name + ".a")
# Generate .def file
contents = [
@@ -250,20 +250,20 @@ def link(self, target_desc, objects, output_filename, output_dir=None,
# -- Miscellaneous methods -----------------------------------------
- def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
+ def object_filenames(self, source_filenames, strip_dir=0, output_dir=""):
"""Adds supports for rc and res files."""
if output_dir is None:
- output_dir = ''
+ output_dir = ""
obj_names = []
for src_name in source_filenames:
# use normcase to make sure '.rc' is really '.rc' and not '.RC'
base, ext = os.path.splitext(os.path.normcase(src_name))
- if ext not in (self.src_extensions + ['.rc','.res']):
+ if ext not in (self.src_extensions + [".rc",".res"]):
raise UnknownFileError("unknown file type '%s' (from '%s')" % \
(ext, src_name))
if strip_dir:
base = os.path.basename (base)
- if ext in ('.res', '.rc'):
+ if ext in (".res", ".rc"):
# these need to be compiled to object files
obj_names.append (os.path.join(output_dir,
base + ext + self.obj_extension))
@@ -276,7 +276,7 @@ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
class Mingw32CCompiler(CygwinCCompiler):
""" Handles the Mingw32 port of the GNU C compiler to Windows.
"""
- compiler_type = 'mingw32'
+ compiler_type = "mingw32"
def __init__(self, verbose=0, dry_run=0, force=0):
@@ -292,19 +292,19 @@ def __init__(self, verbose=0, dry_run=0, force=0):
# A real mingw32 doesn't need to specify a different entry point,
# but cygwin 2.91.57 in no-cygwin-mode needs it.
if self.gcc_version <= "2.91.57":
- entry_point = '--entry _DllMain@12'
+ entry_point = "--entry _DllMain@12"
else:
- entry_point = ''
+ entry_point = ""
if is_cygwingcc():
raise CCompilerError(
- 'Cygwin gcc cannot be used with --compiler=mingw32')
+ "Cygwin gcc cannot be used with --compiler=mingw32")
- self.set_executables(compiler='gcc -O -Wall',
- compiler_so='gcc -mdll -O -Wall',
- compiler_cxx='g++ -O -Wall',
- linker_exe='gcc',
- linker_so='%s %s %s'
+ self.set_executables(compiler="gcc -O -Wall",
+ compiler_so="gcc -mdll -O -Wall",
+ compiler_cxx="g++ -O -Wall",
+ linker_exe="gcc",
+ linker_so="%s %s %s"
% (self.linker_dll, shared_option,
entry_point))
# Maybe we should also append -mthreads, but then the finished
@@ -369,7 +369,7 @@ def check_config_h():
return (CONFIG_H_UNCERTAIN,
"couldn't read '%s': %s" % (fn, exc.strerror))
-RE_VERSION = re.compile(br'(\d+\.\d+(\.\d+)*)')
+RE_VERSION = re.compile(br"(\d+\.\d+(\.\d+)*)")
def _find_exe_version(cmd):
"""Find the version of an executable by running `cmd` in the shell.
@@ -397,10 +397,10 @@ def get_versions():
If not possible it returns None for it.
"""
- commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version']
+ commands = ["gcc -dumpversion", "ld -v", "dllwrap --version"]
return tuple([_find_exe_version(cmd) for cmd in commands])
def is_cygwingcc():
- '''Try to determine if the gcc that would be used is from cygwin.'''
- out_string = check_output(['gcc', '-dumpmachine'])
- return out_string.strip().endswith(b'cygwin')
+ """Try to determine if the gcc that would be used is from cygwin."""
+ out_string = check_output(["gcc", "-dumpmachine"])
+ return out_string.strip().endswith(b"cygwin")
diff --git a/.venv3.10/Lib/distutils/debug.py b/.venv3.10/Lib/distutils/debug.py
index daf1660f..60c9a2e7 100644
--- a/.venv3.10/Lib/distutils/debug.py
+++ b/.venv3.10/Lib/distutils/debug.py
@@ -2,4 +2,4 @@
# If DISTUTILS_DEBUG is anything other than the empty string, we run in
# debug mode.
-DEBUG = os.environ.get('DISTUTILS_DEBUG')
+DEBUG = os.environ.get("DISTUTILS_DEBUG")
diff --git a/.venv3.10/Lib/distutils/dep_util.py b/.venv3.10/Lib/distutils/dep_util.py
index d74f5e4e..abf33f33 100644
--- a/.venv3.10/Lib/distutils/dep_util.py
+++ b/.venv3.10/Lib/distutils/dep_util.py
@@ -51,7 +51,7 @@ def newer_pairwise (sources, targets):
# newer_pairwise ()
-def newer_group (sources, target, missing='error'):
+def newer_group (sources, target, missing="error"):
"""Return true if 'target' is out-of-date with respect to any file
listed in 'sources'. In other words, if 'target' exists and is newer
than every file in 'sources', return false; otherwise return true.
@@ -76,11 +76,11 @@ def newer_group (sources, target, missing='error'):
target_mtime = os.stat(target)[ST_MTIME]
for source in sources:
if not os.path.exists(source):
- if missing == 'error': # blow up when we stat() the file
+ if missing == "error": # blow up when we stat() the file
pass
- elif missing == 'ignore': # missing source dropped from
+ elif missing == "ignore": # missing source dropped from
continue # target's dependency list
- elif missing == 'newer': # missing source means target is
+ elif missing == "newer": # missing source means target is
return 1 # out-of-date
source_mtime = os.stat(source)[ST_MTIME]
diff --git a/.venv3.10/Lib/distutils/dir_util.py b/.venv3.10/Lib/distutils/dir_util.py
index d5cd8e3e..c2c72786 100644
--- a/.venv3.10/Lib/distutils/dir_util.py
+++ b/.venv3.10/Lib/distutils/dir_util.py
@@ -39,7 +39,7 @@ def mkpath(name, mode=0o777, verbose=1, dry_run=0):
name = os.path.normpath(name)
created_dirs = []
- if os.path.isdir(name) or name == '':
+ if os.path.isdir(name) or name == "":
return created_dirs
if _path_created.get(os.path.abspath(name)):
return created_dirs
@@ -140,7 +140,7 @@ def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
src_name = os.path.join(src, n)
dst_name = os.path.join(dst, n)
- if n.startswith('.nfs'):
+ if n.startswith(".nfs"):
# skip NFS rename files
continue
diff --git a/.venv3.10/Lib/distutils/dist.py b/.venv3.10/Lib/distutils/dist.py
index 6cf0a0d6..d6624e39 100644
--- a/.venv3.10/Lib/distutils/dist.py
+++ b/.venv3.10/Lib/distutils/dist.py
@@ -24,7 +24,7 @@
# the same as a Python NAME -- I don't allow leading underscores. The fact
# that they're very similar is no coincidence; the default naming scheme is
# to look for a Python module named after the command.
-command_re = re.compile(r'^[a-zA-Z]([a-zA-Z0-9_]*)$')
+command_re = re.compile(r"^[a-zA-Z]([a-zA-Z0-9_]*)$")
def _ensure_list(value, fieldname):
@@ -64,12 +64,12 @@ class Distribution:
# have minimal control over.
# The fourth entry for verbose means that it can be repeated.
global_options = [
- ('verbose', 'v', "run verbosely (default)", 1),
- ('quiet', 'q', "run quietly (turns verbosity off)"),
- ('dry-run', 'n', "don't actually do anything"),
- ('help', 'h', "show detailed help message"),
- ('no-user-cfg', None,
- 'ignore pydistutils.cfg in your home directory'),
+ ("verbose", "v", "run verbosely (default)", 1),
+ ("quiet", "q", "run quietly (turns verbosity off)"),
+ ("dry-run", "n", "don't actually do anything"),
+ ("help", "h", "show detailed help message"),
+ ("no-user-cfg", None,
+ "ignore pydistutils.cfg in your home directory"),
]
# 'common_usage' is a short (2-3 line) string describing the common
@@ -83,53 +83,53 @@ class Distribution:
# options that are not propagated to the commands
display_options = [
- ('help-commands', None,
+ ("help-commands", None,
"list all available commands"),
- ('name', None,
+ ("name", None,
"print package name"),
- ('version', 'V',
+ ("version", "V",
"print package version"),
- ('fullname', None,
+ ("fullname", None,
"print -"),
- ('author', None,
+ ("author", None,
"print the author's name"),
- ('author-email', None,
+ ("author-email", None,
"print the author's email address"),
- ('maintainer', None,
+ ("maintainer", None,
"print the maintainer's name"),
- ('maintainer-email', None,
+ ("maintainer-email", None,
"print the maintainer's email address"),
- ('contact', None,
+ ("contact", None,
"print the maintainer's name if known, else the author's"),
- ('contact-email', None,
+ ("contact-email", None,
"print the maintainer's email address if known, else the author's"),
- ('url', None,
+ ("url", None,
"print the URL for this package"),
- ('license', None,
+ ("license", None,
"print the license of the package"),
- ('licence', None,
+ ("licence", None,
"alias for --license"),
- ('description', None,
+ ("description", None,
"print the package description"),
- ('long-description', None,
+ ("long-description", None,
"print the long package description"),
- ('platforms', None,
+ ("platforms", None,
"print the list of platforms"),
- ('classifiers', None,
+ ("classifiers", None,
"print the list of classifiers"),
- ('keywords', None,
+ ("keywords", None,
"print the list of keywords"),
- ('provides', None,
+ ("provides", None,
"print the list of packages/modules provided"),
- ('requires', None,
+ ("requires", None,
"print the list of packages/modules required"),
- ('obsoletes', None,
+ ("obsoletes", None,
"print the list of packages/modules made obsolete")
]
display_option_names = [translate_longopt(x[0]) for x in display_options]
# negative options are options that exclude other options
- negative_opt = {'quiet': 'verbose'}
+ negative_opt = {"quiet": "verbose"}
# -- Creation/initialization methods -------------------------------
@@ -214,7 +214,7 @@ def __init__(self, attrs=None):
self.extra_path = None
self.scripts = None
self.data_files = None
- self.password = ''
+ self.password = ""
# And now initialize bookkeeping stuff that can't be supplied by
# the caller at all. 'command_obj' maps command names to
@@ -243,17 +243,17 @@ def __init__(self, attrs=None):
# specifically. Note that this order guarantees that aliased
# command options will override any supplied redundantly
# through the general options dictionary.
- options = attrs.get('options')
+ options = attrs.get("options")
if options is not None:
- del attrs['options']
+ del attrs["options"]
for (command, cmd_options) in options.items():
opt_dict = self.get_option_dict(command)
for (opt, val) in cmd_options.items():
opt_dict[opt] = ("setup script", val)
- if 'licence' in attrs:
- attrs['license'] = attrs['licence']
- del attrs['licence']
+ if "licence" in attrs:
+ attrs["license"] = attrs["licence"]
+ del attrs["licence"]
msg = "'licence' distribution option is deprecated; use 'license'"
if warnings is not None:
warnings.warn(msg)
@@ -283,9 +283,9 @@ def __init__(self, attrs=None):
if self.script_args is not None:
for arg in self.script_args:
- if not arg.startswith('-'):
+ if not arg.startswith("-"):
break
- if arg == '--no-user-cfg':
+ if arg == "--no-user-cfg":
self.want_user_cfg = False
break
@@ -325,7 +325,7 @@ def dump_option_dicts(self, header=None, commands=None, indent=""):
self.announce(indent +
"option dict for '%s' command:" % cmd_name)
out = pformat(opt_dict)
- for line in out.split('\n'):
+ for line in out.split("\n"):
self.announce(indent + " " + line)
# -- Config file finding/parsing methods ---------------------------
@@ -349,7 +349,7 @@ def find_config_files(self):
check_environ()
# Where to look for the system-wide Distutils config file
- sys_dir = os.path.dirname(sys.modules['distutils'].__file__)
+ sys_dir = os.path.dirname(sys.modules["distutils"].__file__)
# Look for the system config file
sys_file = os.path.join(sys_dir, "distutils.cfg")
@@ -357,14 +357,14 @@ def find_config_files(self):
files.append(sys_file)
# What to call the per-user config file
- if os.name == 'posix':
+ if os.name == "posix":
user_filename = ".pydistutils.cfg"
else:
user_filename = "pydistutils.cfg"
# And look for the user config file
if self.want_user_cfg:
- user_file = os.path.join(os.path.expanduser('~'), user_filename)
+ user_file = os.path.join(os.path.expanduser("~"), user_filename)
if os.path.isfile(user_file):
files.append(user_file)
@@ -374,7 +374,7 @@ def find_config_files(self):
files.append(local_file)
if DEBUG:
- self.announce("using config files: %s" % ', '.join(files))
+ self.announce("using config files: %s" % ", ".join(files))
return files
@@ -384,10 +384,10 @@ def parse_config_files(self, filenames=None):
# Ignore install directory options if we have a venv
if sys.prefix != sys.base_prefix:
ignore_options = [
- 'install-base', 'install-platbase', 'install-lib',
- 'install-platlib', 'install-purelib', 'install-headers',
- 'install-scripts', 'install-data', 'prefix', 'exec-prefix',
- 'home', 'user', 'root']
+ "install-base", "install-platbase", "install-lib",
+ "install-platlib", "install-purelib", "install-headers",
+ "install-scripts", "install-data", "prefix", "exec-prefix",
+ "home", "user", "root"]
else:
ignore_options = []
@@ -409,9 +409,9 @@ def parse_config_files(self, filenames=None):
opt_dict = self.get_option_dict(section)
for opt in options:
- if opt != '__name__' and opt not in ignore_options:
+ if opt != "__name__" and opt not in ignore_options:
val = parser.get(section,opt)
- opt = opt.replace('-', '_')
+ opt = opt.replace("-", "_")
opt_dict[opt] = (filename, val)
# Make the ConfigParser forget everything (so we retain
@@ -421,13 +421,13 @@ def parse_config_files(self, filenames=None):
# If there was a "global" section in the config file, use it
# to set Distribution options.
- if 'global' in self.command_options:
- for (opt, (src, val)) in self.command_options['global'].items():
+ if "global" in self.command_options:
+ for (opt, (src, val)) in self.command_options["global"].items():
alias = self.negative_opt.get(opt)
try:
if alias:
setattr(self, alias, not strtobool(val))
- elif opt in ('verbose', 'dry_run'): # ugh!
+ elif opt in ("verbose", "dry_run"): # ugh!
setattr(self, opt, strtobool(val))
else:
setattr(self, opt, val)
@@ -471,7 +471,7 @@ def parse_command_line(self):
self.commands = []
parser = FancyGetopt(toplevel_options + self.display_options)
parser.set_negative_aliases(self.negative_opt)
- parser.set_aliases({'licence': 'license'})
+ parser.set_aliases({"licence": "license"})
args = parser.getopt(args=self.script_args, object=self)
option_order = parser.get_option_order()
log.set_verbosity(self.verbose)
@@ -548,7 +548,7 @@ def _parse_command_opts(self, parser, args):
# Also make sure that the command object provides a list of its
# known options.
- if not (hasattr(cmd_class, 'user_options') and
+ if not (hasattr(cmd_class, "user_options") and
isinstance(cmd_class.user_options, list)):
msg = ("command class %s must provide "
"'user_options' attribute (a list of tuples)")
@@ -557,13 +557,13 @@ def _parse_command_opts(self, parser, args):
# If the command class has a list of negative alias options,
# merge it in with the global negative aliases.
negative_opt = self.negative_opt
- if hasattr(cmd_class, 'negative_opt'):
+ if hasattr(cmd_class, "negative_opt"):
negative_opt = negative_opt.copy()
negative_opt.update(cmd_class.negative_opt)
# Check for help_options in command class. They have a different
# format (tuple of four) so we need to preprocess them here.
- if (hasattr(cmd_class, 'help_options') and
+ if (hasattr(cmd_class, "help_options") and
isinstance(cmd_class.help_options, list)):
help_options = fix_help_options(cmd_class.help_options)
else:
@@ -576,11 +576,11 @@ def _parse_command_opts(self, parser, args):
help_options)
parser.set_negative_aliases(negative_opt)
(args, opts) = parser.getopt(args[1:])
- if hasattr(opts, 'help') and opts.help:
+ if hasattr(opts, "help") and opts.help:
self._show_help(parser, display_options=0, commands=[cmd_class])
return
- if (hasattr(cmd_class, 'help_options') and
+ if (hasattr(cmd_class, "help_options") and
isinstance(cmd_class.help_options, list)):
help_option_found=0
for (help_option, short, desc, func) in cmd_class.help_options:
@@ -610,12 +610,12 @@ def finalize_options(self):
instance, analogous to the .finalize_options() method of Command
objects.
"""
- for attr in ('keywords', 'platforms'):
+ for attr in ("keywords", "platforms"):
value = getattr(self.metadata, attr)
if value is None:
continue
if isinstance(value, str):
- value = [elm.strip() for elm in value.split(',')]
+ value = [elm.strip() for elm in value.split(",")]
setattr(self.metadata, attr, value)
def _show_help(self, parser, global_options=1, display_options=1,
@@ -643,28 +643,28 @@ def _show_help(self, parser, global_options=1, display_options=1,
options = self.global_options
parser.set_option_table(options)
parser.print_help(self.common_usage + "\nGlobal options:")
- print('')
+ print("")
if display_options:
parser.set_option_table(self.display_options)
parser.print_help(
"Information display options (just display " +
"information, ignore any commands)")
- print('')
+ print("")
for command in self.commands:
if isinstance(command, type) and issubclass(command, Command):
klass = command
else:
klass = self.get_command_class(command)
- if (hasattr(klass, 'help_options') and
+ if (hasattr(klass, "help_options") and
isinstance(klass.help_options, list)):
parser.set_option_table(klass.user_options +
fix_help_options(klass.help_options))
else:
parser.set_option_table(klass.user_options)
parser.print_help("Options for '%s' command:" % klass.__name__)
- print('')
+ print("")
print(gen_usage(self.script_name))
@@ -681,7 +681,7 @@ def handle_display_options(self, option_order):
# we ignore "foo bar").
if self.help_commands:
self.print_commands()
- print('')
+ print("")
print(gen_usage(self.script_name))
return 1
@@ -697,11 +697,11 @@ def handle_display_options(self, option_order):
if val and is_display_option.get(opt):
opt = translate_longopt(opt)
value = getattr(self.metadata, "get_"+opt)()
- if opt in ['keywords', 'platforms']:
- print(','.join(value))
- elif opt in ('classifiers', 'provides', 'requires',
- 'obsoletes'):
- print('\n'.join(value))
+ if opt in ["keywords", "platforms"]:
+ print(",".join(value))
+ elif opt in ("classifiers", "provides", "requires",
+ "obsoletes"):
+ print("\n".join(value))
else:
print(value)
any_display_options = 1
@@ -797,8 +797,8 @@ def get_command_packages(self):
pkgs = self.command_packages
if not isinstance(pkgs, list):
if pkgs is None:
- pkgs = ''
- pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != '']
+ pkgs = ""
+ pkgs = [pkg.strip() for pkg in pkgs.split(",") if pkg != ""]
if "distutils.command" not in pkgs:
pkgs.insert(0, "distutils.command")
self.command_packages = pkgs
@@ -1063,7 +1063,7 @@ def read_pkg_file(self, file):
def _read_field(name):
value = msg[name]
- if value == 'UNKNOWN':
+ if value == "UNKNOWN":
return None
return value
@@ -1073,37 +1073,37 @@ def _read_list(name):
return None
return values
- metadata_version = msg['metadata-version']
- self.name = _read_field('name')
- self.version = _read_field('version')
- self.description = _read_field('summary')
+ metadata_version = msg["metadata-version"]
+ self.name = _read_field("name")
+ self.version = _read_field("version")
+ self.description = _read_field("summary")
# we are filling author only.
- self.author = _read_field('author')
+ self.author = _read_field("author")
self.maintainer = None
- self.author_email = _read_field('author-email')
+ self.author_email = _read_field("author-email")
self.maintainer_email = None
- self.url = _read_field('home-page')
- self.license = _read_field('license')
+ self.url = _read_field("home-page")
+ self.license = _read_field("license")
- if 'download-url' in msg:
- self.download_url = _read_field('download-url')
+ if "download-url" in msg:
+ self.download_url = _read_field("download-url")
else:
self.download_url = None
- self.long_description = _read_field('description')
- self.description = _read_field('summary')
+ self.long_description = _read_field("description")
+ self.description = _read_field("summary")
- if 'keywords' in msg:
- self.keywords = _read_field('keywords').split(',')
+ if "keywords" in msg:
+ self.keywords = _read_field("keywords").split(",")
- self.platforms = _read_list('platform')
- self.classifiers = _read_list('classifier')
+ self.platforms = _read_list("platform")
+ self.classifiers = _read_list("classifier")
# PEP 314 - these fields only exist in 1.1
- if metadata_version == '1.1':
- self.requires = _read_list('requires')
- self.provides = _read_list('provides')
- self.obsoletes = _read_list('obsoletes')
+ if metadata_version == "1.1":
+ self.requires = _read_list("requires")
+ self.provides = _read_list("provides")
+ self.obsoletes = _read_list("obsoletes")
else:
self.requires = None
self.provides = None
@@ -1112,47 +1112,47 @@ def _read_list(name):
def write_pkg_info(self, base_dir):
"""Write the PKG-INFO file into the release tree.
"""
- with open(os.path.join(base_dir, 'PKG-INFO'), 'w',
- encoding='UTF-8') as pkg_info:
+ with open(os.path.join(base_dir, "PKG-INFO"), "w",
+ encoding="UTF-8") as pkg_info:
self.write_pkg_file(pkg_info)
def write_pkg_file(self, file):
"""Write the PKG-INFO format data to a file object.
"""
- version = '1.0'
+ version = "1.0"
if (self.provides or self.requires or self.obsoletes or
self.classifiers or self.download_url):
- version = '1.1'
-
- file.write('Metadata-Version: %s\n' % version)
- file.write('Name: %s\n' % self.get_name())
- file.write('Version: %s\n' % self.get_version())
- file.write('Summary: %s\n' % self.get_description())
- file.write('Home-page: %s\n' % self.get_url())
- file.write('Author: %s\n' % self.get_contact())
- file.write('Author-email: %s\n' % self.get_contact_email())
- file.write('License: %s\n' % self.get_license())
+ version = "1.1"
+
+ file.write("Metadata-Version: %s\n" % version)
+ file.write("Name: %s\n" % self.get_name())
+ file.write("Version: %s\n" % self.get_version())
+ file.write("Summary: %s\n" % self.get_description())
+ file.write("Home-page: %s\n" % self.get_url())
+ file.write("Author: %s\n" % self.get_contact())
+ file.write("Author-email: %s\n" % self.get_contact_email())
+ file.write("License: %s\n" % self.get_license())
if self.download_url:
- file.write('Download-URL: %s\n' % self.download_url)
+ file.write("Download-URL: %s\n" % self.download_url)
long_desc = rfc822_escape(self.get_long_description())
- file.write('Description: %s\n' % long_desc)
+ file.write("Description: %s\n" % long_desc)
- keywords = ','.join(self.get_keywords())
+ keywords = ",".join(self.get_keywords())
if keywords:
- file.write('Keywords: %s\n' % keywords)
+ file.write("Keywords: %s\n" % keywords)
- self._write_list(file, 'Platform', self.get_platforms())
- self._write_list(file, 'Classifier', self.get_classifiers())
+ self._write_list(file, "Platform", self.get_platforms())
+ self._write_list(file, "Classifier", self.get_classifiers())
# PEP 314
- self._write_list(file, 'Requires', self.get_requires())
- self._write_list(file, 'Provides', self.get_provides())
- self._write_list(file, 'Obsoletes', self.get_obsoletes())
+ self._write_list(file, "Requires", self.get_requires())
+ self._write_list(file, "Provides", self.get_provides())
+ self._write_list(file, "Obsoletes", self.get_obsoletes())
def _write_list(self, file, name, values):
for value in values:
- file.write('%s: %s\n' % (name, value))
+ file.write("%s: %s\n" % (name, value))
# -- Metadata query methods ----------------------------------------
@@ -1200,19 +1200,19 @@ def get_keywords(self):
return self.keywords or []
def set_keywords(self, value):
- self.keywords = _ensure_list(value, 'keywords')
+ self.keywords = _ensure_list(value, "keywords")
def get_platforms(self):
return self.platforms or ["UNKNOWN"]
def set_platforms(self, value):
- self.platforms = _ensure_list(value, 'platforms')
+ self.platforms = _ensure_list(value, "platforms")
def get_classifiers(self):
return self.classifiers or []
def set_classifiers(self, value):
- self.classifiers = _ensure_list(value, 'classifiers')
+ self.classifiers = _ensure_list(value, "classifiers")
def get_download_url(self):
return self.download_url or "UNKNOWN"
diff --git a/.venv3.10/Lib/distutils/extension.py b/.venv3.10/Lib/distutils/extension.py
index e85032ec..4f34a079 100644
--- a/.venv3.10/Lib/distutils/extension.py
+++ b/.venv3.10/Lib/distutils/extension.py
@@ -127,12 +127,12 @@ def __init__(self, name, sources,
# If there are unknown keyword options, warn about them
if len(kw) > 0:
options = [repr(option) for option in kw]
- options = ', '.join(sorted(options))
+ options = ", ".join(sorted(options))
msg = "Unknown Extension options: %s" % options
warnings.warn(msg)
def __repr__(self):
- return '<%s.%s(%r) at %#x>' % (
+ return "<%s.%s(%r) at %#x>" % (
self.__class__.__module__,
self.__class__.__qualname__,
self.name,
diff --git a/.venv3.10/Lib/distutils/fancy_getopt.py b/.venv3.10/Lib/distutils/fancy_getopt.py
index 7d170dd2..2eea240e 100644
--- a/.venv3.10/Lib/distutils/fancy_getopt.py
+++ b/.venv3.10/Lib/distutils/fancy_getopt.py
@@ -8,7 +8,9 @@
* options set attributes of a passed-in object
"""
-import sys, string, re
+import sys
+import string
+import re
import getopt
from distutils.errors import *
@@ -16,15 +18,15 @@
# the same as a Python NAME -- except, in the spirit of most GNU
# utilities, we use '-' in place of '_'. (The spirit of LISP lives on!)
# The similarities to NAME are again not a coincidence...
-longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)'
-longopt_re = re.compile(r'^%s$' % longopt_pat)
+longopt_pat = r"[a-zA-Z](?:[a-zA-Z0-9-]*)"
+longopt_re = re.compile(r"^%s$" % longopt_pat)
# For recognizing "negative alias" options, eg. "quiet=!verbose"
neg_alias_re = re.compile("^(%s)=!(%s)$" % (longopt_pat, longopt_pat))
# This is used to translate long options to legitimate Python identifiers
# (for use as attributes of some object).
-longopt_xlate = str.maketrans('-', '_')
+longopt_xlate = str.maketrans("-", "_")
class FancyGetopt:
"""Wrapper around the standard 'getopt()' module that provides some
@@ -164,8 +166,8 @@ def _grok_option_table(self):
self.repeat[long] = repeat
self.long_opts.append(long)
- if long[-1] == '=': # option takes an argument?
- if short: short = short + ':'
+ if long[-1] == "=": # option takes an argument?
+ if short: short = short + ":"
long = long[0:-1]
self.takes_arg[long] = 1
else:
@@ -228,17 +230,17 @@ def getopt(self, args=None, object=None):
self._grok_option_table()
- short_opts = ' '.join(self.short_opts)
+ short_opts = " ".join(self.short_opts)
try:
opts, args = getopt.getopt(args, short_opts, self.long_opts)
except getopt.error as msg:
raise DistutilsArgError(msg)
for opt, val in opts:
- if len(opt) == 2 and opt[0] == '-': # it's a short option
+ if len(opt) == 2 and opt[0] == "-": # it's a short option
opt = self.short2long[opt[1]]
else:
- assert len(opt) > 2 and opt[:2] == '--'
+ assert len(opt) > 2 and opt[:2] == "--"
opt = opt[2:]
alias = self.alias.get(opt)
@@ -246,7 +248,7 @@ def getopt(self, args=None, object=None):
opt = alias
if not self.takes_arg[opt]: # boolean option?
- assert val == '', "boolean option can't have value"
+ assert val == "", "boolean option can't have value"
alias = self.negative_alias.get(opt)
if alias:
opt = alias
@@ -291,7 +293,7 @@ def generate_help(self, header=None):
long = option[0]
short = option[1]
l = len(long)
- if long[-1] == '=':
+ if long[-1] == "=":
l = l - 1
if short is not None:
l = l + 5 # " (-x)" where short == 'x'
@@ -324,16 +326,16 @@ def generate_help(self, header=None):
# for Jesus, then 78 columns are good enough for me!)
line_width = 78
text_width = line_width - opt_width
- big_indent = ' ' * opt_width
+ big_indent = " " * opt_width
if header:
lines = [header]
else:
- lines = ['Option summary:']
+ lines = ["Option summary:"]
for option in self.option_table:
long, short, help = option[:3]
text = wrap_text(help, text_width)
- if long[-1] == '=':
+ if long[-1] == "=":
long = long[0:-1]
# Case 1: no short option at all (makes life easy)
@@ -370,7 +372,7 @@ def fancy_getopt(options, negative_opt, object, args):
return parser.getopt(args, object)
-WS_TRANS = {ord(_wschar) : ' ' for _wschar in string.whitespace}
+WS_TRANS = {ord(_wschar) : " " for _wschar in string.whitespace}
def wrap_text(text, width):
"""wrap_text(text : string, width : int) -> [string]
@@ -385,7 +387,7 @@ def wrap_text(text, width):
text = text.expandtabs()
text = text.translate(WS_TRANS)
- chunks = re.split(r'( +|-+)', text)
+ chunks = re.split(r"( +|-+)", text)
chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings
lines = []
@@ -401,7 +403,7 @@ def wrap_text(text, width):
cur_len = cur_len + l
else: # this line is full
# drop last chunk if all space
- if cur_line and cur_line[-1][0] == ' ':
+ if cur_line and cur_line[-1][0] == " ":
del cur_line[-1]
break
@@ -416,12 +418,12 @@ def wrap_text(text, width):
# all-whitespace chunks at the end of a line can be discarded
# (and we know from the re.split above that if a chunk has
# *any* whitespace, it is *all* whitespace)
- if chunks[0][0] == ' ':
+ if chunks[0][0] == " ":
del chunks[0]
# and store this line in the list-of-all-lines -- as a single
# string, of course!
- lines.append(''.join(cur_line))
+ lines.append("".join(cur_line))
return lines
diff --git a/.venv3.10/Lib/distutils/file_util.py b/.venv3.10/Lib/distutils/file_util.py
index b3fee35a..79acf8bb 100644
--- a/.venv3.10/Lib/distutils/file_util.py
+++ b/.venv3.10/Lib/distutils/file_util.py
@@ -8,9 +8,9 @@
from distutils import log
# for generating verbose output in 'copy_file()'
-_copy_action = { None: 'copying',
- 'hard': 'hard linking',
- 'sym': 'symbolically linking' }
+_copy_action = { None: "copying",
+ "hard": "hard linking",
+ "sym": "symbolically linking" }
def _copy_file_contents(src, dst, buffer_size=16*1024):
@@ -26,7 +26,7 @@ def _copy_file_contents(src, dst, buffer_size=16*1024):
fdst = None
try:
try:
- fsrc = open(src, 'rb')
+ fsrc = open(src, "rb")
except OSError as e:
raise DistutilsFileError("could not open '%s': %s" % (src, e.strerror))
@@ -38,7 +38,7 @@ def _copy_file_contents(src, dst, buffer_size=16*1024):
"could not delete '%s': %s" % (dst, e.strerror))
try:
- fdst = open(dst, 'wb')
+ fdst = open(dst, "wb")
except OSError as e:
raise DistutilsFileError(
"could not create '%s': %s" % (dst, e.strerror))
@@ -131,7 +131,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
# If linking (hard or symbolic), use the appropriate system call
# (Unix only, of course, but that's the caller's responsibility)
- elif link == 'hard':
+ elif link == "hard":
if not (os.path.exists(dst) and os.path.samefile(src, dst)):
try:
os.link(src, dst)
@@ -141,7 +141,7 @@ def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
# (some special filesystems don't support hard linking
# even under Unix, see issue #8876).
pass
- elif link == 'sym':
+ elif link == "sym":
if not (os.path.exists(dst) and os.path.samefile(src, dst)):
os.symlink(src, dst)
return (dst, 1)
diff --git a/.venv3.10/Lib/distutils/filelist.py b/.venv3.10/Lib/distutils/filelist.py
index c92d5fdb..2adaa3d0 100644
--- a/.venv3.10/Lib/distutils/filelist.py
+++ b/.venv3.10/Lib/distutils/filelist.py
@@ -4,7 +4,8 @@
and building lists of files.
"""
-import os, re
+import os
+import re
import fnmatch
import functools
from distutils.util import convert_path
@@ -79,19 +80,19 @@ def _parse_template_line(self, line):
patterns = dir = dir_pattern = None
- if action in ('include', 'exclude',
- 'global-include', 'global-exclude'):
+ if action in ("include", "exclude",
+ "global-include", "global-exclude"):
if len(words) < 2:
raise DistutilsTemplateError(
"'%s' expects ..." % action)
patterns = [convert_path(w) for w in words[1:]]
- elif action in ('recursive-include', 'recursive-exclude'):
+ elif action in ("recursive-include", "recursive-exclude"):
if len(words) < 3:
raise DistutilsTemplateError(
"'%s' expects ..." % action)
dir = convert_path(words[1])
patterns = [convert_path(w) for w in words[2:]]
- elif action in ('graft', 'prune'):
+ elif action in ("graft", "prune"):
if len(words) != 2:
raise DistutilsTemplateError(
"'%s' expects a single " % action)
@@ -112,60 +113,60 @@ def process_template_line(self, line):
# OK, now we know that the action is valid and we have the
# right number of words on the line for that action -- so we
# can proceed with minimal error-checking.
- if action == 'include':
- self.debug_print("include " + ' '.join(patterns))
+ if action == "include":
+ self.debug_print("include " + " ".join(patterns))
for pattern in patterns:
if not self.include_pattern(pattern, anchor=1):
log.warn("warning: no files found matching '%s'",
pattern)
- elif action == 'exclude':
- self.debug_print("exclude " + ' '.join(patterns))
+ elif action == "exclude":
+ self.debug_print("exclude " + " ".join(patterns))
for pattern in patterns:
if not self.exclude_pattern(pattern, anchor=1):
log.warn(("warning: no previously-included files "
"found matching '%s'"), pattern)
- elif action == 'global-include':
- self.debug_print("global-include " + ' '.join(patterns))
+ elif action == "global-include":
+ self.debug_print("global-include " + " ".join(patterns))
for pattern in patterns:
if not self.include_pattern(pattern, anchor=0):
log.warn(("warning: no files found matching '%s' "
"anywhere in distribution"), pattern)
- elif action == 'global-exclude':
- self.debug_print("global-exclude " + ' '.join(patterns))
+ elif action == "global-exclude":
+ self.debug_print("global-exclude " + " ".join(patterns))
for pattern in patterns:
if not self.exclude_pattern(pattern, anchor=0):
log.warn(("warning: no previously-included files matching "
"'%s' found anywhere in distribution"),
pattern)
- elif action == 'recursive-include':
+ elif action == "recursive-include":
self.debug_print("recursive-include %s %s" %
- (dir, ' '.join(patterns)))
+ (dir, " ".join(patterns)))
for pattern in patterns:
if not self.include_pattern(pattern, prefix=dir):
log.warn(("warning: no files found matching '%s' "
"under directory '%s'"),
pattern, dir)
- elif action == 'recursive-exclude':
+ elif action == "recursive-exclude":
self.debug_print("recursive-exclude %s %s" %
- (dir, ' '.join(patterns)))
+ (dir, " ".join(patterns)))
for pattern in patterns:
if not self.exclude_pattern(pattern, prefix=dir):
log.warn(("warning: no previously-included files matching "
"'%s' found under directory '%s'"),
pattern, dir)
- elif action == 'graft':
+ elif action == "graft":
self.debug_print("graft " + dir_pattern)
if not self.include_pattern(None, prefix=dir_pattern):
log.warn("warning: no directories found matching '%s'",
dir_pattern)
- elif action == 'prune':
+ elif action == "prune":
self.debug_print("prune " + dir_pattern)
if not self.exclude_pattern(None, prefix=dir_pattern):
log.warn(("no previously-included directories found "
@@ -281,12 +282,12 @@ def glob_to_re(pattern):
# any OS. So change all non-escaped dots in the RE to match any
# character except the special characters (currently: just os.sep).
sep = os.sep
- if os.sep == '\\':
+ if os.sep == "\\":
# we're using a regex to manipulate a regex, so we need
# to escape the backslash twice
- sep = r'\\\\'
- escaped = r'\1[^%s]' % sep
- pattern_re = re.sub(r'((?= self.threshold:
if args:
@@ -28,12 +28,12 @@ def _log(self, level, msg, args):
else:
stream = sys.stdout
try:
- stream.write('%s\n' % msg)
+ stream.write("%s\n" % msg)
except UnicodeEncodeError:
# emulate backslashreplace error handler
encoding = stream.encoding
msg = msg.encode(encoding, "backslashreplace").decode(encoding)
- stream.write('%s\n' % msg)
+ stream.write("%s\n" % msg)
stream.flush()
def log(self, level, msg, *args):
diff --git a/.venv3.10/Lib/distutils/msvc9compiler.py b/.venv3.10/Lib/distutils/msvc9compiler.py
index a7976fbe..9438337c 100644
--- a/.venv3.10/Lib/distutils/msvc9compiler.py
+++ b/.venv3.10/Lib/distutils/msvc9compiler.py
@@ -35,7 +35,7 @@
winreg.HKEY_LOCAL_MACHINE,
winreg.HKEY_CLASSES_ROOT)
-NATIVE_WIN64 = (sys.platform == 'win32' and sys.maxsize > 2**32)
+NATIVE_WIN64 = (sys.platform == "win32" and sys.maxsize > 2**32)
if NATIVE_WIN64:
# Visual C++ is a 32-bit application, so we need to look in
# the corresponding registry branch, if we're running a
@@ -52,8 +52,8 @@
# 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is
# the param to cross-compile on x86 targeting amd64.)
PLAT_TO_VCVARS = {
- 'win32' : 'x86',
- 'win-amd64' : 'amd64',
+ "win32" : "x86",
+ "win-amd64" : "amd64",
}
class Reg:
@@ -270,10 +270,10 @@ def query_vcvarsall(version, arch="x86"):
stdout = stdout.decode("mbcs")
for line in stdout.split("\n"):
line = Reg.convert_mbcs(line)
- if '=' not in line:
+ if "=" not in line:
continue
line = line.strip()
- key, value = line.split('=', 1)
+ key, value = line.split("=", 1)
key = key.lower()
if key in interesting:
if value.endswith(os.pathsep):
@@ -299,7 +299,7 @@ class MSVCCompiler(CCompiler) :
"""Concrete class that implements an interface to Microsoft Visual C++,
as defined by the CCompiler abstract class."""
- compiler_type = 'msvc'
+ compiler_type = "msvc"
# Just set this so CCompiler's constructor doesn't barf. We currently
# don't use the 'set_executables()' bureaucracy provided by CCompiler,
@@ -309,21 +309,21 @@ class MSVCCompiler(CCompiler) :
executables = {}
# Private class data (need to distinguish C from C++ source for compiler)
- _c_extensions = ['.c']
- _cpp_extensions = ['.cc', '.cpp', '.cxx']
- _rc_extensions = ['.rc']
- _mc_extensions = ['.mc']
+ _c_extensions = [".c"]
+ _cpp_extensions = [".cc", ".cpp", ".cxx"]
+ _rc_extensions = [".rc"]
+ _mc_extensions = [".mc"]
# Needed for the filename generation methods provided by the
# base class, CCompiler.
src_extensions = (_c_extensions + _cpp_extensions +
_rc_extensions + _mc_extensions)
- res_extension = '.res'
- obj_extension = '.obj'
- static_lib_extension = '.lib'
- shared_lib_extension = '.dll'
- static_lib_format = shared_lib_format = '%s%s'
- exe_extension = '.exe'
+ res_extension = ".res"
+ obj_extension = ".obj"
+ static_lib_extension = ".lib"
+ shared_lib_extension = ".dll"
+ static_lib_format = shared_lib_format = "%s%s"
+ exe_extension = ".exe"
def __init__(self, verbose=0, dry_run=0, force=0):
CCompiler.__init__ (self, verbose, dry_run, force)
@@ -342,7 +342,7 @@ def initialize(self, plat_name=None):
if plat_name is None:
plat_name = get_platform()
# sanity check for platforms to prevent obscure errors later.
- ok_plats = 'win32', 'win-amd64'
+ ok_plats = "win32", "win-amd64"
if plat_name not in ok_plats:
raise DistutilsPlatformError("--plat-name must be one of %s" %
(ok_plats,))
@@ -360,19 +360,19 @@ def initialize(self, plat_name=None):
# to cross compile, you use 'x86_amd64'.
# On AMD64, 'vcvars32.bat amd64' is a native build env; to cross
# compile use 'x86' (ie, it runs the x86 compiler directly)
- if plat_name == get_platform() or plat_name == 'win32':
+ if plat_name == get_platform() or plat_name == "win32":
# native build or cross-compile to win32
plat_spec = PLAT_TO_VCVARS[plat_name]
else:
# cross compile from win32 -> some 64bit
- plat_spec = PLAT_TO_VCVARS[get_platform()] + '_' + \
+ plat_spec = PLAT_TO_VCVARS[get_platform()] + "_" + \
PLAT_TO_VCVARS[plat_name]
vc_env = query_vcvarsall(VERSION, plat_spec)
- self.__paths = vc_env['path'].split(os.pathsep)
- os.environ['lib'] = vc_env['lib']
- os.environ['include'] = vc_env['include']
+ self.__paths = vc_env["path"].split(os.pathsep)
+ os.environ["lib"] = vc_env["lib"]
+ os.environ["include"] = vc_env["include"]
if len(self.__paths) == 0:
raise DistutilsPlatformError("Python was built with %s, "
@@ -390,32 +390,32 @@ def initialize(self, plat_name=None):
# extend the MSVC path with the current path
try:
- for p in os.environ['path'].split(';'):
+ for p in os.environ["path"].split(";"):
self.__paths.append(p)
except KeyError:
pass
self.__paths = normalize_and_reduce_paths(self.__paths)
- os.environ['path'] = ";".join(self.__paths)
+ os.environ["path"] = ";".join(self.__paths)
self.preprocess_options = None
if self.__arch == "x86":
- self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3',
- '/DNDEBUG']
- self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3',
- '/Z7', '/D_DEBUG']
+ self.compile_options = [ "/nologo", "/Ox", "/MD", "/W3",
+ "/DNDEBUG"]
+ self.compile_options_debug = ["/nologo", "/Od", "/MDd", "/W3",
+ "/Z7", "/D_DEBUG"]
else:
# Win64
- self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GS-' ,
- '/DNDEBUG']
- self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-',
- '/Z7', '/D_DEBUG']
+ self.compile_options = [ "/nologo", "/Ox", "/MD", "/W3", "/GS-" ,
+ "/DNDEBUG"]
+ self.compile_options_debug = ["/nologo", "/Od", "/MDd", "/W3", "/GS-",
+ "/Z7", "/D_DEBUG"]
- self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO']
+ self.ldflags_shared = ["/DLL", "/nologo", "/INCREMENTAL:NO"]
if self.__version >= 7:
self.ldflags_shared_debug = [
- '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG'
+ "/DLL", "/nologo", "/INCREMENTAL:no", "/DEBUG"
]
- self.ldflags_static = [ '/nologo']
+ self.ldflags_static = [ "/nologo"]
self.initialized = True
@@ -424,10 +424,10 @@ def initialize(self, plat_name=None):
def object_filenames(self,
source_filenames,
strip_dir=0,
- output_dir=''):
+ output_dir=""):
# Copied from ccompiler.py, extended to return .res as 'object'-file
# for .rc input file
- if output_dir is None: output_dir = ''
+ if output_dir is None: output_dir = ""
obj_names = []
for src_name in source_filenames:
(base, ext) = os.path.splitext (src_name)
@@ -463,7 +463,7 @@ def compile(self, sources,
macros, objects, extra_postargs, pp_opts, build = compile_info
compile_opts = extra_preargs or []
- compile_opts.append ('/c')
+ compile_opts.append ("/c")
if debug:
compile_opts.extend(self.compile_options_debug)
else:
@@ -511,9 +511,9 @@ def compile(self, sources,
try:
# first compile .MC to .RC and .H file
self.spawn([self.mc] +
- ['-h', h_dir, '-r', rc_dir] + [src])
+ ["-h", h_dir, "-r", rc_dir] + [src])
base, _ = os.path.splitext (os.path.basename (src))
- rc_file = os.path.join (rc_dir, base + '.rc')
+ rc_file = os.path.join (rc_dir, base + ".rc")
# then compile .RC to .RES file
self.spawn([self.rc] +
["/fo" + obj] + [rc_file])
@@ -551,7 +551,7 @@ def create_static_lib(self,
output_dir=output_dir)
if self._need_link(objects, output_filename):
- lib_args = objects + ['/OUT:' + output_filename]
+ lib_args = objects + ["/OUT:" + output_filename]
if debug:
pass # XXX what goes here?
try:
@@ -611,7 +611,7 @@ def link(self,
export_opts.append("/EXPORT:" + sym)
ld_args = (ldflags + lib_opts + export_opts +
- objects + ['/OUT:' + output_filename])
+ objects + ["/OUT:" + output_filename])
# The MSVC linker generates .lib and .exp files, which cannot be
# suppressed by any linker switches. The .lib files may even be
@@ -625,7 +625,7 @@ def link(self,
implib_file = os.path.join(
build_temp,
self.library_filename(dll_name))
- ld_args.append ('/IMPLIB:' + implib_file)
+ ld_args.append ("/IMPLIB:" + implib_file)
self.manifest_setup_ldargs(output_filename, build_temp, ld_args)
@@ -648,9 +648,9 @@ def link(self,
mfinfo = self.manifest_get_embed_info(target_desc, ld_args)
if mfinfo is not None:
mffilename, mfid = mfinfo
- out_arg = '-outputresource:%s;%s' % (output_filename, mfid)
+ out_arg = "-outputresource:%s;%s" % (output_filename, mfid)
try:
- self.spawn(['mt.exe', '-nologo', '-manifest',
+ self.spawn(["mt.exe", "-nologo", "-manifest",
mffilename, out_arg])
except DistutilsExecError as msg:
raise LinkError(msg)
@@ -667,7 +667,7 @@ def manifest_setup_ldargs(self, output_filename, build_temp, ld_args):
temp_manifest = os.path.join(
build_temp,
os.path.basename(output_filename) + ".manifest")
- ld_args.append('/MANIFESTFILE:' + temp_manifest)
+ ld_args.append("/MANIFESTFILE:" + temp_manifest)
def manifest_get_embed_info(self, target_desc, ld_args):
# If a manifest should be embedded, return a tuple of
@@ -723,7 +723,7 @@ def _remove_visual_c_ref(self, manifest_file):
if re.search(pattern, manifest_buf) is None:
return None
- manifest_f = open(manifest_file, 'w')
+ manifest_f = open(manifest_file, "w")
try:
manifest_f.write(manifest_buf)
return manifest_file
@@ -780,7 +780,7 @@ def find_exe(self, exe):
return fn
# didn't find it; try existing path
- for p in os.environ['Path'].split(';'):
+ for p in os.environ["Path"].split(";"):
fn = os.path.join(os.path.abspath(p),exe)
if os.path.isfile(fn):
return fn
diff --git a/.venv3.10/Lib/distutils/msvccompiler.py b/.venv3.10/Lib/distutils/msvccompiler.py
index d5857cb1..dcea267f 100644
--- a/.venv3.10/Lib/distutils/msvccompiler.py
+++ b/.venv3.10/Lib/distutils/msvccompiler.py
@@ -8,7 +8,8 @@
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
-import sys, os
+import sys
+import os
from distutils.errors import \
DistutilsExecError, DistutilsPlatformError, \
CompileError, LibError, LinkError
@@ -122,7 +123,7 @@ def load_macros(self, version):
self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
else:
self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
- except KeyError as exc: #
+ except KeyError: #
raise DistutilsPlatformError(
"""Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
@@ -201,7 +202,7 @@ class MSVCCompiler(CCompiler) :
"""Concrete class that implements an interface to Microsoft Visual C++,
as defined by the CCompiler abstract class."""
- compiler_type = 'msvc'
+ compiler_type = "msvc"
# Just set this so CCompiler's constructor doesn't barf. We currently
# don't use the 'set_executables()' bureaucracy provided by CCompiler,
@@ -211,21 +212,21 @@ class MSVCCompiler(CCompiler) :
executables = {}
# Private class data (need to distinguish C from C++ source for compiler)
- _c_extensions = ['.c']
- _cpp_extensions = ['.cc', '.cpp', '.cxx']
- _rc_extensions = ['.rc']
- _mc_extensions = ['.mc']
+ _c_extensions = [".c"]
+ _cpp_extensions = [".cc", ".cpp", ".cxx"]
+ _rc_extensions = [".rc"]
+ _mc_extensions = [".mc"]
# Needed for the filename generation methods provided by the
# base class, CCompiler.
src_extensions = (_c_extensions + _cpp_extensions +
_rc_extensions + _mc_extensions)
- res_extension = '.res'
- obj_extension = '.obj'
- static_lib_extension = '.lib'
- shared_lib_extension = '.dll'
- static_lib_format = shared_lib_format = '%s%s'
- exe_extension = '.exe'
+ res_extension = ".res"
+ obj_extension = ".obj"
+ static_lib_extension = ".lib"
+ shared_lib_extension = ".dll"
+ static_lib_format = shared_lib_format = "%s%s"
+ exe_extension = ".exe"
def __init__(self, verbose=0, dry_run=0, force=0):
CCompiler.__init__ (self, verbose, dry_run, force)
@@ -269,41 +270,41 @@ def initialize(self):
self.lib = self.find_exe("lib.exe")
self.rc = self.find_exe("rc.exe") # resource compiler
self.mc = self.find_exe("mc.exe") # message compiler
- self.set_path_env_var('lib')
- self.set_path_env_var('include')
+ self.set_path_env_var("lib")
+ self.set_path_env_var("include")
# extend the MSVC path with the current path
try:
- for p in os.environ['path'].split(';'):
+ for p in os.environ["path"].split(";"):
self.__paths.append(p)
except KeyError:
pass
self.__paths = normalize_and_reduce_paths(self.__paths)
- os.environ['path'] = ";".join(self.__paths)
+ os.environ["path"] = ";".join(self.__paths)
self.preprocess_options = None
if self.__arch == "Intel":
- self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' ,
- '/DNDEBUG']
- self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX',
- '/Z7', '/D_DEBUG']
+ self.compile_options = [ "/nologo", "/Ox", "/MD", "/W3", "/GX" ,
+ "/DNDEBUG"]
+ self.compile_options_debug = ["/nologo", "/Od", "/MDd", "/W3", "/GX",
+ "/Z7", "/D_DEBUG"]
else:
# Win64
- self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GS-' ,
- '/DNDEBUG']
- self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-',
- '/Z7', '/D_DEBUG']
+ self.compile_options = [ "/nologo", "/Ox", "/MD", "/W3", "/GS-" ,
+ "/DNDEBUG"]
+ self.compile_options_debug = ["/nologo", "/Od", "/MDd", "/W3", "/GS-",
+ "/Z7", "/D_DEBUG"]
- self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO']
+ self.ldflags_shared = ["/DLL", "/nologo", "/INCREMENTAL:NO"]
if self.__version >= 7:
self.ldflags_shared_debug = [
- '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG'
+ "/DLL", "/nologo", "/INCREMENTAL:no", "/DEBUG"
]
else:
self.ldflags_shared_debug = [
- '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG'
+ "/DLL", "/nologo", "/INCREMENTAL:no", "/pdb:None", "/DEBUG"
]
- self.ldflags_static = [ '/nologo']
+ self.ldflags_static = [ "/nologo"]
self.initialized = True
@@ -312,10 +313,10 @@ def initialize(self):
def object_filenames(self,
source_filenames,
strip_dir=0,
- output_dir=''):
+ output_dir=""):
# Copied from ccompiler.py, extended to return .res as 'object'-file
# for .rc input file
- if output_dir is None: output_dir = ''
+ if output_dir is None: output_dir = ""
obj_names = []
for src_name in source_filenames:
(base, ext) = os.path.splitext (src_name)
@@ -351,7 +352,7 @@ def compile(self, sources,
macros, objects, extra_postargs, pp_opts, build = compile_info
compile_opts = extra_preargs or []
- compile_opts.append ('/c')
+ compile_opts.append ("/c")
if debug:
compile_opts.extend(self.compile_options_debug)
else:
@@ -399,9 +400,9 @@ def compile(self, sources,
try:
# first compile .MC to .RC and .H file
self.spawn([self.mc] +
- ['-h', h_dir, '-r', rc_dir] + [src])
+ ["-h", h_dir, "-r", rc_dir] + [src])
base, _ = os.path.splitext (os.path.basename (src))
- rc_file = os.path.join (rc_dir, base + '.rc')
+ rc_file = os.path.join (rc_dir, base + ".rc")
# then compile .RC to .RES file
self.spawn([self.rc] +
["/fo" + obj] + [rc_file])
@@ -439,7 +440,7 @@ def create_static_lib(self,
output_dir=output_dir)
if self._need_link(objects, output_filename):
- lib_args = objects + ['/OUT:' + output_filename]
+ lib_args = objects + ["/OUT:" + output_filename]
if debug:
pass # XXX what goes here?
try:
@@ -499,7 +500,7 @@ def link(self,
export_opts.append("/EXPORT:" + sym)
ld_args = (ldflags + lib_opts + export_opts +
- objects + ['/OUT:' + output_filename])
+ objects + ["/OUT:" + output_filename])
# The MSVC linker generates .lib and .exp files, which cannot be
# suppressed by any linker switches. The .lib files may even be
@@ -512,7 +513,7 @@ def link(self,
implib_file = os.path.join(
os.path.dirname(objects[0]),
self.library_filename(dll_name))
- ld_args.append ('/IMPLIB:' + implib_file)
+ ld_args.append ("/IMPLIB:" + implib_file)
if extra_preargs:
ld_args[:0] = extra_preargs
@@ -577,14 +578,14 @@ def find_exe(self, exe):
return fn
# didn't find it; try existing path
- for p in os.environ['Path'].split(';'):
+ for p in os.environ["Path"].split(";"):
fn = os.path.join(os.path.abspath(p),exe)
if os.path.isfile(fn):
return fn
return exe
- def get_msvc_paths(self, path, platform='x86'):
+ def get_msvc_paths(self, path, platform="x86"):
"""Get a list of devstudio directories (include, lib or path).
Return a list of strings. The list will be empty if unable to
@@ -632,7 +633,7 @@ def set_path_env_var(self, name):
else:
p = self.get_msvc_paths(name)
if p:
- os.environ[name] = ';'.join(p)
+ os.environ[name] = ";".join(p)
if get_build_version() >= 8.0:
diff --git a/.venv3.10/Lib/distutils/spawn.py b/.venv3.10/Lib/distutils/spawn.py
index 31df3f7f..4784dc09 100644
--- a/.venv3.10/Lib/distutils/spawn.py
+++ b/.venv3.10/Lib/distutils/spawn.py
@@ -15,7 +15,7 @@
from distutils import log
-if sys.platform == 'darwin':
+if sys.platform == "darwin":
_cfg_target = None
_cfg_target_split = None
@@ -40,7 +40,7 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
# in, protect our %-formatting code against horrible death
cmd = list(cmd)
- log.info(' '.join(cmd))
+ log.info(" ".join(cmd))
if dry_run:
return
@@ -50,22 +50,22 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
cmd[0] = executable
env = None
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
global _cfg_target, _cfg_target_split
if _cfg_target is None:
from distutils import sysconfig
_cfg_target = sysconfig.get_config_var(
- 'MACOSX_DEPLOYMENT_TARGET') or ''
+ "MACOSX_DEPLOYMENT_TARGET") or ""
if _cfg_target:
- _cfg_target_split = [int(x) for x in _cfg_target.split('.')]
+ _cfg_target_split = [int(x) for x in _cfg_target.split(".")]
if _cfg_target:
# Ensure that the deployment target of the build process is not
# less than 10.3 if the interpreter was built for 10.3 or later.
# This ensures extension modules are built with correct
# compatibility values, specifically LDSHARED which can use
# '-undefined dynamic_lookup' which only works on >= 10.3.
- cur_target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', _cfg_target)
- cur_target_split = [int(x) for x in cur_target.split('.')]
+ cur_target = os.environ.get("MACOSX_DEPLOYMENT_TARGET", _cfg_target)
+ cur_target_split = [int(x) for x in cur_target.split(".")]
if _cfg_target_split[:2] >= [10, 3] and cur_target_split[:2] < [10, 3]:
my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: '
'now "%s" but "%s" during configure;'
@@ -99,14 +99,14 @@ def find_executable(executable, path=None):
os.environ['PATH']. Returns the complete filename or None if not found.
"""
_, ext = os.path.splitext(executable)
- if (sys.platform == 'win32') and (ext != '.exe'):
- executable = executable + '.exe'
+ if (sys.platform == "win32") and (ext != ".exe"):
+ executable = executable + ".exe"
if os.path.isfile(executable):
return executable
if path is None:
- path = os.environ.get('PATH', None)
+ path = os.environ.get("PATH", None)
if path is None:
try:
path = os.confstr("CS_PATH")
diff --git a/.venv3.10/Lib/distutils/sysconfig.py b/.venv3.10/Lib/distutils/sysconfig.py
index 07bb42df..05c21ac1 100644
--- a/.venv3.10/Lib/distutils/sysconfig.py
+++ b/.venv3.10/Lib/distutils/sysconfig.py
@@ -9,7 +9,6 @@
Email:
"""
-import _imp
import os
import re
import sys
@@ -30,19 +29,15 @@
parse_config_h as sysconfig_parse_config_h,
_init_non_posix,
- _is_python_source_dir,
_sys_home,
_variable_rx,
_findvar1_rx,
_findvar2_rx,
- expand_makefile_vars,
is_python_build,
- get_config_h_filename,
get_config_var,
get_config_vars,
- get_makefile_filename,
get_python_version,
)
@@ -53,10 +48,10 @@
_config_vars = get_config_vars()
if os.name == "nt":
- from sysconfig import _fix_pcbuild
+ pass
warnings.warn(
- 'The distutils.sysconfig module is deprecated, use sysconfig instead',
+ "The distutils.sysconfig module is deprecated, use sysconfig instead",
DeprecationWarning,
stacklevel=2
)
@@ -97,7 +92,7 @@ def parse_makefile(fn, g=None):
n, v = m.group(1, 2)
v = v.strip()
# `$$' is a literal `$' in make
- tmpv = v.replace('$$', '')
+ tmpv = v.replace("$$", "")
if "$" in tmpv:
notdone[n] = v
@@ -106,7 +101,7 @@ def parse_makefile(fn, g=None):
v = int(v)
except ValueError:
# insert literal `$'
- done[n] = v.replace('$$', '$')
+ done[n] = v.replace("$$", "$")
else:
done[n] = v
@@ -114,7 +109,7 @@ def parse_makefile(fn, g=None):
# be made available without that prefix through sysconfig.
# Special care is needed to ensure that variable expansion works, even
# if the expansion uses the name without a prefix.
- renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
+ renamed_variables = ("CFLAGS", "LDFLAGS", "CPPFLAGS")
# do variable interpolation here
while notdone:
@@ -134,14 +129,14 @@ def parse_makefile(fn, g=None):
item = os.environ[n]
elif n in renamed_variables:
- if name.startswith('PY_') and name[3:] in renamed_variables:
+ if name.startswith("PY_") and name[3:] in renamed_variables:
item = ""
- elif 'PY_' + n in notdone:
+ elif "PY_" + n in notdone:
found = False
else:
- item = str(done['PY_' + n])
+ item = str(done["PY_" + n])
else:
done[n] = item = ""
if found:
@@ -157,7 +152,7 @@ def parse_makefile(fn, g=None):
done[name] = value
del notdone[name]
- if name.startswith('PY_') \
+ if name.startswith("PY_") \
and name[3:] in renamed_variables:
name = name[3:]
@@ -185,7 +180,7 @@ def parse_makefile(fn, g=None):
# Calculate the build qualifier flags if they are defined. Adding the flags
# to the include and lib directories only makes sense for an installation, not
# an in-source build.
-build_flags = ''
+build_flags = ""
try:
if not python_build:
build_flags = sys.abiflags
@@ -211,59 +206,59 @@ def customize_compiler(compiler):
# that Python itself was built on. Also the user OS
# version and build tools may not support the same set
# of CPU architectures for universal builds.
- if not _config_vars.get('CUSTOMIZED_OSX_COMPILER'):
+ if not _config_vars.get("CUSTOMIZED_OSX_COMPILER"):
import _osx_support
_osx_support.customize_compiler(_config_vars)
- _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'
+ _config_vars["CUSTOMIZED_OSX_COMPILER"] = "True"
(cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
- get_config_vars('CC', 'CXX', 'CFLAGS',
- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
+ get_config_vars("CC", "CXX", "CFLAGS",
+ "CCSHARED", "LDSHARED", "SHLIB_SUFFIX", "AR", "ARFLAGS")
- if 'CC' in os.environ:
- newcc = os.environ['CC']
- if ('LDSHARED' not in os.environ
+ if "CC" in os.environ:
+ newcc = os.environ["CC"]
+ if ("LDSHARED" not in os.environ
and ldshared.startswith(cc)):
# If CC is overridden, use that as the default
# command for LDSHARED as well
ldshared = newcc + ldshared[len(cc):]
cc = newcc
- if 'CXX' in os.environ:
- cxx = os.environ['CXX']
- if 'LDSHARED' in os.environ:
- ldshared = os.environ['LDSHARED']
- if 'CPP' in os.environ:
- cpp = os.environ['CPP']
+ if "CXX" in os.environ:
+ cxx = os.environ["CXX"]
+ if "LDSHARED" in os.environ:
+ ldshared = os.environ["LDSHARED"]
+ if "CPP" in os.environ:
+ cpp = os.environ["CPP"]
else:
cpp = cc + " -E" # not always
- if 'LDFLAGS' in os.environ:
- ldshared = ldshared + ' ' + os.environ['LDFLAGS']
- if 'CFLAGS' in os.environ:
- cflags = cflags + ' ' + os.environ['CFLAGS']
- ldshared = ldshared + ' ' + os.environ['CFLAGS']
- if 'CPPFLAGS' in os.environ:
- cpp = cpp + ' ' + os.environ['CPPFLAGS']
- cflags = cflags + ' ' + os.environ['CPPFLAGS']
- ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
- if 'AR' in os.environ:
- ar = os.environ['AR']
- if 'ARFLAGS' in os.environ:
- archiver = ar + ' ' + os.environ['ARFLAGS']
+ if "LDFLAGS" in os.environ:
+ ldshared = ldshared + " " + os.environ["LDFLAGS"]
+ if "CFLAGS" in os.environ:
+ cflags = cflags + " " + os.environ["CFLAGS"]
+ ldshared = ldshared + " " + os.environ["CFLAGS"]
+ if "CPPFLAGS" in os.environ:
+ cpp = cpp + " " + os.environ["CPPFLAGS"]
+ cflags = cflags + " " + os.environ["CPPFLAGS"]
+ ldshared = ldshared + " " + os.environ["CPPFLAGS"]
+ if "AR" in os.environ:
+ ar = os.environ["AR"]
+ if "ARFLAGS" in os.environ:
+ archiver = ar + " " + os.environ["ARFLAGS"]
else:
- archiver = ar + ' ' + ar_flags
+ archiver = ar + " " + ar_flags
- cc_cmd = cc + ' ' + cflags
+ cc_cmd = cc + " " + cflags
compiler.set_executables(
preprocessor=cpp,
compiler=cc_cmd,
- compiler_so=cc_cmd + ' ' + ccshared,
+ compiler_so=cc_cmd + " " + ccshared,
compiler_cxx=cxx,
linker_so=ldshared,
linker_exe=cc,
archiver=archiver)
- if 'RANLIB' in os.environ and 'ranlib' in compiler.executables:
- compiler.set_executables(ranlib=os.environ['RANLIB'])
+ if "RANLIB" in os.environ and "ranlib" in compiler.executables:
+ compiler.set_executables(ranlib=os.environ["RANLIB"])
compiler.shared_lib_extension = shlib_suffix
@@ -291,9 +286,9 @@ def get_python_inc(plat_specific=0, prefix=None):
if plat_specific:
return _sys_home or project_base
else:
- incdir = os.path.join(get_config_var('srcdir'), 'Include')
+ incdir = os.path.join(get_config_var("srcdir"), "Include")
return os.path.normpath(incdir)
- python_dir = 'python' + get_python_version() + build_flags
+ python_dir = "python" + get_python_version() + build_flags
return os.path.join(prefix, "include", python_dir)
elif os.name == "nt":
if python_build:
diff --git a/.venv3.10/Lib/distutils/tests/support.py b/.venv3.10/Lib/distutils/tests/support.py
index 23b907b6..fd421383 100644
--- a/.venv3.10/Lib/distutils/tests/support.py
+++ b/.venv3.10/Lib/distutils/tests/support.py
@@ -32,7 +32,7 @@ def tearDown(self):
def _log(self, level, msg, args):
if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
- raise ValueError('%s wrong log level' % str(level))
+ raise ValueError("%s wrong log level" % str(level))
if not isinstance(msg, str):
raise TypeError("msg should be str, not '%.200s'"
% (type(msg).__name__))
@@ -75,7 +75,7 @@ def mkdtemp(self):
self.tempdirs.append(d)
return d
- def write_file(self, path, content='xxx'):
+ def write_file(self, path, content="xxx"):
"""Writes a file in the given path.
@@ -83,13 +83,13 @@ def write_file(self, path, content='xxx'):
"""
if isinstance(path, (list, tuple)):
path = os.path.join(*path)
- f = open(path, 'w')
+ f = open(path, "w")
try:
f.write(content)
finally:
f.close()
- def create_dist(self, pkg_name='foo', **kw):
+ def create_dist(self, pkg_name="foo", **kw):
"""Will generate a test environment.
This function creates:
@@ -150,22 +150,22 @@ def test_compile(self):
"""
filename = _get_xxmodule_path()
if filename is None:
- raise unittest.SkipTest('cannot find xxmodule.c (test must run in '
- 'the python build dir)')
+ raise unittest.SkipTest("cannot find xxmodule.c (test must run in "
+ "the python build dir)")
shutil.copy(filename, directory)
def _get_xxmodule_path():
- srcdir = sysconfig.get_config_var('srcdir')
+ srcdir = sysconfig.get_config_var("srcdir")
candidates = [
# use installed copy if available
- os.path.join(os.path.dirname(__file__), 'xxmodule.c'),
+ os.path.join(os.path.dirname(__file__), "xxmodule.c"),
# otherwise try using copy from build directory
- os.path.join(srcdir, 'Modules', 'xxmodule.c'),
+ os.path.join(srcdir, "Modules", "xxmodule.c"),
# srcdir mysteriously can be $srcdir/Lib/distutils/tests when
# this file is run from its parent directory, so walk up the
# tree to find the real srcdir
- os.path.join(srcdir, '..', '..', '..', 'Modules', 'xxmodule.c'),
+ os.path.join(srcdir, "..", "..", "..", "Modules", "xxmodule.c"),
]
for path in candidates:
if os.path.exists(path):
@@ -192,18 +192,18 @@ def fixup_build_ext(cmd):
Unlike most other Unix platforms, Mac OS X embeds absolute paths
to shared libraries into executables, so the fixup is not needed there.
"""
- if os.name == 'nt':
- cmd.debug = sys.executable.endswith('_d.exe')
- elif sysconfig.get_config_var('Py_ENABLE_SHARED'):
+ if os.name == "nt":
+ cmd.debug = sys.executable.endswith("_d.exe")
+ elif sysconfig.get_config_var("Py_ENABLE_SHARED"):
# To further add to the shared builds fun on Unix, we can't just add
# library_dirs to the Extension() instance because that doesn't get
# plumbed through to the final compiler command.
- runshared = sysconfig.get_config_var('RUNSHARED')
+ runshared = sysconfig.get_config_var("RUNSHARED")
if runshared is None:
- cmd.library_dirs = ['.']
+ cmd.library_dirs = ["."]
else:
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
cmd.library_dirs = []
else:
- name, equals, value = runshared.partition('=')
+ name, equals, value = runshared.partition("=")
cmd.library_dirs = [d for d in value.split(os.pathsep) if d]
diff --git a/.venv3.10/Lib/distutils/tests/test_archive_util.py b/.venv3.10/Lib/distutils/tests/test_archive_util.py
index edcec251..c725b0a0 100644
--- a/.venv3.10/Lib/distutils/tests/test_archive_util.py
+++ b/.venv3.10/Lib/distutils/tests/test_archive_util.py
@@ -28,7 +28,7 @@
import zipfile
ZIP_SUPPORT = True
except ImportError:
- ZIP_SUPPORT = find_executable('zip')
+ ZIP_SUPPORT = find_executable("zip")
try:
import zlib
@@ -63,45 +63,45 @@ class ArchiveUtilTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
- def test_make_tarball(self, name='archive'):
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
+ def test_make_tarball(self, name="archive"):
# creating something to tar
tmpdir = self._create_files()
- self._make_tarball(tmpdir, name, '.tar.gz')
+ self._make_tarball(tmpdir, name, ".tar.gz")
# trying an uncompressed one
- self._make_tarball(tmpdir, name, '.tar', compress=None)
+ self._make_tarball(tmpdir, name, ".tar", compress=None)
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_make_tarball_gzip(self):
tmpdir = self._create_files()
- self._make_tarball(tmpdir, 'archive', '.tar.gz', compress='gzip')
+ self._make_tarball(tmpdir, "archive", ".tar.gz", compress="gzip")
- @unittest.skipUnless(bz2, 'Need bz2 support to run')
+ @unittest.skipUnless(bz2, "Need bz2 support to run")
def test_make_tarball_bzip2(self):
tmpdir = self._create_files()
- self._make_tarball(tmpdir, 'archive', '.tar.bz2', compress='bzip2')
+ self._make_tarball(tmpdir, "archive", ".tar.bz2", compress="bzip2")
- @unittest.skipUnless(lzma, 'Need lzma support to run')
+ @unittest.skipUnless(lzma, "Need lzma support to run")
def test_make_tarball_xz(self):
tmpdir = self._create_files()
- self._make_tarball(tmpdir, 'archive', '.tar.xz', compress='xz')
+ self._make_tarball(tmpdir, "archive", ".tar.xz", compress="xz")
- @unittest.skipUnless(can_fs_encode('årchiv'),
- 'File system cannot handle this filename')
+ @unittest.skipUnless(can_fs_encode("årchiv"),
+ "File system cannot handle this filename")
def test_make_tarball_latin1(self):
"""
Mirror test_make_tarball, except filename contains latin characters.
"""
- self.test_make_tarball('årchiv') # note this isn't a real word
+ self.test_make_tarball("årchiv") # note this isn't a real word
- @unittest.skipUnless(can_fs_encode('のアーカイブ'),
- 'File system cannot handle this filename')
+ @unittest.skipUnless(can_fs_encode("のアーカイブ"),
+ "File system cannot handle this filename")
def test_make_tarball_extended(self):
"""
Mirror test_make_tarball, except filename contains extended
characters outside the latin charset.
"""
- self.test_make_tarball('のアーカイブ') # japanese for archive
+ self.test_make_tarball("のアーカイブ") # japanese for archive
def _make_tarball(self, tmpdir, target_name, suffix, **kwargs):
tmpdir2 = self.mkdtemp()
@@ -112,7 +112,7 @@ def _make_tarball(self, tmpdir, target_name, suffix, **kwargs):
# working with relative paths to avoid tar warnings
with change_cwd(tmpdir):
- make_tarball(splitdrive(base_name)[1], 'dist', **kwargs)
+ make_tarball(splitdrive(base_name)[1], "dist", **kwargs)
# check if the compressed tarball was created
tarball = base_name + suffix
@@ -128,44 +128,44 @@ def _tarinfo(self, path):
finally:
tar.close()
- _zip_created_files = ['dist/', 'dist/file1', 'dist/file2',
- 'dist/sub/', 'dist/sub/file3', 'dist/sub2/']
- _created_files = [p.rstrip('/') for p in _zip_created_files]
+ _zip_created_files = ["dist/", "dist/file1", "dist/file2",
+ "dist/sub/", "dist/sub/file3", "dist/sub2/"]
+ _created_files = [p.rstrip("/") for p in _zip_created_files]
def _create_files(self):
# creating something to tar
tmpdir = self.mkdtemp()
- dist = os.path.join(tmpdir, 'dist')
+ dist = os.path.join(tmpdir, "dist")
os.mkdir(dist)
- self.write_file([dist, 'file1'], 'xxx')
- self.write_file([dist, 'file2'], 'xxx')
- os.mkdir(os.path.join(dist, 'sub'))
- self.write_file([dist, 'sub', 'file3'], 'xxx')
- os.mkdir(os.path.join(dist, 'sub2'))
+ self.write_file([dist, "file1"], "xxx")
+ self.write_file([dist, "file2"], "xxx")
+ os.mkdir(os.path.join(dist, "sub"))
+ self.write_file([dist, "sub", "file3"], "xxx")
+ os.mkdir(os.path.join(dist, "sub2"))
return tmpdir
- @unittest.skipUnless(find_executable('tar') and find_executable('gzip')
+ @unittest.skipUnless(find_executable("tar") and find_executable("gzip")
and ZLIB_SUPPORT,
- 'Need the tar, gzip and zlib command to run')
+ "Need the tar, gzip and zlib command to run")
def test_tarfile_vs_tar(self):
tmpdir = self._create_files()
tmpdir2 = self.mkdtemp()
- base_name = os.path.join(tmpdir2, 'archive')
+ base_name = os.path.join(tmpdir2, "archive")
old_dir = os.getcwd()
os.chdir(tmpdir)
try:
- make_tarball(base_name, 'dist')
+ make_tarball(base_name, "dist")
finally:
os.chdir(old_dir)
# check if the compressed tarball was created
- tarball = base_name + '.tar.gz'
+ tarball = base_name + ".tar.gz"
self.assertTrue(os.path.exists(tarball))
# now create another tarball using `tar`
- tarball2 = os.path.join(tmpdir, 'archive2.tar.gz')
- tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist']
- gzip_cmd = ['gzip', '-f', '-9', 'archive2.tar']
+ tarball2 = os.path.join(tmpdir, "archive2.tar.gz")
+ tar_cmd = ["tar", "-cf", "archive2.tar", "dist"]
+ gzip_cmd = ["gzip", "-f", "-9", "archive2.tar"]
old_dir = os.getcwd()
os.chdir(tmpdir)
try:
@@ -180,32 +180,32 @@ def test_tarfile_vs_tar(self):
self.assertEqual(self._tarinfo(tarball2), self._created_files)
# trying an uncompressed one
- base_name = os.path.join(tmpdir2, 'archive')
+ base_name = os.path.join(tmpdir2, "archive")
old_dir = os.getcwd()
os.chdir(tmpdir)
try:
- make_tarball(base_name, 'dist', compress=None)
+ make_tarball(base_name, "dist", compress=None)
finally:
os.chdir(old_dir)
- tarball = base_name + '.tar'
+ tarball = base_name + ".tar"
self.assertTrue(os.path.exists(tarball))
# now for a dry_run
- base_name = os.path.join(tmpdir2, 'archive')
+ base_name = os.path.join(tmpdir2, "archive")
old_dir = os.getcwd()
os.chdir(tmpdir)
try:
- make_tarball(base_name, 'dist', compress=None, dry_run=True)
+ make_tarball(base_name, "dist", compress=None, dry_run=True)
finally:
os.chdir(old_dir)
- tarball = base_name + '.tar'
+ tarball = base_name + ".tar"
self.assertTrue(os.path.exists(tarball))
- @unittest.skipUnless(find_executable('compress'),
- 'The compress program is required')
+ @unittest.skipUnless(find_executable("compress"),
+ "The compress program is required")
def test_compress_deprecated(self):
tmpdir = self._create_files()
- base_name = os.path.join(self.mkdtemp(), 'archive')
+ base_name = os.path.join(self.mkdtemp(), "archive")
# using compress and testing the PendingDeprecationWarning
old_dir = os.getcwd()
@@ -213,10 +213,10 @@ def test_compress_deprecated(self):
try:
with check_warnings() as w:
warnings.simplefilter("always")
- make_tarball(base_name, 'dist', compress='compress')
+ make_tarball(base_name, "dist", compress="compress")
finally:
os.chdir(old_dir)
- tarball = base_name + '.tar.Z'
+ tarball = base_name + ".tar.Z"
self.assertTrue(os.path.exists(tarball))
self.assertEqual(len(w.warnings), 1)
@@ -227,7 +227,7 @@ def test_compress_deprecated(self):
try:
with check_warnings() as w:
warnings.simplefilter("always")
- make_tarball(base_name, 'dist', compress='compress',
+ make_tarball(base_name, "dist", compress="compress",
dry_run=True)
finally:
os.chdir(old_dir)
@@ -235,104 +235,104 @@ def test_compress_deprecated(self):
self.assertEqual(len(w.warnings), 1)
@unittest.skipUnless(ZIP_SUPPORT and ZLIB_SUPPORT,
- 'Need zip and zlib support to run')
+ "Need zip and zlib support to run")
def test_make_zipfile(self):
# creating something to tar
tmpdir = self._create_files()
- base_name = os.path.join(self.mkdtemp(), 'archive')
+ base_name = os.path.join(self.mkdtemp(), "archive")
with change_cwd(tmpdir):
- make_zipfile(base_name, 'dist')
+ make_zipfile(base_name, "dist")
# check if the compressed tarball was created
- tarball = base_name + '.zip'
+ tarball = base_name + ".zip"
self.assertTrue(os.path.exists(tarball))
with zipfile.ZipFile(tarball) as zf:
self.assertEqual(sorted(zf.namelist()), self._zip_created_files)
- @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')
+ @unittest.skipUnless(ZIP_SUPPORT, "Need zip support to run")
def test_make_zipfile_no_zlib(self):
- patch(self, archive_util.zipfile, 'zlib', None) # force zlib ImportError
+ patch(self, archive_util.zipfile, "zlib", None) # force zlib ImportError
called = []
zipfile_class = zipfile.ZipFile
def fake_zipfile(*a, **kw):
- if kw.get('compression', None) == zipfile.ZIP_STORED:
+ if kw.get("compression", None) == zipfile.ZIP_STORED:
called.append((a, kw))
return zipfile_class(*a, **kw)
- patch(self, archive_util.zipfile, 'ZipFile', fake_zipfile)
+ patch(self, archive_util.zipfile, "ZipFile", fake_zipfile)
# create something to tar and compress
tmpdir = self._create_files()
- base_name = os.path.join(self.mkdtemp(), 'archive')
+ base_name = os.path.join(self.mkdtemp(), "archive")
with change_cwd(tmpdir):
- make_zipfile(base_name, 'dist')
+ make_zipfile(base_name, "dist")
- tarball = base_name + '.zip'
+ tarball = base_name + ".zip"
self.assertEqual(called,
- [((tarball, "w"), {'compression': zipfile.ZIP_STORED})])
+ [((tarball, "w"), {"compression": zipfile.ZIP_STORED})])
self.assertTrue(os.path.exists(tarball))
with zipfile.ZipFile(tarball) as zf:
self.assertEqual(sorted(zf.namelist()), self._zip_created_files)
def test_check_archive_formats(self):
- self.assertEqual(check_archive_formats(['gztar', 'xxx', 'zip']),
- 'xxx')
- self.assertIsNone(check_archive_formats(['gztar', 'bztar', 'xztar',
- 'ztar', 'tar', 'zip']))
+ self.assertEqual(check_archive_formats(["gztar", "xxx", "zip"]),
+ "xxx")
+ self.assertIsNone(check_archive_formats(["gztar", "bztar", "xztar",
+ "ztar", "tar", "zip"]))
def test_make_archive(self):
tmpdir = self.mkdtemp()
- base_name = os.path.join(tmpdir, 'archive')
- self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+ base_name = os.path.join(tmpdir, "archive")
+ self.assertRaises(ValueError, make_archive, base_name, "xxx")
def test_make_archive_cwd(self):
current_dir = os.getcwd()
def _breaks(*args, **kw):
raise RuntimeError()
- ARCHIVE_FORMATS['xxx'] = (_breaks, [], 'xxx file')
+ ARCHIVE_FORMATS["xxx"] = (_breaks, [], "xxx file")
try:
try:
- make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
+ make_archive("xxx", "xxx", root_dir=self.mkdtemp())
except:
pass
self.assertEqual(os.getcwd(), current_dir)
finally:
- del ARCHIVE_FORMATS['xxx']
+ del ARCHIVE_FORMATS["xxx"]
def test_make_archive_tar(self):
base_dir = self._create_files()
- base_name = os.path.join(self.mkdtemp() , 'archive')
- res = make_archive(base_name, 'tar', base_dir, 'dist')
+ base_name = os.path.join(self.mkdtemp() , "archive")
+ res = make_archive(base_name, "tar", base_dir, "dist")
self.assertTrue(os.path.exists(res))
- self.assertEqual(os.path.basename(res), 'archive.tar')
+ self.assertEqual(os.path.basename(res), "archive.tar")
self.assertEqual(self._tarinfo(res), self._created_files)
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_make_archive_gztar(self):
base_dir = self._create_files()
- base_name = os.path.join(self.mkdtemp() , 'archive')
- res = make_archive(base_name, 'gztar', base_dir, 'dist')
+ base_name = os.path.join(self.mkdtemp() , "archive")
+ res = make_archive(base_name, "gztar", base_dir, "dist")
self.assertTrue(os.path.exists(res))
- self.assertEqual(os.path.basename(res), 'archive.tar.gz')
+ self.assertEqual(os.path.basename(res), "archive.tar.gz")
self.assertEqual(self._tarinfo(res), self._created_files)
- @unittest.skipUnless(bz2, 'Need bz2 support to run')
+ @unittest.skipUnless(bz2, "Need bz2 support to run")
def test_make_archive_bztar(self):
base_dir = self._create_files()
- base_name = os.path.join(self.mkdtemp() , 'archive')
- res = make_archive(base_name, 'bztar', base_dir, 'dist')
+ base_name = os.path.join(self.mkdtemp() , "archive")
+ res = make_archive(base_name, "bztar", base_dir, "dist")
self.assertTrue(os.path.exists(res))
- self.assertEqual(os.path.basename(res), 'archive.tar.bz2')
+ self.assertEqual(os.path.basename(res), "archive.tar.bz2")
self.assertEqual(self._tarinfo(res), self._created_files)
- @unittest.skipUnless(lzma, 'Need xz support to run')
+ @unittest.skipUnless(lzma, "Need xz support to run")
def test_make_archive_xztar(self):
base_dir = self._create_files()
- base_name = os.path.join(self.mkdtemp() , 'archive')
- res = make_archive(base_name, 'xztar', base_dir, 'dist')
+ base_name = os.path.join(self.mkdtemp() , "archive")
+ res = make_archive(base_name, "xztar", base_dir, "dist")
self.assertTrue(os.path.exists(res))
- self.assertEqual(os.path.basename(res), 'archive.tar.xz')
+ self.assertEqual(os.path.basename(res), "archive.tar.xz")
self.assertEqual(self._tarinfo(res), self._created_files)
def test_make_archive_owner_group(self):
@@ -342,37 +342,37 @@ def test_make_archive_owner_group(self):
group = grp.getgrgid(0)[0]
owner = pwd.getpwuid(0)[0]
else:
- group = owner = 'root'
+ group = owner = "root"
base_dir = self._create_files()
root_dir = self.mkdtemp()
- base_name = os.path.join(self.mkdtemp() , 'archive')
- res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner,
+ base_name = os.path.join(self.mkdtemp() , "archive")
+ res = make_archive(base_name, "zip", root_dir, base_dir, owner=owner,
group=group)
self.assertTrue(os.path.exists(res))
- res = make_archive(base_name, 'zip', root_dir, base_dir)
+ res = make_archive(base_name, "zip", root_dir, base_dir)
self.assertTrue(os.path.exists(res))
- res = make_archive(base_name, 'tar', root_dir, base_dir,
+ res = make_archive(base_name, "tar", root_dir, base_dir,
owner=owner, group=group)
self.assertTrue(os.path.exists(res))
- res = make_archive(base_name, 'tar', root_dir, base_dir,
- owner='kjhkjhkjg', group='oihohoh')
+ res = make_archive(base_name, "tar", root_dir, base_dir,
+ owner="kjhkjhkjg", group="oihohoh")
self.assertTrue(os.path.exists(res))
@unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib")
@unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
def test_tarfile_root_owner(self):
tmpdir = self._create_files()
- base_name = os.path.join(self.mkdtemp(), 'archive')
+ base_name = os.path.join(self.mkdtemp(), "archive")
old_dir = os.getcwd()
os.chdir(tmpdir)
group = grp.getgrgid(0)[0]
owner = pwd.getpwuid(0)[0]
try:
- archive_name = make_tarball(base_name, 'dist', compress=None,
+ archive_name = make_tarball(base_name, "dist", compress=None,
owner=owner, group=group)
finally:
os.chdir(old_dir)
diff --git a/.venv3.10/Lib/distutils/tests/test_bdist.py b/.venv3.10/Lib/distutils/tests/test_bdist.py
index 55fa3930..c31ad74f 100644
--- a/.venv3.10/Lib/distutils/tests/test_bdist.py
+++ b/.venv3.10/Lib/distutils/tests/test_bdist.py
@@ -5,7 +5,7 @@
import warnings
with warnings.catch_warnings():
- warnings.simplefilter('ignore', DeprecationWarning)
+ warnings.simplefilter("ignore", DeprecationWarning)
from distutils.command.bdist import bdist
from distutils.tests import support
@@ -18,13 +18,13 @@ def test_formats(self):
# we can set the format
dist = self.create_dist()[1]
cmd = bdist(dist)
- cmd.formats = ['msi']
+ cmd.formats = ["msi"]
cmd.ensure_finalized()
- self.assertEqual(cmd.formats, ['msi'])
+ self.assertEqual(cmd.formats, ["msi"])
# what formats does bdist offer?
- formats = ['bztar', 'gztar', 'msi', 'rpm', 'tar',
- 'xztar', 'zip', 'ztar']
+ formats = ["bztar", "gztar", "msi", "rpm", "tar",
+ "xztar", "zip", "ztar"]
found = sorted(cmd.format_command)
self.assertEqual(found, formats)
@@ -34,23 +34,23 @@ def test_skip_build(self):
cmd = bdist(dist)
cmd.skip_build = 1
cmd.ensure_finalized()
- dist.command_obj['bdist'] = cmd
+ dist.command_obj["bdist"] = cmd
- names = ['bdist_dumb'] # bdist_rpm does not support --skip-build
- if os.name == 'nt':
- names.append('bdist_msi')
+ names = ["bdist_dumb"] # bdist_rpm does not support --skip-build
+ if os.name == "nt":
+ names.append("bdist_msi")
for name in names:
subcmd = cmd.get_finalized_command(name)
- if getattr(subcmd, '_unsupported', False):
+ if getattr(subcmd, "_unsupported", False):
# command is not supported on this build
continue
self.assertTrue(subcmd.skip_build,
- '%s should take --skip-build from bdist' % name)
+ "%s should take --skip-build from bdist" % name)
def test_suite():
return unittest.makeSuite(BuildTestCase)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_bdist_dumb.py b/.venv3.10/Lib/distutils/tests/test_bdist_dumb.py
index 01a233bc..8fc2fce6 100644
--- a/.venv3.10/Lib/distutils/tests/test_bdist_dumb.py
+++ b/.venv3.10/Lib/distutils/tests/test_bdist_dumb.py
@@ -42,56 +42,56 @@ def tearDown(self):
sys.argv[:] = self.old_sys_argv[1]
super(BuildDumbTestCase, self).tearDown()
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_simple_built(self):
# let's create a simple package
tmp_dir = self.mkdtemp()
- pkg_dir = os.path.join(tmp_dir, 'foo')
+ pkg_dir = os.path.join(tmp_dir, "foo")
os.mkdir(pkg_dir)
- self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
- self.write_file((pkg_dir, 'foo.py'), '#')
- self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
- self.write_file((pkg_dir, 'README'), '')
-
- dist = Distribution({'name': 'foo', 'version': '0.1',
- 'py_modules': ['foo'],
- 'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx'})
- dist.script_name = 'setup.py'
+ self.write_file((pkg_dir, "setup.py"), SETUP_PY)
+ self.write_file((pkg_dir, "foo.py"), "#")
+ self.write_file((pkg_dir, "MANIFEST.in"), "include foo.py")
+ self.write_file((pkg_dir, "README"), "")
+
+ dist = Distribution({"name": "foo", "version": "0.1",
+ "py_modules": ["foo"],
+ "url": "xxx", "author": "xxx",
+ "author_email": "xxx"})
+ dist.script_name = "setup.py"
os.chdir(pkg_dir)
- sys.argv = ['setup.py']
+ sys.argv = ["setup.py"]
cmd = bdist_dumb(dist)
# so the output is the same no matter
# what is the platform
- cmd.format = 'zip'
+ cmd.format = "zip"
cmd.ensure_finalized()
cmd.run()
# see what we have
- dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
+ dist_created = os.listdir(os.path.join(pkg_dir, "dist"))
base = "%s.%s.zip" % (dist.get_fullname(), cmd.plat_name)
self.assertEqual(dist_created, [base])
# now let's check what we have in the zip file
- fp = zipfile.ZipFile(os.path.join('dist', base))
+ fp = zipfile.ZipFile(os.path.join("dist", base))
try:
contents = fp.namelist()
finally:
fp.close()
contents = sorted(filter(None, map(os.path.basename, contents)))
- wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py']
+ wanted = ["foo-0.1-py%s.%s.egg-info" % sys.version_info[:2], "foo.py"]
if not sys.dont_write_bytecode:
- wanted.append('foo.%s.pyc' % sys.implementation.cache_tag)
+ wanted.append("foo.%s.pyc" % sys.implementation.cache_tag)
self.assertEqual(contents, sorted(wanted))
def test_suite():
return unittest.makeSuite(BuildDumbTestCase)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_bdist_msi.py b/.venv3.10/Lib/distutils/tests/test_bdist_msi.py
index a61266a1..0894f28f 100644
--- a/.venv3.10/Lib/distutils/tests/test_bdist_msi.py
+++ b/.venv3.10/Lib/distutils/tests/test_bdist_msi.py
@@ -6,7 +6,7 @@
from distutils.tests import support
-@unittest.skipUnless(sys.platform == 'win32', 'these tests require Windows')
+@unittest.skipUnless(sys.platform == "win32", "these tests require Windows")
class BDistMSITestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
@@ -23,5 +23,5 @@ def test_minimal(self):
def test_suite():
return unittest.makeSuite(BDistMSITestCase)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_bdist_rpm.py b/.venv3.10/Lib/distutils/tests/test_bdist_rpm.py
index ba4382fb..42e65559 100644
--- a/.venv3.10/Lib/distutils/tests/test_bdist_rpm.py
+++ b/.venv3.10/Lib/distutils/tests/test_bdist_rpm.py
@@ -42,32 +42,32 @@ def tearDown(self):
# XXX I am unable yet to make this test work without
# spurious sdtout/stderr output under Mac OS X
- @unittest.skipUnless(sys.platform.startswith('linux'),
- 'spurious sdtout/stderr output under Mac OS X')
+ @unittest.skipUnless(sys.platform.startswith("linux"),
+ "spurious sdtout/stderr output under Mac OS X")
@requires_zlib()
- @unittest.skipIf(find_executable('rpm') is None,
- 'the rpm command is not found')
- @unittest.skipIf(find_executable('rpmbuild') is None,
- 'the rpmbuild command is not found')
+ @unittest.skipIf(find_executable("rpm") is None,
+ "the rpm command is not found")
+ @unittest.skipIf(find_executable("rpmbuild") is None,
+ "the rpmbuild command is not found")
def test_quiet(self):
# let's create a package
tmp_dir = self.mkdtemp()
- os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation
- pkg_dir = os.path.join(tmp_dir, 'foo')
+ os.environ["HOME"] = tmp_dir # to confine dir '.rpmdb' creation
+ pkg_dir = os.path.join(tmp_dir, "foo")
os.mkdir(pkg_dir)
- self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
- self.write_file((pkg_dir, 'foo.py'), '#')
- self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
- self.write_file((pkg_dir, 'README'), '')
-
- dist = Distribution({'name': 'foo', 'version': '0.1',
- 'py_modules': ['foo'],
- 'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx'})
- dist.script_name = 'setup.py'
+ self.write_file((pkg_dir, "setup.py"), SETUP_PY)
+ self.write_file((pkg_dir, "foo.py"), "#")
+ self.write_file((pkg_dir, "MANIFEST.in"), "include foo.py")
+ self.write_file((pkg_dir, "README"), "")
+
+ dist = Distribution({"name": "foo", "version": "0.1",
+ "py_modules": ["foo"],
+ "url": "xxx", "author": "xxx",
+ "author_email": "xxx"})
+ dist.script_name = "setup.py"
os.chdir(pkg_dir)
- sys.argv = ['setup.py']
+ sys.argv = ["setup.py"]
cmd = bdist_rpm(dist)
cmd.fix_python = True
@@ -76,42 +76,42 @@ def test_quiet(self):
cmd.ensure_finalized()
cmd.run()
- dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
- self.assertIn('foo-0.1-1.noarch.rpm', dist_created)
+ dist_created = os.listdir(os.path.join(pkg_dir, "dist"))
+ self.assertIn("foo-0.1-1.noarch.rpm", dist_created)
# bug #2945: upload ignores bdist_rpm files
- self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files)
- self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files)
+ self.assertIn(("bdist_rpm", "any", "dist/foo-0.1-1.src.rpm"), dist.dist_files)
+ self.assertIn(("bdist_rpm", "any", "dist/foo-0.1-1.noarch.rpm"), dist.dist_files)
# XXX I am unable yet to make this test work without
# spurious sdtout/stderr output under Mac OS X
- @unittest.skipUnless(sys.platform.startswith('linux'),
- 'spurious sdtout/stderr output under Mac OS X')
+ @unittest.skipUnless(sys.platform.startswith("linux"),
+ "spurious sdtout/stderr output under Mac OS X")
@requires_zlib()
# http://bugs.python.org/issue1533164
- @unittest.skipIf(find_executable('rpm') is None,
- 'the rpm command is not found')
- @unittest.skipIf(find_executable('rpmbuild') is None,
- 'the rpmbuild command is not found')
+ @unittest.skipIf(find_executable("rpm") is None,
+ "the rpm command is not found")
+ @unittest.skipIf(find_executable("rpmbuild") is None,
+ "the rpmbuild command is not found")
def test_no_optimize_flag(self):
# let's create a package that breaks bdist_rpm
tmp_dir = self.mkdtemp()
- os.environ['HOME'] = tmp_dir # to confine dir '.rpmdb' creation
- pkg_dir = os.path.join(tmp_dir, 'foo')
+ os.environ["HOME"] = tmp_dir # to confine dir '.rpmdb' creation
+ pkg_dir = os.path.join(tmp_dir, "foo")
os.mkdir(pkg_dir)
- self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
- self.write_file((pkg_dir, 'foo.py'), '#')
- self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
- self.write_file((pkg_dir, 'README'), '')
-
- dist = Distribution({'name': 'foo', 'version': '0.1',
- 'py_modules': ['foo'],
- 'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx'})
- dist.script_name = 'setup.py'
+ self.write_file((pkg_dir, "setup.py"), SETUP_PY)
+ self.write_file((pkg_dir, "foo.py"), "#")
+ self.write_file((pkg_dir, "MANIFEST.in"), "include foo.py")
+ self.write_file((pkg_dir, "README"), "")
+
+ dist = Distribution({"name": "foo", "version": "0.1",
+ "py_modules": ["foo"],
+ "url": "xxx", "author": "xxx",
+ "author_email": "xxx"})
+ dist.script_name = "setup.py"
os.chdir(pkg_dir)
- sys.argv = ['setup.py']
+ sys.argv = ["setup.py"]
cmd = bdist_rpm(dist)
cmd.fix_python = True
@@ -119,17 +119,17 @@ def test_no_optimize_flag(self):
cmd.ensure_finalized()
cmd.run()
- dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
- self.assertIn('foo-0.1-1.noarch.rpm', dist_created)
+ dist_created = os.listdir(os.path.join(pkg_dir, "dist"))
+ self.assertIn("foo-0.1-1.noarch.rpm", dist_created)
# bug #2945: upload ignores bdist_rpm files
- self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files)
- self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files)
+ self.assertIn(("bdist_rpm", "any", "dist/foo-0.1-1.src.rpm"), dist.dist_files)
+ self.assertIn(("bdist_rpm", "any", "dist/foo-0.1-1.noarch.rpm"), dist.dist_files)
- os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
+ os.remove(os.path.join(pkg_dir, "dist", "foo-0.1-1.noarch.rpm"))
def test_suite():
return unittest.makeSuite(BuildRpmTestCase)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_build.py b/.venv3.10/Lib/distutils/tests/test_build.py
index b020a5ba..97e2cd93 100644
--- a/.venv3.10/Lib/distutils/tests/test_build.py
+++ b/.venv3.10/Lib/distutils/tests/test_build.py
@@ -21,29 +21,29 @@ def test_finalize_options(self):
self.assertEqual(cmd.plat_name, get_platform())
# build_purelib is build + lib
- wanted = os.path.join(cmd.build_base, 'lib')
+ wanted = os.path.join(cmd.build_base, "lib")
self.assertEqual(cmd.build_purelib, wanted)
# build_platlib is 'build/lib.platform-x.x[-pydebug]'
# examples:
# build/lib.macosx-10.3-i386-2.7
- plat_spec = '.%s-%d.%d' % (cmd.plat_name, *sys.version_info[:2])
- if hasattr(sys, 'gettotalrefcount'):
- self.assertTrue(cmd.build_platlib.endswith('-pydebug'))
- plat_spec += '-pydebug'
- wanted = os.path.join(cmd.build_base, 'lib' + plat_spec)
+ plat_spec = ".%s-%d.%d" % (cmd.plat_name, *sys.version_info[:2])
+ if hasattr(sys, "gettotalrefcount"):
+ self.assertTrue(cmd.build_platlib.endswith("-pydebug"))
+ plat_spec += "-pydebug"
+ wanted = os.path.join(cmd.build_base, "lib" + plat_spec)
self.assertEqual(cmd.build_platlib, wanted)
# by default, build_lib = build_purelib
self.assertEqual(cmd.build_lib, cmd.build_purelib)
# build_temp is build/temp.
- wanted = os.path.join(cmd.build_base, 'temp' + plat_spec)
+ wanted = os.path.join(cmd.build_base, "temp" + plat_spec)
self.assertEqual(cmd.build_temp, wanted)
# build_scripts is build/scripts-x.x
wanted = os.path.join(cmd.build_base,
- 'scripts-%d.%d' % sys.version_info[:2])
+ "scripts-%d.%d" % sys.version_info[:2])
self.assertEqual(cmd.build_scripts, wanted)
# executable is os.path.normpath(sys.executable)
diff --git a/.venv3.10/Lib/distutils/tests/test_build_clib.py b/.venv3.10/Lib/distutils/tests/test_build_clib.py
index 19e012a5..186b0b77 100644
--- a/.venv3.10/Lib/distutils/tests/test_build_clib.py
+++ b/.venv3.10/Lib/distutils/tests/test_build_clib.py
@@ -28,29 +28,29 @@ def test_check_library_dist(self):
cmd = build_clib(dist)
# 'libraries' option must be a list
- self.assertRaises(DistutilsSetupError, cmd.check_library_list, 'foo')
+ self.assertRaises(DistutilsSetupError, cmd.check_library_list, "foo")
# each element of 'libraries' must a 2-tuple
self.assertRaises(DistutilsSetupError, cmd.check_library_list,
- ['foo1', 'foo2'])
+ ["foo1", "foo2"])
# first element of each tuple in 'libraries'
# must be a string (the library name)
self.assertRaises(DistutilsSetupError, cmd.check_library_list,
- [(1, 'foo1'), ('name', 'foo2')])
+ [(1, "foo1"), ("name", "foo2")])
# library name may not contain directory separators
self.assertRaises(DistutilsSetupError, cmd.check_library_list,
- [('name', 'foo1'),
- ('another/name', 'foo2')])
+ [("name", "foo1"),
+ ("another/name", "foo2")])
# second element of each tuple must be a dictionary (build info)
self.assertRaises(DistutilsSetupError, cmd.check_library_list,
- [('name', {}),
- ('another', 'foo2')])
+ [("name", {}),
+ ("another", "foo2")])
# those work
- libs = [('name', {}), ('name', {'ok': 'good'})]
+ libs = [("name", {}), ("name", {"ok": "good"})]
cmd.check_library_list(libs)
def test_get_source_files(self):
@@ -59,21 +59,21 @@ def test_get_source_files(self):
# "in 'libraries' option 'sources' must be present and must be
# a list of source filenames
- cmd.libraries = [('name', {})]
+ cmd.libraries = [("name", {})]
self.assertRaises(DistutilsSetupError, cmd.get_source_files)
- cmd.libraries = [('name', {'sources': 1})]
+ cmd.libraries = [("name", {"sources": 1})]
self.assertRaises(DistutilsSetupError, cmd.get_source_files)
- cmd.libraries = [('name', {'sources': ['a', 'b']})]
- self.assertEqual(cmd.get_source_files(), ['a', 'b'])
+ cmd.libraries = [("name", {"sources": ["a", "b"]})]
+ self.assertEqual(cmd.get_source_files(), ["a", "b"])
- cmd.libraries = [('name', {'sources': ('a', 'b')})]
- self.assertEqual(cmd.get_source_files(), ['a', 'b'])
+ cmd.libraries = [("name", {"sources": ("a", "b")})]
+ self.assertEqual(cmd.get_source_files(), ["a", "b"])
- cmd.libraries = [('name', {'sources': ('a', 'b')}),
- ('name2', {'sources': ['c', 'd']})]
- self.assertEqual(cmd.get_source_files(), ['a', 'b', 'c', 'd'])
+ cmd.libraries = [("name", {"sources": ("a", "b")}),
+ ("name2", {"sources": ["c", "d"]})]
+ self.assertEqual(cmd.get_source_files(), ["a", "b", "c", "d"])
def test_build_libraries(self):
@@ -87,40 +87,40 @@ def compile(*args, **kw):
cmd.compiler = FakeCompiler()
# build_libraries is also doing a bit of typo checking
- lib = [('name', {'sources': 'notvalid'})]
+ lib = [("name", {"sources": "notvalid"})]
self.assertRaises(DistutilsSetupError, cmd.build_libraries, lib)
- lib = [('name', {'sources': list()})]
+ lib = [("name", {"sources": list()})]
cmd.build_libraries(lib)
- lib = [('name', {'sources': tuple()})]
+ lib = [("name", {"sources": tuple()})]
cmd.build_libraries(lib)
def test_finalize_options(self):
pkg_dir, dist = self.create_dist()
cmd = build_clib(dist)
- cmd.include_dirs = 'one-dir'
+ cmd.include_dirs = "one-dir"
cmd.finalize_options()
- self.assertEqual(cmd.include_dirs, ['one-dir'])
+ self.assertEqual(cmd.include_dirs, ["one-dir"])
cmd.include_dirs = None
cmd.finalize_options()
self.assertEqual(cmd.include_dirs, [])
- cmd.distribution.libraries = 'WONTWORK'
+ cmd.distribution.libraries = "WONTWORK"
self.assertRaises(DistutilsSetupError, cmd.finalize_options)
- @unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
+ @unittest.skipIf(sys.platform == "win32", "can't test on Windows")
def test_run(self):
pkg_dir, dist = self.create_dist()
cmd = build_clib(dist)
- foo_c = os.path.join(pkg_dir, 'foo.c')
- self.write_file(foo_c, 'int main(void) { return 1;}\n')
- cmd.libraries = [('foo', {'sources': [foo_c]})]
+ foo_c = os.path.join(pkg_dir, "foo.c")
+ self.write_file(foo_c, "int main(void) { return 1;}\n")
+ cmd.libraries = [("foo", {"sources": [foo_c]})]
- build_temp = os.path.join(pkg_dir, 'build')
+ build_temp = os.path.join(pkg_dir, "build")
os.mkdir(build_temp)
cmd.build_temp = build_temp
cmd.build_clib = build_temp
@@ -129,13 +129,13 @@ def test_run(self):
# all commands are present on the system.
ccmd = missing_compiler_executable()
if ccmd is not None:
- self.skipTest('The %r command is not found' % ccmd)
+ self.skipTest("The %r command is not found" % ccmd)
# this should work
cmd.run()
# let's check the result
- self.assertIn('libfoo.a', os.listdir(build_temp))
+ self.assertIn("libfoo.a", os.listdir(build_temp))
def test_suite():
return unittest.makeSuite(BuildCLibTestCase)
diff --git a/.venv3.10/Lib/distutils/tests/test_build_ext.py b/.venv3.10/Lib/distutils/tests/test_build_ext.py
index 8e7364d2..ca0f6d7c 100644
--- a/.venv3.10/Lib/distutils/tests/test_build_ext.py
+++ b/.venv3.10/Lib/distutils/tests/test_build_ext.py
@@ -59,12 +59,12 @@ def build_ext(self, *args, **kwargs):
def test_build_ext(self):
cmd = support.missing_compiler_executable()
if cmd is not None:
- self.skipTest('The %r command is not found' % cmd)
+ self.skipTest("The %r command is not found" % cmd)
global ALREADY_TESTED
copy_xxmodule_c(self.tmp_dir)
- xx_c = os.path.join(self.tmp_dir, 'xxmodule.c')
- xx_ext = Extension('xx', [xx_c])
- dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]})
+ xx_c = os.path.join(self.tmp_dir, "xxmodule.c")
+ xx_ext = Extension("xx", [xx_c])
+ dist = Distribution({"name": "xx", "ext_modules": [xx_ext]})
dist.package_dir = self.tmp_dir
cmd = self.build_ext(dist)
fixup_build_ext(cmd)
@@ -82,7 +82,7 @@ def test_build_ext(self):
sys.stdout = old_stdout
if ALREADY_TESTED:
- self.skipTest('Already tested in %s' % ALREADY_TESTED)
+ self.skipTest("Already tested in %s" % ALREADY_TESTED)
else:
ALREADY_TESTED = type(self).__name__
@@ -113,45 +113,45 @@ def test_xx(self):
unittest.main()
""")
- assert_python_ok('-c', code)
+ assert_python_ok("-c", code)
def test_solaris_enable_shared(self):
- dist = Distribution({'name': 'xx'})
+ dist = Distribution({"name": "xx"})
cmd = self.build_ext(dist)
old = sys.platform
- sys.platform = 'sunos' # fooling finalize_options
+ sys.platform = "sunos" # fooling finalize_options
from distutils.sysconfig import _config_vars
- old_var = _config_vars.get('Py_ENABLE_SHARED')
- _config_vars['Py_ENABLE_SHARED'] = 1
+ old_var = _config_vars.get("Py_ENABLE_SHARED")
+ _config_vars["Py_ENABLE_SHARED"] = 1
try:
cmd.ensure_finalized()
finally:
sys.platform = old
if old_var is None:
- del _config_vars['Py_ENABLE_SHARED']
+ del _config_vars["Py_ENABLE_SHARED"]
else:
- _config_vars['Py_ENABLE_SHARED'] = old_var
+ _config_vars["Py_ENABLE_SHARED"] = old_var
# make sure we get some library dirs under solaris
self.assertGreater(len(cmd.library_dirs), 0)
def test_user_site(self):
import site
- dist = Distribution({'name': 'xx'})
+ dist = Distribution({"name": "xx"})
cmd = self.build_ext(dist)
# making sure the user option is there
options = [name for name, short, lable in
cmd.user_options]
- self.assertIn('user', options)
+ self.assertIn("user", options)
# setting a value
cmd.user = 1
# setting user based lib and include
- lib = os.path.join(site.USER_BASE, 'lib')
- incl = os.path.join(site.USER_BASE, 'include')
+ lib = os.path.join(site.USER_BASE, "lib")
+ incl = os.path.join(site.USER_BASE, "include")
os.mkdir(lib)
os.mkdir(incl)
@@ -168,15 +168,15 @@ def test_optional_extension(self):
# this extension will fail, but let's ignore this failure
# with the optional argument.
- modules = [Extension('foo', ['xxx'], optional=False)]
- dist = Distribution({'name': 'xx', 'ext_modules': modules})
+ modules = [Extension("foo", ["xxx"], optional=False)]
+ dist = Distribution({"name": "xx", "ext_modules": modules})
cmd = self.build_ext(dist)
cmd.ensure_finalized()
self.assertRaises((UnknownFileError, CompileError),
cmd.run) # should raise an error
- modules = [Extension('foo', ['xxx'], optional=True)]
- dist = Distribution({'name': 'xx', 'ext_modules': modules})
+ modules = [Extension("foo", ["xxx"], optional=True)]
+ dist = Distribution({"name": "xx", "ext_modules": modules})
cmd = self.build_ext(dist)
cmd.ensure_finalized()
cmd.run() # should pass
@@ -184,8 +184,8 @@ def test_optional_extension(self):
def test_finalize_options(self):
# Make sure Python's include directories (for Python.h, pyconfig.h,
# etc.) are in the include search path.
- modules = [Extension('foo', ['xxx'], optional=False)]
- dist = Distribution({'name': 'xx', 'ext_modules': modules})
+ modules = [Extension("foo", ["xxx"], optional=False)]
+ dist = Distribution({"name": "xx", "ext_modules": modules})
cmd = self.build_ext(dist)
cmd.finalize_options()
@@ -200,47 +200,47 @@ def test_finalize_options(self):
# make sure cmd.libraries is turned into a list
# if it's a string
cmd = self.build_ext(dist)
- cmd.libraries = 'my_lib, other_lib lastlib'
+ cmd.libraries = "my_lib, other_lib lastlib"
cmd.finalize_options()
- self.assertEqual(cmd.libraries, ['my_lib', 'other_lib', 'lastlib'])
+ self.assertEqual(cmd.libraries, ["my_lib", "other_lib", "lastlib"])
# make sure cmd.library_dirs is turned into a list
# if it's a string
cmd = self.build_ext(dist)
- cmd.library_dirs = 'my_lib_dir%sother_lib_dir' % os.pathsep
+ cmd.library_dirs = "my_lib_dir%sother_lib_dir" % os.pathsep
cmd.finalize_options()
- self.assertIn('my_lib_dir', cmd.library_dirs)
- self.assertIn('other_lib_dir', cmd.library_dirs)
+ self.assertIn("my_lib_dir", cmd.library_dirs)
+ self.assertIn("other_lib_dir", cmd.library_dirs)
# make sure rpath is turned into a list
# if it's a string
cmd = self.build_ext(dist)
- cmd.rpath = 'one%stwo' % os.pathsep
+ cmd.rpath = "one%stwo" % os.pathsep
cmd.finalize_options()
- self.assertEqual(cmd.rpath, ['one', 'two'])
+ self.assertEqual(cmd.rpath, ["one", "two"])
# make sure cmd.link_objects is turned into a list
# if it's a string
cmd = build_ext(dist)
- cmd.link_objects = 'one two,three'
+ cmd.link_objects = "one two,three"
cmd.finalize_options()
- self.assertEqual(cmd.link_objects, ['one', 'two', 'three'])
+ self.assertEqual(cmd.link_objects, ["one", "two", "three"])
# XXX more tests to perform for win32
# make sure define is turned into 2-tuples
# strings if they are ','-separated strings
cmd = self.build_ext(dist)
- cmd.define = 'one,two'
+ cmd.define = "one,two"
cmd.finalize_options()
- self.assertEqual(cmd.define, [('one', '1'), ('two', '1')])
+ self.assertEqual(cmd.define, [("one", "1"), ("two", "1")])
# make sure undef is turned into a list of
# strings if they are ','-separated strings
cmd = self.build_ext(dist)
- cmd.undef = 'one,two'
+ cmd.undef = "one,two"
cmd.finalize_options()
- self.assertEqual(cmd.undef, ['one', 'two'])
+ self.assertEqual(cmd.undef, ["one", "two"])
# make sure swig_opts is turned into a list
cmd = self.build_ext(dist)
@@ -249,9 +249,9 @@ def test_finalize_options(self):
self.assertEqual(cmd.swig_opts, [])
cmd = self.build_ext(dist)
- cmd.swig_opts = '1 2'
+ cmd.swig_opts = "1 2"
cmd.finalize_options()
- self.assertEqual(cmd.swig_opts, ['1', '2'])
+ self.assertEqual(cmd.swig_opts, ["1", "2"])
def test_check_extensions_list(self):
dist = Distribution()
@@ -260,27 +260,27 @@ def test_check_extensions_list(self):
#'extensions' option must be a list of Extension instances
self.assertRaises(DistutilsSetupError,
- cmd.check_extensions_list, 'foo')
+ cmd.check_extensions_list, "foo")
# each element of 'ext_modules' option must be an
# Extension instance or 2-tuple
- exts = [('bar', 'foo', 'bar'), 'foo']
+ exts = [("bar", "foo", "bar"), "foo"]
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
# first element of each tuple in 'ext_modules'
# must be the extension name (a string) and match
# a python dotted-separated name
- exts = [('foo-bar', '')]
+ exts = [("foo-bar", "")]
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
# second element of each tuple in 'ext_modules'
# must be a dictionary (build info)
- exts = [('foo.bar', '')]
+ exts = [("foo.bar", "")]
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
# ok this one should pass
- exts = [('foo.bar', {'sources': [''], 'libraries': 'foo',
- 'some': 'bar'})]
+ exts = [("foo.bar", {"sources": [""], "libraries": "foo",
+ "some": "bar"})]
cmd.check_extensions_list(exts)
ext = exts[0]
self.assertIsInstance(ext, Extension)
@@ -288,38 +288,38 @@ def test_check_extensions_list(self):
# check_extensions_list adds in ext the values passed
# when they are in ('include_dirs', 'library_dirs', 'libraries'
# 'extra_objects', 'extra_compile_args', 'extra_link_args')
- self.assertEqual(ext.libraries, 'foo')
- self.assertFalse(hasattr(ext, 'some'))
+ self.assertEqual(ext.libraries, "foo")
+ self.assertFalse(hasattr(ext, "some"))
# 'macros' element of build info dict must be 1- or 2-tuple
- exts = [('foo.bar', {'sources': [''], 'libraries': 'foo',
- 'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})]
+ exts = [("foo.bar", {"sources": [""], "libraries": "foo",
+ "some": "bar", "macros": [("1", "2", "3"), "foo"]})]
self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts)
- exts[0][1]['macros'] = [('1', '2'), ('3',)]
+ exts[0][1]["macros"] = [("1", "2"), ("3",)]
cmd.check_extensions_list(exts)
- self.assertEqual(exts[0].undef_macros, ['3'])
- self.assertEqual(exts[0].define_macros, [('1', '2')])
+ self.assertEqual(exts[0].undef_macros, ["3"])
+ self.assertEqual(exts[0].define_macros, [("1", "2")])
def test_get_source_files(self):
- modules = [Extension('foo', ['xxx'], optional=False)]
- dist = Distribution({'name': 'xx', 'ext_modules': modules})
+ modules = [Extension("foo", ["xxx"], optional=False)]
+ dist = Distribution({"name": "xx", "ext_modules": modules})
cmd = self.build_ext(dist)
cmd.ensure_finalized()
- self.assertEqual(cmd.get_source_files(), ['xxx'])
+ self.assertEqual(cmd.get_source_files(), ["xxx"])
def test_unicode_module_names(self):
modules = [
- Extension('foo', ['aaa'], optional=False),
- Extension('föö', ['uuu'], optional=False),
+ Extension("foo", ["aaa"], optional=False),
+ Extension("föö", ["uuu"], optional=False),
]
- dist = Distribution({'name': 'xx', 'ext_modules': modules})
+ dist = Distribution({"name": "xx", "ext_modules": modules})
cmd = self.build_ext(dist)
cmd.ensure_finalized()
- self.assertRegex(cmd.get_ext_filename(modules[0].name), r'foo(_d)?\..*')
- self.assertRegex(cmd.get_ext_filename(modules[1].name), r'föö(_d)?\..*')
- self.assertEqual(cmd.get_export_symbols(modules[0]), ['PyInit_foo'])
- self.assertEqual(cmd.get_export_symbols(modules[1]), ['PyInitU_f_gkaa'])
+ self.assertRegex(cmd.get_ext_filename(modules[0].name), r"foo(_d)?\..*")
+ self.assertRegex(cmd.get_ext_filename(modules[1].name), r"föö(_d)?\..*")
+ self.assertEqual(cmd.get_export_symbols(modules[0]), ["PyInit_foo"])
+ self.assertEqual(cmd.get_export_symbols(modules[1]), ["PyInitU_f_gkaa"])
def test_compiler_option(self):
# cmd.compiler is an option and
@@ -327,28 +327,28 @@ def test_compiler_option(self):
# when the command is run
dist = Distribution()
cmd = self.build_ext(dist)
- cmd.compiler = 'unix'
+ cmd.compiler = "unix"
cmd.ensure_finalized()
cmd.run()
- self.assertEqual(cmd.compiler, 'unix')
+ self.assertEqual(cmd.compiler, "unix")
def test_get_outputs(self):
cmd = support.missing_compiler_executable()
if cmd is not None:
- self.skipTest('The %r command is not found' % cmd)
+ self.skipTest("The %r command is not found" % cmd)
tmp_dir = self.mkdtemp()
- c_file = os.path.join(tmp_dir, 'foo.c')
- self.write_file(c_file, 'void PyInit_foo(void) {}\n')
- ext = Extension('foo', [c_file], optional=False)
- dist = Distribution({'name': 'xx',
- 'ext_modules': [ext]})
+ c_file = os.path.join(tmp_dir, "foo.c")
+ self.write_file(c_file, "void PyInit_foo(void) {}\n")
+ ext = Extension("foo", [c_file], optional=False)
+ dist = Distribution({"name": "xx",
+ "ext_modules": [ext]})
cmd = self.build_ext(dist)
fixup_build_ext(cmd)
cmd.ensure_finalized()
self.assertEqual(len(cmd.get_outputs()), 1)
- cmd.build_lib = os.path.join(self.tmp_dir, 'build')
- cmd.build_temp = os.path.join(self.tmp_dir, 'tempt')
+ cmd.build_lib = os.path.join(self.tmp_dir, "build")
+ cmd.build_temp = os.path.join(self.tmp_dir, "tempt")
# issue #5977 : distutils build_ext.get_outputs
# returns wrong result with --inplace
@@ -362,7 +362,7 @@ def test_get_outputs(self):
finally:
os.chdir(old_wd)
self.assertTrue(os.path.exists(so_file))
- ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
+ ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
self.assertTrue(so_file.endswith(ext_suffix))
so_dir = os.path.dirname(so_file)
self.assertEqual(so_dir, other_tmp_dir)
@@ -377,9 +377,9 @@ def test_get_outputs(self):
self.assertEqual(so_dir, cmd.build_lib)
# inplace = 0, cmd.package = 'bar'
- build_py = cmd.get_finalized_command('build_py')
- build_py.package_dir = {'': 'bar'}
- path = cmd.get_ext_fullpath('foo')
+ build_py = cmd.get_finalized_command("build_py")
+ build_py.package_dir = {"": "bar"}
+ path = cmd.get_ext_fullpath("foo")
# checking that the last directory is the build_dir
path = os.path.split(path)[0]
self.assertEqual(path, cmd.build_lib)
@@ -390,16 +390,16 @@ def test_get_outputs(self):
old_wd = os.getcwd()
os.chdir(other_tmp_dir)
try:
- path = cmd.get_ext_fullpath('foo')
+ path = cmd.get_ext_fullpath("foo")
finally:
os.chdir(old_wd)
# checking that the last directory is bar
path = os.path.split(path)[0]
lastdir = os.path.split(path)[-1]
- self.assertEqual(lastdir, 'bar')
+ self.assertEqual(lastdir, "bar")
def test_ext_fullpath(self):
- ext = sysconfig.get_config_var('EXT_SUFFIX')
+ ext = sysconfig.get_config_var("EXT_SUFFIX")
# building lxml.etree inplace
#etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c')
#etree_ext = Extension('lxml.etree', [etree_c])
@@ -407,78 +407,78 @@ def test_ext_fullpath(self):
dist = Distribution()
cmd = self.build_ext(dist)
cmd.inplace = 1
- cmd.distribution.package_dir = {'': 'src'}
- cmd.distribution.packages = ['lxml', 'lxml.html']
+ cmd.distribution.package_dir = {"": "src"}
+ cmd.distribution.packages = ["lxml", "lxml.html"]
curdir = os.getcwd()
- wanted = os.path.join(curdir, 'src', 'lxml', 'etree' + ext)
- path = cmd.get_ext_fullpath('lxml.etree')
+ wanted = os.path.join(curdir, "src", "lxml", "etree" + ext)
+ path = cmd.get_ext_fullpath("lxml.etree")
self.assertEqual(wanted, path)
# building lxml.etree not inplace
cmd.inplace = 0
- cmd.build_lib = os.path.join(curdir, 'tmpdir')
- wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree' + ext)
- path = cmd.get_ext_fullpath('lxml.etree')
+ cmd.build_lib = os.path.join(curdir, "tmpdir")
+ wanted = os.path.join(curdir, "tmpdir", "lxml", "etree" + ext)
+ path = cmd.get_ext_fullpath("lxml.etree")
self.assertEqual(wanted, path)
# building twisted.runner.portmap not inplace
- build_py = cmd.get_finalized_command('build_py')
+ build_py = cmd.get_finalized_command("build_py")
build_py.package_dir = {}
- cmd.distribution.packages = ['twisted', 'twisted.runner.portmap']
- path = cmd.get_ext_fullpath('twisted.runner.portmap')
- wanted = os.path.join(curdir, 'tmpdir', 'twisted', 'runner',
- 'portmap' + ext)
+ cmd.distribution.packages = ["twisted", "twisted.runner.portmap"]
+ path = cmd.get_ext_fullpath("twisted.runner.portmap")
+ wanted = os.path.join(curdir, "tmpdir", "twisted", "runner",
+ "portmap" + ext)
self.assertEqual(wanted, path)
# building twisted.runner.portmap inplace
cmd.inplace = 1
- path = cmd.get_ext_fullpath('twisted.runner.portmap')
- wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext)
+ path = cmd.get_ext_fullpath("twisted.runner.portmap")
+ wanted = os.path.join(curdir, "twisted", "runner", "portmap" + ext)
self.assertEqual(wanted, path)
- @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
+ @unittest.skipUnless(sys.platform == "darwin", "test only relevant for MacOSX")
def test_deployment_target_default(self):
# Issue 9516: Test that, in the absence of the environment variable,
# an extension module is compiled with the same deployment target as
# the interpreter.
- self._try_compile_deployment_target('==', None)
+ self._try_compile_deployment_target("==", None)
- @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
+ @unittest.skipUnless(sys.platform == "darwin", "test only relevant for MacOSX")
def test_deployment_target_too_low(self):
# Issue 9516: Test that an extension module is not allowed to be
# compiled with a deployment target less than that of the interpreter.
self.assertRaises(DistutilsPlatformError,
- self._try_compile_deployment_target, '>', '10.1')
+ self._try_compile_deployment_target, ">", "10.1")
- @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for MacOSX')
+ @unittest.skipUnless(sys.platform == "darwin", "test only relevant for MacOSX")
def test_deployment_target_higher_ok(self):
# Issue 9516: Test that an extension module can be compiled with a
# deployment target higher than that of the interpreter: the ext
# module may depend on some newer OS feature.
- deptarget = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
+ deptarget = sysconfig.get_config_var("MACOSX_DEPLOYMENT_TARGET")
if deptarget:
# increment the minor version number (i.e. 10.6 -> 10.7)
- deptarget = [int(x) for x in deptarget.split('.')]
+ deptarget = [int(x) for x in deptarget.split(".")]
deptarget[-1] += 1
- deptarget = '.'.join(str(i) for i in deptarget)
- self._try_compile_deployment_target('<', deptarget)
+ deptarget = ".".join(str(i) for i in deptarget)
+ self._try_compile_deployment_target("<", deptarget)
def _try_compile_deployment_target(self, operator, target):
orig_environ = os.environ
os.environ = orig_environ.copy()
- self.addCleanup(setattr, os, 'environ', orig_environ)
+ self.addCleanup(setattr, os, "environ", orig_environ)
if target is None:
- if os.environ.get('MACOSX_DEPLOYMENT_TARGET'):
- del os.environ['MACOSX_DEPLOYMENT_TARGET']
+ if os.environ.get("MACOSX_DEPLOYMENT_TARGET"):
+ del os.environ["MACOSX_DEPLOYMENT_TARGET"]
else:
- os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
+ os.environ["MACOSX_DEPLOYMENT_TARGET"] = target
- deptarget_c = os.path.join(self.tmp_dir, 'deptargetmodule.c')
+ deptarget_c = os.path.join(self.tmp_dir, "deptargetmodule.c")
- with open(deptarget_c, 'w') as fp:
- fp.write(textwrap.dedent('''\
+ with open(deptarget_c, "w") as fp:
+ fp.write(textwrap.dedent("""\
#include
int dummy;
@@ -488,32 +488,32 @@ def _try_compile_deployment_target(self, operator, target):
#error "Unexpected target"
#endif
- ''' % operator))
+ """ % operator))
# get the deployment target that the interpreter was built with
- target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
- target = tuple(map(int, target.split('.')[0:2]))
+ target = sysconfig.get_config_var("MACOSX_DEPLOYMENT_TARGET")
+ target = tuple(map(int, target.split(".")[0:2]))
# format the target value as defined in the Apple
# Availability Macros. We can't use the macro names since
# at least one value we test with will not exist yet.
if target[:2] < (10, 10):
# for 10.1 through 10.9.x -> "10n0"
- target = '%02d%01d0' % target
+ target = "%02d%01d0" % target
else:
# for 10.10 and beyond -> "10nn00"
if len(target) >= 2:
- target = '%02d%02d00' % target
+ target = "%02d%02d00" % target
else:
# 11 and later can have no minor version (11 instead of 11.0)
- target = '%02d0000' % target
+ target = "%02d0000" % target
deptarget_ext = Extension(
- 'deptarget',
+ "deptarget",
[deptarget_c],
- extra_compile_args=['-DTARGET=%s'%(target,)],
+ extra_compile_args=["-DTARGET=%s"%(target,)],
)
dist = Distribution({
- 'name': 'deptarget',
- 'ext_modules': [deptarget_ext]
+ "name": "deptarget",
+ "ext_modules": [deptarget_ext]
})
dist.package_dir = self.tmp_dir
cmd = self.build_ext(dist)
@@ -549,5 +549,5 @@ def test_suite():
suite.addTest(unittest.makeSuite(ParallelBuildExtTestCase))
return suite
-if __name__ == '__main__':
+if __name__ == "__main__":
support.run_unittest(__name__)
diff --git a/.venv3.10/Lib/distutils/tests/test_build_py.py b/.venv3.10/Lib/distutils/tests/test_build_py.py
index 0712e92c..ed98eb68 100644
--- a/.venv3.10/Lib/distutils/tests/test_build_py.py
+++ b/.venv3.10/Lib/distutils/tests/test_build_py.py
@@ -88,39 +88,39 @@ def test_empty_package_dir(self):
except DistutilsFileError:
self.fail("failed package_data test when package_dir is ''")
- @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
+ @unittest.skipIf(sys.dont_write_bytecode, "byte-compile disabled")
def test_byte_compile(self):
- project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
+ project_dir, dist = self.create_dist(py_modules=["boiledeggs"])
os.chdir(project_dir)
- self.write_file('boiledeggs.py', 'import antigravity')
+ self.write_file("boiledeggs.py", "import antigravity")
cmd = build_py(dist)
cmd.compile = 1
- cmd.build_lib = 'here'
+ cmd.build_lib = "here"
cmd.finalize_options()
cmd.run()
found = os.listdir(cmd.build_lib)
- self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py'])
- found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
+ self.assertEqual(sorted(found), ["__pycache__", "boiledeggs.py"])
+ found = os.listdir(os.path.join(cmd.build_lib, "__pycache__"))
self.assertEqual(found,
- ['boiledeggs.%s.pyc' % sys.implementation.cache_tag])
+ ["boiledeggs.%s.pyc" % sys.implementation.cache_tag])
- @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
+ @unittest.skipIf(sys.dont_write_bytecode, "byte-compile disabled")
def test_byte_compile_optimized(self):
- project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
+ project_dir, dist = self.create_dist(py_modules=["boiledeggs"])
os.chdir(project_dir)
- self.write_file('boiledeggs.py', 'import antigravity')
+ self.write_file("boiledeggs.py", "import antigravity")
cmd = build_py(dist)
cmd.compile = 0
cmd.optimize = 1
- cmd.build_lib = 'here'
+ cmd.build_lib = "here"
cmd.finalize_options()
cmd.run()
found = os.listdir(cmd.build_lib)
- self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py'])
- found = os.listdir(os.path.join(cmd.build_lib, '__pycache__'))
- expect = 'boiledeggs.{}.opt-1.pyc'.format(sys.implementation.cache_tag)
+ self.assertEqual(sorted(found), ["__pycache__", "boiledeggs.py"])
+ found = os.listdir(os.path.join(cmd.build_lib, "__pycache__"))
+ expect = "boiledeggs.{}.opt-1.pyc".format(sys.implementation.cache_tag)
self.assertEqual(sorted(found), [expect])
def test_dir_in_package_data(self):
@@ -139,7 +139,7 @@ def test_dir_in_package_data(self):
open(os.path.join(docdir, "testfile"), "w").close()
# create the directory that could be incorrectly detected as a file
- os.mkdir(os.path.join(docdir, 'otherdir'))
+ os.mkdir(os.path.join(docdir, "otherdir"))
os.chdir(sources)
dist = Distribution({"packages": ["pkg"],
@@ -168,7 +168,7 @@ def test_dont_write_bytecode(self):
finally:
sys.dont_write_bytecode = old_dont_write_bytecode
- self.assertIn('byte-compiling is disabled',
+ self.assertIn("byte-compiling is disabled",
self.logs[0][1] % self.logs[0][2])
diff --git a/.venv3.10/Lib/distutils/tests/test_build_scripts.py b/.venv3.10/Lib/distutils/tests/test_build_scripts.py
index 954fc763..49baf6ea 100644
--- a/.venv3.10/Lib/distutils/tests/test_build_scripts.py
+++ b/.venv3.10/Lib/distutils/tests/test_build_scripts.py
@@ -93,13 +93,13 @@ def test_version_int(self):
# On linux-g++-32 with command line `./configure --enable-ipv6
# --with-suffix=3`, python is compiled okay but the build scripts
# failed when writing the name of the executable
- old = sysconfig.get_config_vars().get('VERSION')
- sysconfig._config_vars['VERSION'] = 4
+ old = sysconfig.get_config_vars().get("VERSION")
+ sysconfig._config_vars["VERSION"] = 4
try:
cmd.run()
finally:
if old is not None:
- sysconfig._config_vars['VERSION'] = old
+ sysconfig._config_vars["VERSION"] = old
built = os.listdir(target)
for name in expected:
diff --git a/.venv3.10/Lib/distutils/tests/test_check.py b/.venv3.10/Lib/distutils/tests/test_check.py
index e534aca1..52b025eb 100644
--- a/.venv3.10/Lib/distutils/tests/test_check.py
+++ b/.venv3.10/Lib/distutils/tests/test_check.py
@@ -48,26 +48,26 @@ def test_check_metadata(self):
# now let's add the required fields
# and run it again, to make sure we don't get
# any warning anymore
- metadata = {'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx',
- 'name': 'xxx', 'version': 'xxx'}
+ metadata = {"url": "xxx", "author": "xxx",
+ "author_email": "xxx",
+ "name": "xxx", "version": "xxx"}
cmd = self._run(metadata)
self.assertEqual(cmd._warnings, 0)
# now with the strict mode, we should
# get an error if there are missing metadata
- self.assertRaises(DistutilsSetupError, self._run, {}, **{'strict': 1})
+ self.assertRaises(DistutilsSetupError, self._run, {}, **{"strict": 1})
# and of course, no error when all metadata are present
cmd = self._run(metadata, strict=1)
self.assertEqual(cmd._warnings, 0)
# now a test with non-ASCII characters
- metadata = {'url': 'xxx', 'author': '\u00c9ric',
- 'author_email': 'xxx', 'name': 'xxx',
- 'version': 'xxx',
- 'description': 'Something about esszet \u00df',
- 'long_description': 'More things about esszet \u00df'}
+ metadata = {"url": "xxx", "author": "\u00c9ric",
+ "author_email": "xxx", "name": "xxx",
+ "version": "xxx",
+ "description": "Something about esszet \u00df",
+ "long_description": "More things about esszet \u00df"}
cmd = self._run(metadata)
self.assertEqual(cmd._warnings, 0)
@@ -77,39 +77,39 @@ def test_check_document(self):
cmd = check(dist)
# let's see if it detects broken rest
- broken_rest = 'title\n===\n\ntest'
+ broken_rest = "title\n===\n\ntest"
msgs = cmd._check_rst_data(broken_rest)
self.assertEqual(len(msgs), 1)
# and non-broken rest
- rest = 'title\n=====\n\ntest'
+ rest = "title\n=====\n\ntest"
msgs = cmd._check_rst_data(rest)
self.assertEqual(len(msgs), 0)
@unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils")
def test_check_restructuredtext(self):
# let's see if it detects broken rest in long_description
- broken_rest = 'title\n===\n\ntest'
+ broken_rest = "title\n===\n\ntest"
pkg_info, dist = self.create_dist(long_description=broken_rest)
cmd = check(dist)
cmd.check_restructuredtext()
self.assertEqual(cmd._warnings, 1)
# let's see if we have an error with strict=1
- metadata = {'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx',
- 'name': 'xxx', 'version': 'xxx',
- 'long_description': broken_rest}
+ metadata = {"url": "xxx", "author": "xxx",
+ "author_email": "xxx",
+ "name": "xxx", "version": "xxx",
+ "long_description": broken_rest}
self.assertRaises(DistutilsSetupError, self._run, metadata,
- **{'strict': 1, 'restructuredtext': 1})
+ **{"strict": 1, "restructuredtext": 1})
# and non-broken rest, including a non-ASCII character to test #12114
- metadata['long_description'] = 'title\n=====\n\ntest \u00df'
+ metadata["long_description"] = "title\n=====\n\ntest \u00df"
cmd = self._run(metadata, strict=1, restructuredtext=1)
self.assertEqual(cmd._warnings, 0)
# check that includes work to test #31292
- metadata['long_description'] = 'title\n=====\n\n.. include:: includetest.rst'
+ metadata["long_description"] = "title\n=====\n\n.. include:: includetest.rst"
cmd = self._run(metadata, cwd=HERE, strict=1, restructuredtext=1)
self.assertEqual(cmd._warnings, 0)
@@ -146,15 +146,15 @@ def foo():
self.assertEqual(len(msgs), 1)
self.assertEqual(
str(msgs[0][1]),
- 'Cannot analyze code. Pygments package not found.'
+ "Cannot analyze code. Pygments package not found."
)
def test_check_all(self):
- metadata = {'url': 'xxx', 'author': 'xxx'}
+ metadata = {"url": "xxx", "author": "xxx"}
self.assertRaises(DistutilsSetupError, self._run,
- {}, **{'strict': 1,
- 'restructuredtext': 1})
+ {}, **{"strict": 1,
+ "restructuredtext": 1})
def test_suite():
return unittest.makeSuite(CheckTestCase)
diff --git a/.venv3.10/Lib/distutils/tests/test_clean.py b/.venv3.10/Lib/distutils/tests/test_clean.py
index c605afd8..5f76abb6 100644
--- a/.venv3.10/Lib/distutils/tests/test_clean.py
+++ b/.venv3.10/Lib/distutils/tests/test_clean.py
@@ -16,15 +16,15 @@ def test_simple_run(self):
# let's add some elements clean should remove
dirs = [(d, os.path.join(pkg_dir, d))
- for d in ('build_temp', 'build_lib', 'bdist_base',
- 'build_scripts', 'build_base')]
+ for d in ("build_temp", "build_lib", "bdist_base",
+ "build_scripts", "build_base")]
for name, path in dirs:
os.mkdir(path)
setattr(cmd, name, path)
- if name == 'build_base':
+ if name == "build_base":
continue
- for f in ('one', 'two', 'three'):
+ for f in ("one", "two", "three"):
self.write_file(os.path.join(path, f))
# let's run the command
@@ -35,7 +35,7 @@ def test_simple_run(self):
# make sure the files where removed
for name, path in dirs:
self.assertFalse(os.path.exists(path),
- '%s was not removed' % path)
+ "%s was not removed" % path)
# let's run the command again (should spit warnings but succeed)
cmd.all = 1
diff --git a/.venv3.10/Lib/distutils/tests/test_cmd.py b/.venv3.10/Lib/distutils/tests/test_cmd.py
index cf5197c3..d225581c 100644
--- a/.venv3.10/Lib/distutils/tests/test_cmd.py
+++ b/.venv3.10/Lib/distutils/tests/test_cmd.py
@@ -21,29 +21,29 @@ def setUp(self):
def test_ensure_string_list(self):
cmd = self.cmd
- cmd.not_string_list = ['one', 2, 'three']
- cmd.yes_string_list = ['one', 'two', 'three']
+ cmd.not_string_list = ["one", 2, "three"]
+ cmd.yes_string_list = ["one", "two", "three"]
cmd.not_string_list2 = object()
- cmd.yes_string_list2 = 'ok'
- cmd.ensure_string_list('yes_string_list')
- cmd.ensure_string_list('yes_string_list2')
+ cmd.yes_string_list2 = "ok"
+ cmd.ensure_string_list("yes_string_list")
+ cmd.ensure_string_list("yes_string_list2")
self.assertRaises(DistutilsOptionError,
- cmd.ensure_string_list, 'not_string_list')
+ cmd.ensure_string_list, "not_string_list")
self.assertRaises(DistutilsOptionError,
- cmd.ensure_string_list, 'not_string_list2')
+ cmd.ensure_string_list, "not_string_list2")
- cmd.option1 = 'ok,dok'
- cmd.ensure_string_list('option1')
- self.assertEqual(cmd.option1, ['ok', 'dok'])
+ cmd.option1 = "ok,dok"
+ cmd.ensure_string_list("option1")
+ self.assertEqual(cmd.option1, ["ok", "dok"])
- cmd.option2 = ['xxx', 'www']
- cmd.ensure_string_list('option2')
+ cmd.option2 = ["xxx", "www"]
+ cmd.ensure_string_list("option2")
- cmd.option3 = ['ok', 2]
+ cmd.option3 = ["ok", 2]
self.assertRaises(DistutilsOptionError, cmd.ensure_string_list,
- 'option3')
+ "option3")
def test_make_file(self):
@@ -52,14 +52,14 @@ def test_make_file(self):
# making sure it raises when infiles is not a string or a list/tuple
self.assertRaises(TypeError, cmd.make_file,
- infiles=1, outfile='', func='func', args=())
+ infiles=1, outfile="", func="func", args=())
# making sure execute gets called properly
def _execute(func, args, exec_msg, level):
- self.assertEqual(exec_msg, 'generating out from in')
+ self.assertEqual(exec_msg, "generating out from in")
cmd.force = True
cmd.execute = _execute
- cmd.make_file(infiles='in', outfile='out', func='func', args=())
+ cmd.make_file(infiles="in", outfile="out", func="func", args=())
def test_dump_options(self):
@@ -70,57 +70,57 @@ def _announce(msg, level):
cmd.announce = _announce
cmd.option1 = 1
cmd.option2 = 1
- cmd.user_options = [('option1', '', ''), ('option2', '', '')]
+ cmd.user_options = [("option1", "", ""), ("option2", "", "")]
cmd.dump_options()
- wanted = ["command options for 'MyCmd':", ' option1 = 1',
- ' option2 = 1']
+ wanted = ["command options for 'MyCmd':", " option1 = 1",
+ " option2 = 1"]
self.assertEqual(msgs, wanted)
def test_ensure_string(self):
cmd = self.cmd
- cmd.option1 = 'ok'
- cmd.ensure_string('option1')
+ cmd.option1 = "ok"
+ cmd.ensure_string("option1")
cmd.option2 = None
- cmd.ensure_string('option2', 'xxx')
- self.assertTrue(hasattr(cmd, 'option2'))
+ cmd.ensure_string("option2", "xxx")
+ self.assertTrue(hasattr(cmd, "option2"))
cmd.option3 = 1
- self.assertRaises(DistutilsOptionError, cmd.ensure_string, 'option3')
+ self.assertRaises(DistutilsOptionError, cmd.ensure_string, "option3")
def test_ensure_filename(self):
cmd = self.cmd
cmd.option1 = __file__
- cmd.ensure_filename('option1')
- cmd.option2 = 'xxx'
- self.assertRaises(DistutilsOptionError, cmd.ensure_filename, 'option2')
+ cmd.ensure_filename("option1")
+ cmd.option2 = "xxx"
+ self.assertRaises(DistutilsOptionError, cmd.ensure_filename, "option2")
def test_ensure_dirname(self):
cmd = self.cmd
cmd.option1 = os.path.dirname(__file__) or os.curdir
- cmd.ensure_dirname('option1')
- cmd.option2 = 'xxx'
- self.assertRaises(DistutilsOptionError, cmd.ensure_dirname, 'option2')
+ cmd.ensure_dirname("option1")
+ cmd.option2 = "xxx"
+ self.assertRaises(DistutilsOptionError, cmd.ensure_dirname, "option2")
def test_debug_print(self):
cmd = self.cmd
with captured_stdout() as stdout:
- cmd.debug_print('xxx')
+ cmd.debug_print("xxx")
stdout.seek(0)
- self.assertEqual(stdout.read(), '')
+ self.assertEqual(stdout.read(), "")
debug.DEBUG = True
try:
with captured_stdout() as stdout:
- cmd.debug_print('xxx')
+ cmd.debug_print("xxx")
stdout.seek(0)
- self.assertEqual(stdout.read(), 'xxx\n')
+ self.assertEqual(stdout.read(), "xxx\n")
finally:
debug.DEBUG = False
def test_suite():
return unittest.makeSuite(CommandTestCase)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_config.py b/.venv3.10/Lib/distutils/tests/test_config.py
index 344084af..0eb4a99a 100644
--- a/.venv3.10/Lib/distutils/tests/test_config.py
+++ b/.venv3.10/Lib/distutils/tests/test_config.py
@@ -59,9 +59,9 @@ def setUp(self):
"""Patches the environment."""
super(BasePyPIRCCommandTestCase, self).setUp()
self.tmp_dir = self.mkdtemp()
- os.environ['HOME'] = self.tmp_dir
- os.environ['USERPROFILE'] = self.tmp_dir
- self.rc = os.path.join(self.tmp_dir, '.pypirc')
+ os.environ["HOME"] = self.tmp_dir
+ os.environ["USERPROFILE"] = self.tmp_dir
+ self.rc = os.path.join(self.tmp_dir, ".pypirc")
self.dist = Distribution()
class command(PyPIRCCommand):
@@ -92,26 +92,26 @@ def test_server_registration(self):
cmd = self._cmd(self.dist)
config = cmd._read_pypirc()
- config = list(sorted(config.items()))
- waited = [('password', 'secret'), ('realm', 'pypi'),
- ('repository', 'https://upload.pypi.org/legacy/'),
- ('server', 'server1'), ('username', 'me')]
+ config = sorted(config.items())
+ waited = [("password", "secret"), ("realm", "pypi"),
+ ("repository", "https://upload.pypi.org/legacy/"),
+ ("server", "server1"), ("username", "me")]
self.assertEqual(config, waited)
# old format
self.write_file(self.rc, PYPIRC_OLD)
config = cmd._read_pypirc()
- config = list(sorted(config.items()))
- waited = [('password', 'secret'), ('realm', 'pypi'),
- ('repository', 'https://upload.pypi.org/legacy/'),
- ('server', 'server-login'), ('username', 'tarek')]
+ config = sorted(config.items())
+ waited = [("password", "secret"), ("realm", "pypi"),
+ ("repository", "https://upload.pypi.org/legacy/"),
+ ("server", "server-login"), ("username", "tarek")]
self.assertEqual(config, waited)
def test_server_empty_registration(self):
cmd = self._cmd(self.dist)
rc = cmd._get_rc_file()
self.assertFalse(os.path.exists(rc))
- cmd._store_pypirc('tarek', 'xxx')
+ cmd._store_pypirc("tarek", "xxx")
self.assertTrue(os.path.exists(rc))
f = open(rc)
try:
@@ -124,13 +124,13 @@ def test_config_interpolation(self):
# using the % character in .pypirc should not raise an error (#20120)
self.write_file(self.rc, PYPIRC)
cmd = self._cmd(self.dist)
- cmd.repository = 'server3'
+ cmd.repository = "server3"
config = cmd._read_pypirc()
- config = list(sorted(config.items()))
- waited = [('password', 'yh^%#rest-of-my-password'), ('realm', 'pypi'),
- ('repository', 'https://upload.pypi.org/legacy/'),
- ('server', 'server3'), ('username', 'cbiggles')]
+ config = sorted(config.items())
+ waited = [("password", "yh^%#rest-of-my-password"), ("realm", "pypi"),
+ ("repository", "https://upload.pypi.org/legacy/"),
+ ("server", "server3"), ("username", "cbiggles")]
self.assertEqual(config, waited)
diff --git a/.venv3.10/Lib/distutils/tests/test_config_cmd.py b/.venv3.10/Lib/distutils/tests/test_config_cmd.py
index 0127ba71..1c20605d 100644
--- a/.venv3.10/Lib/distutils/tests/test_config_cmd.py
+++ b/.venv3.10/Lib/distutils/tests/test_config_cmd.py
@@ -31,33 +31,33 @@ def tearDown(self):
super(ConfigTestCase, self).tearDown()
def test_dump_file(self):
- this_file = os.path.splitext(__file__)[0] + '.py'
+ this_file = os.path.splitext(__file__)[0] + ".py"
f = open(this_file)
try:
numlines = len(f.readlines())
finally:
f.close()
- dump_file(this_file, 'I am the header')
+ dump_file(this_file, "I am the header")
self.assertEqual(len(self._logs), numlines+1)
- @unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
+ @unittest.skipIf(sys.platform == "win32", "can't test on Windows")
def test_search_cpp(self):
- cmd = missing_compiler_executable(['preprocessor'])
+ cmd = missing_compiler_executable(["preprocessor"])
if cmd is not None:
- self.skipTest('The %r command is not found' % cmd)
+ self.skipTest("The %r command is not found" % cmd)
pkg_dir, dist = self.create_dist()
cmd = config(dist)
cmd._check_compiler()
compiler = cmd.compiler
if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower():
- self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options')
+ self.skipTest("xlc: The -E option overrides the -P, -o, and -qsyntaxonly options")
# simple pattern searches
- match = cmd.search_cpp(pattern='xxx', body='/* xxx */')
+ match = cmd.search_cpp(pattern="xxx", body="/* xxx */")
self.assertEqual(match, 0)
- match = cmd.search_cpp(pattern='_configtest', body='/* xxx */')
+ match = cmd.search_cpp(pattern="_configtest", body="/* xxx */")
self.assertEqual(match, 1)
def test_finalize_options(self):
@@ -65,23 +65,23 @@ def test_finalize_options(self):
# on options
pkg_dir, dist = self.create_dist()
cmd = config(dist)
- cmd.include_dirs = 'one%stwo' % os.pathsep
- cmd.libraries = 'one'
- cmd.library_dirs = 'three%sfour' % os.pathsep
+ cmd.include_dirs = "one%stwo" % os.pathsep
+ cmd.libraries = "one"
+ cmd.library_dirs = "three%sfour" % os.pathsep
cmd.ensure_finalized()
- self.assertEqual(cmd.include_dirs, ['one', 'two'])
- self.assertEqual(cmd.libraries, ['one'])
- self.assertEqual(cmd.library_dirs, ['three', 'four'])
+ self.assertEqual(cmd.include_dirs, ["one", "two"])
+ self.assertEqual(cmd.libraries, ["one"])
+ self.assertEqual(cmd.library_dirs, ["three", "four"])
def test_clean(self):
# _clean removes files
tmp_dir = self.mkdtemp()
- f1 = os.path.join(tmp_dir, 'one')
- f2 = os.path.join(tmp_dir, 'two')
+ f1 = os.path.join(tmp_dir, "one")
+ f2 = os.path.join(tmp_dir, "two")
- self.write_file(f1, 'xxx')
- self.write_file(f2, 'xxx')
+ self.write_file(f1, "xxx")
+ self.write_file(f2, "xxx")
for f in (f1, f2):
self.assertTrue(os.path.exists(f))
diff --git a/.venv3.10/Lib/distutils/tests/test_core.py b/.venv3.10/Lib/distutils/tests/test_core.py
index 4e6694a3..68120a9a 100644
--- a/.venv3.10/Lib/distutils/tests/test_core.py
+++ b/.venv3.10/Lib/distutils/tests/test_core.py
@@ -94,8 +94,8 @@ def test_run_setup_defines_subclass(self):
# setup.py script will raise NameError.
dist = distutils.core.run_setup(
self.write_setup(setup_defines_subclass))
- install = dist.get_command_obj('install')
- self.assertIn('cmd', install.sub_commands)
+ install = dist.get_command_obj("install")
+ self.assertIn("cmd", install.sub_commands)
def test_run_setup_uses_current_dir(self):
# This tests that the setup script is run with the current directory
@@ -117,16 +117,16 @@ def test_run_setup_uses_current_dir(self):
def test_debug_mode(self):
# this covers the code called when DEBUG is set
- sys.argv = ['setup.py', '--name']
+ sys.argv = ["setup.py", "--name"]
with captured_stdout() as stdout:
- distutils.core.setup(name='bar')
+ distutils.core.setup(name="bar")
stdout.seek(0)
- self.assertEqual(stdout.read(), 'bar\n')
+ self.assertEqual(stdout.read(), "bar\n")
distutils.core.DEBUG = True
try:
with captured_stdout() as stdout:
- distutils.core.setup(name='bar')
+ distutils.core.setup(name="bar")
finally:
distutils.core.DEBUG = False
stdout.seek(0)
diff --git a/.venv3.10/Lib/distutils/tests/test_cygwinccompiler.py b/.venv3.10/Lib/distutils/tests/test_cygwinccompiler.py
index 9dc869de..6574c0f0 100644
--- a/.venv3.10/Lib/distutils/tests/test_cygwinccompiler.py
+++ b/.venv3.10/Lib/distutils/tests/test_cygwinccompiler.py
@@ -22,7 +22,7 @@ def __init__(self, cmd, shell, stdout):
# issue #6438 in Python 3.x, Popen returns bytes
self.stdout = BytesIO(exes[self.cmd])
else:
- self.stdout = os.popen(cmd, 'r')
+ self.stdout = os.popen(cmd, "r")
class CygwinCCompilerTestCase(support.TempdirManager,
@@ -31,7 +31,7 @@ class CygwinCCompilerTestCase(support.TempdirManager,
def setUp(self):
super(CygwinCCompilerTestCase, self).setUp()
self.version = sys.version
- self.python_h = os.path.join(self.mkdtemp(), 'python.h')
+ self.python_h = os.path.join(self.mkdtemp(), "python.h")
from distutils import sysconfig
self.old_get_config_h_filename = sysconfig.get_config_h_filename
sysconfig.get_config_h_filename = self._get_config_h_filename
@@ -62,23 +62,23 @@ def test_check_config_h(self):
# check_config_h looks for "GCC" in sys.version first
# returns CONFIG_H_OK if found
- sys.version = ('2.6.1 (r261:67515, Dec 6 2008, 16:42:21) \n[GCC '
- '4.0.1 (Apple Computer, Inc. build 5370)]')
+ sys.version = ("2.6.1 (r261:67515, Dec 6 2008, 16:42:21) \n[GCC "
+ "4.0.1 (Apple Computer, Inc. build 5370)]")
self.assertEqual(check_config_h()[0], CONFIG_H_OK)
# then it tries to see if it can find "__GNUC__" in pyconfig.h
- sys.version = 'something without the *CC word'
+ sys.version = "something without the *CC word"
# if the file doesn't exist it returns CONFIG_H_UNCERTAIN
self.assertEqual(check_config_h()[0], CONFIG_H_UNCERTAIN)
# if it exists but does not contain __GNUC__, it returns CONFIG_H_NOTOK
- self.write_file(self.python_h, 'xxx')
+ self.write_file(self.python_h, "xxx")
self.assertEqual(check_config_h()[0], CONFIG_H_NOTOK)
# and CONFIG_H_OK if __GNUC__ is found
- self.write_file(self.python_h, 'xxx __GNUC__ xxx')
+ self.write_file(self.python_h, "xxx __GNUC__ xxx")
self.assertEqual(check_config_h()[0], CONFIG_H_OK)
def test_get_versions(self):
@@ -88,67 +88,67 @@ def test_get_versions(self):
self.assertEqual(get_versions(), (None, None, None))
# Let's fake we have 'gcc' and it returns '3.4.5'
- self._exes['gcc'] = b'gcc (GCC) 3.4.5 (mingw special)\nFSF'
+ self._exes["gcc"] = b"gcc (GCC) 3.4.5 (mingw special)\nFSF"
res = get_versions()
- self.assertEqual(str(res[0]), '3.4.5')
+ self.assertEqual(str(res[0]), "3.4.5")
# and let's see what happens when the version
# doesn't match the regular expression
# (\d+\.\d+(\.\d+)*)
- self._exes['gcc'] = b'very strange output'
+ self._exes["gcc"] = b"very strange output"
res = get_versions()
self.assertEqual(res[0], None)
# same thing for ld
- self._exes['ld'] = b'GNU ld version 2.17.50 20060824'
+ self._exes["ld"] = b"GNU ld version 2.17.50 20060824"
res = get_versions()
- self.assertEqual(str(res[1]), '2.17.50')
- self._exes['ld'] = b'@(#)PROGRAM:ld PROJECT:ld64-77'
+ self.assertEqual(str(res[1]), "2.17.50")
+ self._exes["ld"] = b"@(#)PROGRAM:ld PROJECT:ld64-77"
res = get_versions()
self.assertEqual(res[1], None)
# and dllwrap
- self._exes['dllwrap'] = b'GNU dllwrap 2.17.50 20060824\nFSF'
+ self._exes["dllwrap"] = b"GNU dllwrap 2.17.50 20060824\nFSF"
res = get_versions()
- self.assertEqual(str(res[2]), '2.17.50')
- self._exes['dllwrap'] = b'Cheese Wrap'
+ self.assertEqual(str(res[2]), "2.17.50")
+ self._exes["dllwrap"] = b"Cheese Wrap"
res = get_versions()
self.assertEqual(res[2], None)
def test_get_msvcr(self):
# none
- sys.version = ('2.6.1 (r261:67515, Dec 6 2008, 16:42:21) '
- '\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]')
+ sys.version = ("2.6.1 (r261:67515, Dec 6 2008, 16:42:21) "
+ "\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]")
self.assertEqual(get_msvcr(), None)
# MSVC 7.0
- sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
- '[MSC v.1300 32 bits (Intel)]')
- self.assertEqual(get_msvcr(), ['msvcr70'])
+ sys.version = ("2.5.1 (r251:54863, Apr 18 2007, 08:51:08) "
+ "[MSC v.1300 32 bits (Intel)]")
+ self.assertEqual(get_msvcr(), ["msvcr70"])
# MSVC 7.1
- sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
- '[MSC v.1310 32 bits (Intel)]')
- self.assertEqual(get_msvcr(), ['msvcr71'])
+ sys.version = ("2.5.1 (r251:54863, Apr 18 2007, 08:51:08) "
+ "[MSC v.1310 32 bits (Intel)]")
+ self.assertEqual(get_msvcr(), ["msvcr71"])
# VS2005 / MSVC 8.0
- sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
- '[MSC v.1400 32 bits (Intel)]')
- self.assertEqual(get_msvcr(), ['msvcr80'])
+ sys.version = ("2.5.1 (r251:54863, Apr 18 2007, 08:51:08) "
+ "[MSC v.1400 32 bits (Intel)]")
+ self.assertEqual(get_msvcr(), ["msvcr80"])
# VS2008 / MSVC 9.0
- sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
- '[MSC v.1500 32 bits (Intel)]')
- self.assertEqual(get_msvcr(), ['msvcr90'])
+ sys.version = ("2.5.1 (r251:54863, Apr 18 2007, 08:51:08) "
+ "[MSC v.1500 32 bits (Intel)]")
+ self.assertEqual(get_msvcr(), ["msvcr90"])
# unknown
- sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
- '[MSC v.1999 32 bits (Intel)]')
+ sys.version = ("2.5.1 (r251:54863, Apr 18 2007, 08:51:08) "
+ "[MSC v.1999 32 bits (Intel)]")
self.assertRaises(ValueError, get_msvcr)
def test_suite():
return unittest.makeSuite(CygwinCCompilerTestCase)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_dep_util.py b/.venv3.10/Lib/distutils/tests/test_dep_util.py
index c6fae39c..df9d8ba7 100644
--- a/.venv3.10/Lib/distutils/tests/test_dep_util.py
+++ b/.venv3.10/Lib/distutils/tests/test_dep_util.py
@@ -12,7 +12,7 @@ class DepUtilTestCase(support.TempdirManager, unittest.TestCase):
def test_newer(self):
tmpdir = self.mkdtemp()
- new_file = os.path.join(tmpdir, 'new')
+ new_file = os.path.join(tmpdir, "new")
old_file = os.path.abspath(__file__)
# Raise DistutilsFileError if 'new_file' does not exist.
@@ -21,7 +21,7 @@ def test_newer(self):
# Return true if 'new_file' exists and is more recently modified than
# 'old_file', or if 'new_file' exists and 'old_file' doesn't.
self.write_file(new_file)
- self.assertTrue(newer(new_file, 'I_dont_exist'))
+ self.assertTrue(newer(new_file, "I_dont_exist"))
self.assertTrue(newer(new_file, old_file))
# Return false if both exist and 'old_file' is the same age or younger
@@ -30,14 +30,14 @@ def test_newer(self):
def test_newer_pairwise(self):
tmpdir = self.mkdtemp()
- sources = os.path.join(tmpdir, 'sources')
- targets = os.path.join(tmpdir, 'targets')
+ sources = os.path.join(tmpdir, "sources")
+ targets = os.path.join(tmpdir, "targets")
os.mkdir(sources)
os.mkdir(targets)
- one = os.path.join(sources, 'one')
- two = os.path.join(sources, 'two')
+ one = os.path.join(sources, "one")
+ two = os.path.join(sources, "two")
three = os.path.abspath(__file__) # I am the old file
- four = os.path.join(targets, 'four')
+ four = os.path.join(targets, "four")
self.write_file(one)
self.write_file(two)
self.write_file(four)
@@ -47,11 +47,11 @@ def test_newer_pairwise(self):
def test_newer_group(self):
tmpdir = self.mkdtemp()
- sources = os.path.join(tmpdir, 'sources')
+ sources = os.path.join(tmpdir, "sources")
os.mkdir(sources)
- one = os.path.join(sources, 'one')
- two = os.path.join(sources, 'two')
- three = os.path.join(sources, 'three')
+ one = os.path.join(sources, "one")
+ two = os.path.join(sources, "two")
+ three = os.path.join(sources, "three")
old_file = os.path.abspath(__file__)
# return true if 'old_file' is out-of-date with respect to any file
@@ -67,10 +67,10 @@ def test_newer_group(self):
self.assertRaises(OSError, newer_group, [one, two, old_file], three)
self.assertFalse(newer_group([one, two, old_file], three,
- missing='ignore'))
+ missing="ignore"))
self.assertTrue(newer_group([one, two, old_file], three,
- missing='newer'))
+ missing="newer"))
def test_suite():
diff --git a/.venv3.10/Lib/distutils/tests/test_dir_util.py b/.venv3.10/Lib/distutils/tests/test_dir_util.py
index d436cf83..b4004a9a 100644
--- a/.venv3.10/Lib/distutils/tests/test_dir_util.py
+++ b/.venv3.10/Lib/distutils/tests/test_dir_util.py
@@ -26,9 +26,9 @@ def setUp(self):
super(DirUtilTestCase, self).setUp()
self._logs = []
tmp_dir = self.mkdtemp()
- self.root_target = os.path.join(tmp_dir, 'deep')
- self.target = os.path.join(self.root_target, 'here')
- self.target2 = os.path.join(tmp_dir, 'deep2')
+ self.root_target = os.path.join(tmp_dir, "deep")
+ self.target = os.path.join(self.root_target, "here")
+ self.target2 = os.path.join(tmp_dir, "deep2")
self.old_log = log.info
log.info = self._log
@@ -44,8 +44,8 @@ def test_mkpath_remove_tree_verbosity(self):
remove_tree(self.root_target, verbose=0)
mkpath(self.target, verbose=1)
- wanted = ['creating %s' % self.root_target,
- 'creating %s' % self.target]
+ wanted = ["creating %s" % self.root_target,
+ "creating %s" % self.target]
self.assertEqual(self._logs, wanted)
self._logs = []
@@ -53,7 +53,7 @@ def test_mkpath_remove_tree_verbosity(self):
wanted = ["removing '%s' (and everything under it)" % self.root_target]
self.assertEqual(self._logs, wanted)
- @unittest.skipIf(sys.platform.startswith('win'),
+ @unittest.skipIf(sys.platform.startswith("win"),
"This test is only appropriate for POSIX-like systems.")
def test_mkpath_with_custom_mode(self):
# Get and set the current umask value for testing mode bits.
@@ -68,12 +68,12 @@ def test_mkpath_with_custom_mode(self):
def test_create_tree_verbosity(self):
- create_tree(self.root_target, ['one', 'two', 'three'], verbose=0)
+ create_tree(self.root_target, ["one", "two", "three"], verbose=0)
self.assertEqual(self._logs, [])
remove_tree(self.root_target, verbose=0)
- wanted = ['creating %s' % self.root_target]
- create_tree(self.root_target, ['one', 'two', 'three'], verbose=1)
+ wanted = ["creating %s" % self.root_target]
+ create_tree(self.root_target, ["one", "two", "three"], verbose=1)
self.assertEqual(self._logs, wanted)
remove_tree(self.root_target, verbose=0)
@@ -88,11 +88,11 @@ def test_copy_tree_verbosity(self):
remove_tree(self.root_target, verbose=0)
mkpath(self.target, verbose=0)
- a_file = os.path.join(self.target, 'ok.txt')
- with open(a_file, 'w') as f:
- f.write('some content')
+ a_file = os.path.join(self.target, "ok.txt")
+ with open(a_file, "w") as f:
+ f.write("some content")
- wanted = ['copying %s -> %s' % (a_file, self.target2)]
+ wanted = ["copying %s -> %s" % (a_file, self.target2)]
copy_tree(self.target, self.target2, verbose=1)
self.assertEqual(self._logs, wanted)
@@ -102,25 +102,25 @@ def test_copy_tree_verbosity(self):
def test_copy_tree_skips_nfs_temp_files(self):
mkpath(self.target, verbose=0)
- a_file = os.path.join(self.target, 'ok.txt')
- nfs_file = os.path.join(self.target, '.nfs123abc')
+ a_file = os.path.join(self.target, "ok.txt")
+ nfs_file = os.path.join(self.target, ".nfs123abc")
for f in a_file, nfs_file:
- with open(f, 'w') as fh:
- fh.write('some content')
+ with open(f, "w") as fh:
+ fh.write("some content")
copy_tree(self.target, self.target2)
- self.assertEqual(os.listdir(self.target2), ['ok.txt'])
+ self.assertEqual(os.listdir(self.target2), ["ok.txt"])
remove_tree(self.root_target, verbose=0)
remove_tree(self.target2, verbose=0)
def test_ensure_relative(self):
- if os.sep == '/':
- self.assertEqual(ensure_relative('/home/foo'), 'home/foo')
- self.assertEqual(ensure_relative('some/path'), 'some/path')
+ if os.sep == "/":
+ self.assertEqual(ensure_relative("/home/foo"), "home/foo")
+ self.assertEqual(ensure_relative("some/path"), "some/path")
else: # \\
- self.assertEqual(ensure_relative('c:\\home\\foo'), 'c:home\\foo')
- self.assertEqual(ensure_relative('home\\foo'), 'home\\foo')
+ self.assertEqual(ensure_relative("c:\\home\\foo"), "c:home\\foo")
+ self.assertEqual(ensure_relative("home\\foo"), "home\\foo")
def test_copy_tree_exception_in_listdir(self):
"""
diff --git a/.venv3.10/Lib/distutils/tests/test_dist.py b/.venv3.10/Lib/distutils/tests/test_dist.py
index f8a9e86b..5a3f8607 100644
--- a/.venv3.10/Lib/distutils/tests/test_dist.py
+++ b/.venv3.10/Lib/distutils/tests/test_dist.py
@@ -88,7 +88,7 @@ def test_venv_install_options(self):
sys.argv.append("install")
self.addCleanup(os.unlink, TESTFN)
- fakepath = '/somedir'
+ fakepath = "/somedir"
with open(TESTFN, "w") as f:
print(("[install]\n"
@@ -107,40 +107,40 @@ def test_venv_install_options(self):
"root = {0}").format(fakepath), file=f)
# Base case: Not in a Virtual Environment
- with mock.patch.multiple(sys, prefix='/a', base_prefix='/a') as values:
+ with mock.patch.multiple(sys, prefix="/a", base_prefix="/a") as values:
d = self.create_distribution([TESTFN])
option_tuple = (TESTFN, fakepath)
result_dict = {
- 'install_base': option_tuple,
- 'install_platbase': option_tuple,
- 'install_lib': option_tuple,
- 'install_platlib': option_tuple,
- 'install_purelib': option_tuple,
- 'install_headers': option_tuple,
- 'install_scripts': option_tuple,
- 'install_data': option_tuple,
- 'prefix': option_tuple,
- 'exec_prefix': option_tuple,
- 'home': option_tuple,
- 'user': option_tuple,
- 'root': option_tuple,
+ "install_base": option_tuple,
+ "install_platbase": option_tuple,
+ "install_lib": option_tuple,
+ "install_platlib": option_tuple,
+ "install_purelib": option_tuple,
+ "install_headers": option_tuple,
+ "install_scripts": option_tuple,
+ "install_data": option_tuple,
+ "prefix": option_tuple,
+ "exec_prefix": option_tuple,
+ "home": option_tuple,
+ "user": option_tuple,
+ "root": option_tuple,
}
self.assertEqual(
- sorted(d.command_options.get('install').keys()),
+ sorted(d.command_options.get("install").keys()),
sorted(result_dict.keys()))
- for (key, value) in d.command_options.get('install').items():
+ for (key, value) in d.command_options.get("install").items():
self.assertEqual(value, result_dict[key])
# Test case: In a Virtual Environment
- with mock.patch.multiple(sys, prefix='/a', base_prefix='/b') as values:
+ with mock.patch.multiple(sys, prefix="/a", base_prefix="/b") as values:
d = self.create_distribution([TESTFN])
for key in result_dict.keys():
- self.assertNotIn(key, d.command_options.get('install', {}))
+ self.assertNotIn(key, d.command_options.get("install", {}))
def test_command_packages_configfile(self):
sys.argv.append("build")
@@ -178,63 +178,63 @@ def test_empty_options(self):
def _warn(msg):
warns.append(msg)
- self.addCleanup(setattr, warnings, 'warn', warnings.warn)
+ self.addCleanup(setattr, warnings, "warn", warnings.warn)
warnings.warn = _warn
- dist = Distribution(attrs={'author': 'xxx', 'name': 'xxx',
- 'version': 'xxx', 'url': 'xxxx',
- 'options': {}})
+ dist = Distribution(attrs={"author": "xxx", "name": "xxx",
+ "version": "xxx", "url": "xxxx",
+ "options": {}})
self.assertEqual(len(warns), 0)
- self.assertNotIn('options', dir(dist))
+ self.assertNotIn("options", dir(dist))
def test_finalize_options(self):
- attrs = {'keywords': 'one,two',
- 'platforms': 'one,two'}
+ attrs = {"keywords": "one,two",
+ "platforms": "one,two"}
dist = Distribution(attrs=attrs)
dist.finalize_options()
# finalize_option splits platforms and keywords
- self.assertEqual(dist.metadata.platforms, ['one', 'two'])
- self.assertEqual(dist.metadata.keywords, ['one', 'two'])
+ self.assertEqual(dist.metadata.platforms, ["one", "two"])
+ self.assertEqual(dist.metadata.keywords, ["one", "two"])
- attrs = {'keywords': 'foo bar',
- 'platforms': 'foo bar'}
+ attrs = {"keywords": "foo bar",
+ "platforms": "foo bar"}
dist = Distribution(attrs=attrs)
dist.finalize_options()
- self.assertEqual(dist.metadata.platforms, ['foo bar'])
- self.assertEqual(dist.metadata.keywords, ['foo bar'])
+ self.assertEqual(dist.metadata.platforms, ["foo bar"])
+ self.assertEqual(dist.metadata.keywords, ["foo bar"])
def test_get_command_packages(self):
dist = Distribution()
self.assertEqual(dist.command_packages, None)
cmds = dist.get_command_packages()
- self.assertEqual(cmds, ['distutils.command'])
+ self.assertEqual(cmds, ["distutils.command"])
self.assertEqual(dist.command_packages,
- ['distutils.command'])
+ ["distutils.command"])
- dist.command_packages = 'one,two'
+ dist.command_packages = "one,two"
cmds = dist.get_command_packages()
- self.assertEqual(cmds, ['distutils.command', 'one', 'two'])
+ self.assertEqual(cmds, ["distutils.command", "one", "two"])
def test_announce(self):
# make sure the level is known
dist = Distribution()
- args = ('ok',)
- kwargs = {'level': 'ok2'}
+ args = ("ok",)
+ kwargs = {"level": "ok2"}
self.assertRaises(ValueError, dist.announce, args, kwargs)
def test_find_config_files_disable(self):
# Ticket #1180: Allow user to disable their home config file.
temp_home = self.mkdtemp()
- if os.name == 'posix':
+ if os.name == "posix":
user_filename = os.path.join(temp_home, ".pydistutils.cfg")
else:
user_filename = os.path.join(temp_home, "pydistutils.cfg")
- with open(user_filename, 'w') as f:
- f.write('[distutils]\n')
+ with open(user_filename, "w") as f:
+ f.write("[distutils]\n")
def _expander(path):
return temp_home
@@ -245,7 +245,7 @@ def _expander(path):
d = Distribution()
all_files = d.find_config_files()
- d = Distribution(attrs={'script_args': ['--no-user-cfg']})
+ d = Distribution(attrs={"script_args": ["--no-user-cfg"]})
files = d.find_config_files()
finally:
os.path.expanduser = old_expander
@@ -358,68 +358,68 @@ def test_obsoletes_to_list(self):
self.assertIsInstance(dist.metadata.obsoletes, list)
def test_classifier(self):
- attrs = {'name': 'Boa', 'version': '3.0',
- 'classifiers': ['Programming Language :: Python :: 3']}
+ attrs = {"name": "Boa", "version": "3.0",
+ "classifiers": ["Programming Language :: Python :: 3"]}
dist = Distribution(attrs)
self.assertEqual(dist.get_classifiers(),
- ['Programming Language :: Python :: 3'])
+ ["Programming Language :: Python :: 3"])
meta = self.format_metadata(dist)
- self.assertIn('Metadata-Version: 1.1', meta)
+ self.assertIn("Metadata-Version: 1.1", meta)
def test_classifier_invalid_type(self):
- attrs = {'name': 'Boa', 'version': '3.0',
- 'classifiers': ('Programming Language :: Python :: 3',)}
+ attrs = {"name": "Boa", "version": "3.0",
+ "classifiers": ("Programming Language :: Python :: 3",)}
with captured_stderr() as error:
d = Distribution(attrs)
# should have warning about passing a non-list
- self.assertIn('should be a list', error.getvalue())
+ self.assertIn("should be a list", error.getvalue())
# should be converted to a list
self.assertIsInstance(d.metadata.classifiers, list)
self.assertEqual(d.metadata.classifiers,
- list(attrs['classifiers']))
+ list(attrs["classifiers"]))
def test_keywords(self):
- attrs = {'name': 'Monty', 'version': '1.0',
- 'keywords': ['spam', 'eggs', 'life of brian']}
+ attrs = {"name": "Monty", "version": "1.0",
+ "keywords": ["spam", "eggs", "life of brian"]}
dist = Distribution(attrs)
self.assertEqual(dist.get_keywords(),
- ['spam', 'eggs', 'life of brian'])
+ ["spam", "eggs", "life of brian"])
def test_keywords_invalid_type(self):
- attrs = {'name': 'Monty', 'version': '1.0',
- 'keywords': ('spam', 'eggs', 'life of brian')}
+ attrs = {"name": "Monty", "version": "1.0",
+ "keywords": ("spam", "eggs", "life of brian")}
with captured_stderr() as error:
d = Distribution(attrs)
# should have warning about passing a non-list
- self.assertIn('should be a list', error.getvalue())
+ self.assertIn("should be a list", error.getvalue())
# should be converted to a list
self.assertIsInstance(d.metadata.keywords, list)
- self.assertEqual(d.metadata.keywords, list(attrs['keywords']))
+ self.assertEqual(d.metadata.keywords, list(attrs["keywords"]))
def test_platforms(self):
- attrs = {'name': 'Monty', 'version': '1.0',
- 'platforms': ['GNU/Linux', 'Some Evil Platform']}
+ attrs = {"name": "Monty", "version": "1.0",
+ "platforms": ["GNU/Linux", "Some Evil Platform"]}
dist = Distribution(attrs)
self.assertEqual(dist.get_platforms(),
- ['GNU/Linux', 'Some Evil Platform'])
+ ["GNU/Linux", "Some Evil Platform"])
def test_platforms_invalid_types(self):
- attrs = {'name': 'Monty', 'version': '1.0',
- 'platforms': ('GNU/Linux', 'Some Evil Platform')}
+ attrs = {"name": "Monty", "version": "1.0",
+ "platforms": ("GNU/Linux", "Some Evil Platform")}
with captured_stderr() as error:
d = Distribution(attrs)
# should have warning about passing a non-list
- self.assertIn('should be a list', error.getvalue())
+ self.assertIn("should be a list", error.getvalue())
# should be converted to a list
self.assertIsInstance(d.metadata.platforms, list)
- self.assertEqual(d.metadata.platforms, list(attrs['platforms']))
+ self.assertEqual(d.metadata.platforms, list(attrs["platforms"]))
def test_download_url(self):
- attrs = {'name': 'Boa', 'version': '3.0',
- 'download_url': 'http://example.org/boa'}
+ attrs = {"name": "Boa", "version": "3.0",
+ "download_url": "http://example.org/boa"}
dist = Distribution(attrs)
meta = self.format_metadata(dist)
- self.assertIn('Metadata-Version: 1.1', meta)
+ self.assertIn("Metadata-Version: 1.1", meta)
def test_long_description(self):
long_desc = textwrap.dedent("""\
@@ -433,22 +433,22 @@ def test_long_description(self):
dist = Distribution(attrs)
meta = self.format_metadata(dist)
- meta = meta.replace('\n' + 8 * ' ', '\n')
+ meta = meta.replace("\n" + 8 * " ", "\n")
self.assertIn(long_desc, meta)
def test_custom_pydistutils(self):
# fixes #2166
# make sure pydistutils.cfg is found
- if os.name == 'posix':
+ if os.name == "posix":
user_filename = ".pydistutils.cfg"
else:
user_filename = "pydistutils.cfg"
temp_dir = self.mkdtemp()
user_filename = os.path.join(temp_dir, user_filename)
- f = open(user_filename, 'w')
+ f = open(user_filename, "w")
try:
- f.write('.')
+ f.write(".")
finally:
f.close()
@@ -456,25 +456,25 @@ def test_custom_pydistutils(self):
dist = Distribution()
# linux-style
- if sys.platform in ('linux', 'darwin'):
- os.environ['HOME'] = temp_dir
+ if sys.platform in ("linux", "darwin"):
+ os.environ["HOME"] = temp_dir
files = dist.find_config_files()
self.assertIn(user_filename, files)
# win32-style
- if sys.platform == 'win32':
+ if sys.platform == "win32":
# home drive should be found
- os.environ['USERPROFILE'] = temp_dir
+ os.environ["USERPROFILE"] = temp_dir
files = dist.find_config_files()
self.assertIn(user_filename, files,
- '%r not found in %r' % (user_filename, files))
+ "%r not found in %r" % (user_filename, files))
finally:
os.remove(user_filename)
def test_fix_help_options(self):
- help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)]
+ help_tuples = [("a", "b", "c", "d"), (1, 2, 3, 4)]
fancy_options = fix_help_options(help_tuples)
- self.assertEqual(fancy_options[0], ('a', 'b', 'c'))
+ self.assertEqual(fancy_options[0], ("a", "b", "c"))
self.assertEqual(fancy_options[1], (1, 2, 3))
def test_show_help(self):
@@ -483,12 +483,12 @@ def test_show_help(self):
dist = Distribution()
sys.argv = []
dist.help = 1
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
with captured_stdout() as s:
dist.parse_command_line()
- output = [line for line in s.getvalue().split('\n')
- if line.strip() != '']
+ output = [line for line in s.getvalue().split("\n")
+ if line.strip() != ""]
self.assertTrue(output)
@@ -498,8 +498,8 @@ def test_read_metadata(self):
"long_description": "desc",
"description": "xxx",
"download_url": "http://example.com",
- "keywords": ['one', 'two'],
- "requires": ['foo']}
+ "keywords": ["one", "two"],
+ "requires": ["foo"]}
dist = Distribution(attrs)
metadata = dist.metadata
@@ -513,11 +513,11 @@ def test_read_metadata(self):
self.assertEqual(metadata.name, "package")
self.assertEqual(metadata.version, "1.0")
self.assertEqual(metadata.description, "xxx")
- self.assertEqual(metadata.download_url, 'http://example.com')
- self.assertEqual(metadata.keywords, ['one', 'two'])
- self.assertEqual(metadata.platforms, ['UNKNOWN'])
+ self.assertEqual(metadata.download_url, "http://example.com")
+ self.assertEqual(metadata.keywords, ["one", "two"])
+ self.assertEqual(metadata.platforms, ["UNKNOWN"])
self.assertEqual(metadata.obsoletes, None)
- self.assertEqual(metadata.requires, ['foo'])
+ self.assertEqual(metadata.requires, ["foo"])
def test_suite():
suite = unittest.TestSuite()
diff --git a/.venv3.10/Lib/distutils/tests/test_extension.py b/.venv3.10/Lib/distutils/tests/test_extension.py
index 81fad02d..827b022b 100644
--- a/.venv3.10/Lib/distutils/tests/test_extension.py
+++ b/.venv3.10/Lib/distutils/tests/test_extension.py
@@ -12,7 +12,7 @@ class ExtensionTestCase(unittest.TestCase):
def test_read_setup_file(self):
# trying to read a Setup file
# (sample extracted from the PyGame project)
- setup = os.path.join(os.path.dirname(__file__), 'Setup.sample')
+ setup = os.path.join(os.path.dirname(__file__), "Setup.sample")
exts = read_setup_file(setup)
names = [ext.name for ext in exts]
@@ -20,35 +20,35 @@ def test_read_setup_file(self):
# here are the extensions read_setup_file should have created
# out of the file
- wanted = ['_arraysurfarray', '_camera', '_numericsndarray',
- '_numericsurfarray', 'base', 'bufferproxy', 'cdrom',
- 'color', 'constants', 'display', 'draw', 'event',
- 'fastevent', 'font', 'gfxdraw', 'image', 'imageext',
- 'joystick', 'key', 'mask', 'mixer', 'mixer_music',
- 'mouse', 'movie', 'overlay', 'pixelarray', 'pypm',
- 'rect', 'rwobject', 'scrap', 'surface', 'surflock',
- 'time', 'transform']
+ wanted = ["_arraysurfarray", "_camera", "_numericsndarray",
+ "_numericsurfarray", "base", "bufferproxy", "cdrom",
+ "color", "constants", "display", "draw", "event",
+ "fastevent", "font", "gfxdraw", "image", "imageext",
+ "joystick", "key", "mask", "mixer", "mixer_music",
+ "mouse", "movie", "overlay", "pixelarray", "pypm",
+ "rect", "rwobject", "scrap", "surface", "surflock",
+ "time", "transform"]
self.assertEqual(names, wanted)
def test_extension_init(self):
# the first argument, which is the name, must be a string
self.assertRaises(AssertionError, Extension, 1, [])
- ext = Extension('name', [])
- self.assertEqual(ext.name, 'name')
+ ext = Extension("name", [])
+ self.assertEqual(ext.name, "name")
# the second argument, which is the list of files, must
# be a list of strings
- self.assertRaises(AssertionError, Extension, 'name', 'file')
- self.assertRaises(AssertionError, Extension, 'name', ['file', 1])
- ext = Extension('name', ['file1', 'file2'])
- self.assertEqual(ext.sources, ['file1', 'file2'])
+ self.assertRaises(AssertionError, Extension, "name", "file")
+ self.assertRaises(AssertionError, Extension, "name", ["file", 1])
+ ext = Extension("name", ["file1", "file2"])
+ self.assertEqual(ext.sources, ["file1", "file2"])
# others arguments have defaults
- for attr in ('include_dirs', 'define_macros', 'undef_macros',
- 'library_dirs', 'libraries', 'runtime_library_dirs',
- 'extra_objects', 'extra_compile_args', 'extra_link_args',
- 'export_symbols', 'swig_opts', 'depends'):
+ for attr in ("include_dirs", "define_macros", "undef_macros",
+ "library_dirs", "libraries", "runtime_library_dirs",
+ "extra_objects", "extra_compile_args", "extra_link_args",
+ "export_symbols", "swig_opts", "depends"):
self.assertEqual(getattr(ext, attr), [])
self.assertEqual(ext.language, None)
@@ -56,8 +56,8 @@ def test_extension_init(self):
# if there are unknown keyword options, warn about them
with check_warnings() as w:
- warnings.simplefilter('always')
- ext = Extension('name', ['file1', 'file2'], chic=True)
+ warnings.simplefilter("always")
+ ext = Extension("name", ["file1", "file2"], chic=True)
self.assertEqual(len(w.warnings), 1)
self.assertEqual(str(w.warnings[0].message),
diff --git a/.venv3.10/Lib/distutils/tests/test_file_util.py b/.venv3.10/Lib/distutils/tests/test_file_util.py
index c7783b85..9fe3f195 100644
--- a/.venv3.10/Lib/distutils/tests/test_file_util.py
+++ b/.venv3.10/Lib/distutils/tests/test_file_util.py
@@ -26,18 +26,18 @@ def setUp(self):
self.old_log = log.info
log.info = self._log
tmp_dir = self.mkdtemp()
- self.source = os.path.join(tmp_dir, 'f1')
- self.target = os.path.join(tmp_dir, 'f2')
- self.target_dir = os.path.join(tmp_dir, 'd1')
+ self.source = os.path.join(tmp_dir, "f1")
+ self.target = os.path.join(tmp_dir, "f2")
+ self.target_dir = os.path.join(tmp_dir, "d1")
def tearDown(self):
log.info = self.old_log
super(FileUtilTestCase, self).tearDown()
def test_move_file_verbosity(self):
- f = open(self.source, 'w')
+ f = open(self.source, "w")
try:
- f.write('some content')
+ f.write("some content")
finally:
f.close()
@@ -49,7 +49,7 @@ def test_move_file_verbosity(self):
move_file(self.target, self.source, verbose=0)
move_file(self.source, self.target, verbose=1)
- wanted = ['moving %s -> %s' % (self.source, self.target)]
+ wanted = ["moving %s -> %s" % (self.source, self.target)]
self.assertEqual(self._logs, wanted)
# back to original state
@@ -59,15 +59,15 @@ def test_move_file_verbosity(self):
# now the target is a dir
os.mkdir(self.target_dir)
move_file(self.source, self.target_dir, verbose=1)
- wanted = ['moving %s -> %s' % (self.source, self.target_dir)]
+ wanted = ["moving %s -> %s" % (self.source, self.target_dir)]
self.assertEqual(self._logs, wanted)
def test_move_file_exception_unpacking_rename(self):
# see issue 22182
with patch("os.rename", side_effect=OSError("wrong", 1)), \
self.assertRaises(DistutilsFileError):
- with open(self.source, 'w') as fobj:
- fobj.write('spam eggs')
+ with open(self.source, "w") as fobj:
+ fobj.write("spam eggs")
move_file(self.source, self.target, verbose=0)
def test_move_file_exception_unpacking_unlink(self):
@@ -75,46 +75,46 @@ def test_move_file_exception_unpacking_unlink(self):
with patch("os.rename", side_effect=OSError(errno.EXDEV, "wrong")), \
patch("os.unlink", side_effect=OSError("wrong", 1)), \
self.assertRaises(DistutilsFileError):
- with open(self.source, 'w') as fobj:
- fobj.write('spam eggs')
+ with open(self.source, "w") as fobj:
+ fobj.write("spam eggs")
move_file(self.source, self.target, verbose=0)
def test_copy_file_hard_link(self):
- with open(self.source, 'w') as f:
- f.write('some content')
+ with open(self.source, "w") as f:
+ f.write("some content")
# Check first that copy_file() will not fall back on copying the file
# instead of creating the hard link.
try:
os.link(self.source, self.target)
except OSError as e:
- self.skipTest('os.link: %s' % e)
+ self.skipTest("os.link: %s" % e)
else:
unlink(self.target)
st = os.stat(self.source)
- copy_file(self.source, self.target, link='hard')
+ copy_file(self.source, self.target, link="hard")
st2 = os.stat(self.source)
st3 = os.stat(self.target)
self.assertTrue(os.path.samestat(st, st2), (st, st2))
self.assertTrue(os.path.samestat(st2, st3), (st2, st3))
- with open(self.source, 'r') as f:
- self.assertEqual(f.read(), 'some content')
+ with open(self.source, "r") as f:
+ self.assertEqual(f.read(), "some content")
def test_copy_file_hard_link_failure(self):
# If hard linking fails, copy_file() falls back on copying file
# (some special filesystems don't support hard linking even under
# Unix, see issue #8876).
- with open(self.source, 'w') as f:
- f.write('some content')
+ with open(self.source, "w") as f:
+ f.write("some content")
st = os.stat(self.source)
with patch("os.link", side_effect=OSError(0, "linking unsupported")):
- copy_file(self.source, self.target, link='hard')
+ copy_file(self.source, self.target, link="hard")
st2 = os.stat(self.source)
st3 = os.stat(self.target)
self.assertTrue(os.path.samestat(st, st2), (st, st2))
self.assertFalse(os.path.samestat(st2, st3), (st2, st3))
for fn in (self.source, self.target):
- with open(fn, 'r') as f:
- self.assertEqual(f.read(), 'some content')
+ with open(fn, "r") as f:
+ self.assertEqual(f.read(), "some content")
def test_suite():
diff --git a/.venv3.10/Lib/distutils/tests/test_filelist.py b/.venv3.10/Lib/distutils/tests/test_filelist.py
index cee97d43..0bddb1fc 100644
--- a/.venv3.10/Lib/distutils/tests/test_filelist.py
+++ b/.venv3.10/Lib/distutils/tests/test_filelist.py
@@ -30,7 +30,7 @@
def make_local_path(s):
"""Converts '/' in a string to os.sep"""
- return s.replace('/', os.sep)
+ return s.replace("/", os.sep)
class FileListTestCase(support.LoggingSilencer,
@@ -46,20 +46,20 @@ def assertWarnings(self):
def test_glob_to_re(self):
sep = os.sep
- if os.sep == '\\':
+ if os.sep == "\\":
sep = re.escape(os.sep)
for glob, regex in (
# simple cases
- ('foo*', r'(?s:foo[^%(sep)s]*)\Z'),
- ('foo?', r'(?s:foo[^%(sep)s])\Z'),
- ('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])\Z'),
+ ("foo*", r"(?s:foo[^%(sep)s]*)\Z"),
+ ("foo?", r"(?s:foo[^%(sep)s])\Z"),
+ ("foo??", r"(?s:foo[^%(sep)s][^%(sep)s])\Z"),
# special cases
- (r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)\Z'),
- (r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)\Z'),
- ('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'),
- (r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z')):
- regex = regex % {'sep': sep}
+ (r"foo\\*", r"(?s:foo\\\\[^%(sep)s]*)\Z"),
+ (r"foo\\\*", r"(?s:foo\\\\\\[^%(sep)s]*)\Z"),
+ ("foo????", r"(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z"),
+ (r"foo\\??", r"(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z")):
+ regex = regex % {"sep": sep}
self.assertEqual(glob_to_re(glob), regex)
def test_process_template_line(self):
@@ -68,36 +68,36 @@ def test_process_template_line(self):
l = make_local_path
# simulated file list
- file_list.allfiles = ['foo.tmp', 'ok', 'xo', 'four.txt',
- 'buildout.cfg',
+ file_list.allfiles = ["foo.tmp", "ok", "xo", "four.txt",
+ "buildout.cfg",
# filelist does not filter out VCS directories,
# it's sdist that does
- l('.hg/last-message.txt'),
- l('global/one.txt'),
- l('global/two.txt'),
- l('global/files.x'),
- l('global/here.tmp'),
- l('f/o/f.oo'),
- l('dir/graft-one'),
- l('dir/dir2/graft2'),
- l('dir3/ok'),
- l('dir3/sub/ok.txt'),
+ l(".hg/last-message.txt"),
+ l("global/one.txt"),
+ l("global/two.txt"),
+ l("global/files.x"),
+ l("global/here.tmp"),
+ l("f/o/f.oo"),
+ l("dir/graft-one"),
+ l("dir/dir2/graft2"),
+ l("dir3/ok"),
+ l("dir3/sub/ok.txt"),
]
- for line in MANIFEST_IN.split('\n'):
- if line.strip() == '':
+ for line in MANIFEST_IN.split("\n"):
+ if line.strip() == "":
continue
file_list.process_template_line(line)
- wanted = ['ok',
- 'buildout.cfg',
- 'four.txt',
- l('.hg/last-message.txt'),
- l('global/one.txt'),
- l('global/two.txt'),
- l('f/o/f.oo'),
- l('dir/graft-one'),
- l('dir/dir2/graft2'),
+ wanted = ["ok",
+ "buildout.cfg",
+ "four.txt",
+ l(".hg/last-message.txt"),
+ l("global/one.txt"),
+ l("global/two.txt"),
+ l("f/o/f.oo"),
+ l("dir/graft-one"),
+ l("dir/dir2/graft2"),
]
self.assertEqual(file_list.files, wanted)
@@ -105,192 +105,192 @@ def test_process_template_line(self):
def test_debug_print(self):
file_list = FileList()
with captured_stdout() as stdout:
- file_list.debug_print('xxx')
- self.assertEqual(stdout.getvalue(), '')
+ file_list.debug_print("xxx")
+ self.assertEqual(stdout.getvalue(), "")
debug.DEBUG = True
try:
with captured_stdout() as stdout:
- file_list.debug_print('xxx')
- self.assertEqual(stdout.getvalue(), 'xxx\n')
+ file_list.debug_print("xxx")
+ self.assertEqual(stdout.getvalue(), "xxx\n")
finally:
debug.DEBUG = False
def test_set_allfiles(self):
file_list = FileList()
- files = ['a', 'b', 'c']
+ files = ["a", "b", "c"]
file_list.set_allfiles(files)
self.assertEqual(file_list.allfiles, files)
def test_remove_duplicates(self):
file_list = FileList()
- file_list.files = ['a', 'b', 'a', 'g', 'c', 'g']
+ file_list.files = ["a", "b", "a", "g", "c", "g"]
# files must be sorted beforehand (sdist does it)
file_list.sort()
file_list.remove_duplicates()
- self.assertEqual(file_list.files, ['a', 'b', 'c', 'g'])
+ self.assertEqual(file_list.files, ["a", "b", "c", "g"])
def test_translate_pattern(self):
# not regex
self.assertTrue(hasattr(
- translate_pattern('a', anchor=True, is_regex=False),
- 'search'))
+ translate_pattern("a", anchor=True, is_regex=False),
+ "search"))
# is a regex
- regex = re.compile('a')
+ regex = re.compile("a")
self.assertEqual(
translate_pattern(regex, anchor=True, is_regex=True),
regex)
# plain string flagged as regex
self.assertTrue(hasattr(
- translate_pattern('a', anchor=True, is_regex=True),
- 'search'))
+ translate_pattern("a", anchor=True, is_regex=True),
+ "search"))
# glob support
self.assertTrue(translate_pattern(
- '*.py', anchor=True, is_regex=False).search('filelist.py'))
+ "*.py", anchor=True, is_regex=False).search("filelist.py"))
def test_exclude_pattern(self):
# return False if no match
file_list = FileList()
- self.assertFalse(file_list.exclude_pattern('*.py'))
+ self.assertFalse(file_list.exclude_pattern("*.py"))
# return True if files match
file_list = FileList()
- file_list.files = ['a.py', 'b.py']
- self.assertTrue(file_list.exclude_pattern('*.py'))
+ file_list.files = ["a.py", "b.py"]
+ self.assertTrue(file_list.exclude_pattern("*.py"))
# test excludes
file_list = FileList()
- file_list.files = ['a.py', 'a.txt']
- file_list.exclude_pattern('*.py')
- self.assertEqual(file_list.files, ['a.txt'])
+ file_list.files = ["a.py", "a.txt"]
+ file_list.exclude_pattern("*.py")
+ self.assertEqual(file_list.files, ["a.txt"])
def test_include_pattern(self):
# return False if no match
file_list = FileList()
file_list.set_allfiles([])
- self.assertFalse(file_list.include_pattern('*.py'))
+ self.assertFalse(file_list.include_pattern("*.py"))
# return True if files match
file_list = FileList()
- file_list.set_allfiles(['a.py', 'b.txt'])
- self.assertTrue(file_list.include_pattern('*.py'))
+ file_list.set_allfiles(["a.py", "b.txt"])
+ self.assertTrue(file_list.include_pattern("*.py"))
# test * matches all files
file_list = FileList()
self.assertIsNone(file_list.allfiles)
- file_list.set_allfiles(['a.py', 'b.txt'])
- file_list.include_pattern('*')
- self.assertEqual(file_list.allfiles, ['a.py', 'b.txt'])
+ file_list.set_allfiles(["a.py", "b.txt"])
+ file_list.include_pattern("*")
+ self.assertEqual(file_list.allfiles, ["a.py", "b.txt"])
def test_process_template(self):
l = make_local_path
# invalid lines
file_list = FileList()
- for action in ('include', 'exclude', 'global-include',
- 'global-exclude', 'recursive-include',
- 'recursive-exclude', 'graft', 'prune', 'blarg'):
+ for action in ("include", "exclude", "global-include",
+ "global-exclude", "recursive-include",
+ "recursive-exclude", "graft", "prune", "blarg"):
self.assertRaises(DistutilsTemplateError,
file_list.process_template_line, action)
# include
file_list = FileList()
- file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')])
+ file_list.set_allfiles(["a.py", "b.txt", l("d/c.py")])
- file_list.process_template_line('include *.py')
- self.assertEqual(file_list.files, ['a.py'])
+ file_list.process_template_line("include *.py")
+ self.assertEqual(file_list.files, ["a.py"])
self.assertNoWarnings()
- file_list.process_template_line('include *.rb')
- self.assertEqual(file_list.files, ['a.py'])
+ file_list.process_template_line("include *.rb")
+ self.assertEqual(file_list.files, ["a.py"])
self.assertWarnings()
# exclude
file_list = FileList()
- file_list.files = ['a.py', 'b.txt', l('d/c.py')]
+ file_list.files = ["a.py", "b.txt", l("d/c.py")]
- file_list.process_template_line('exclude *.py')
- self.assertEqual(file_list.files, ['b.txt', l('d/c.py')])
+ file_list.process_template_line("exclude *.py")
+ self.assertEqual(file_list.files, ["b.txt", l("d/c.py")])
self.assertNoWarnings()
- file_list.process_template_line('exclude *.rb')
- self.assertEqual(file_list.files, ['b.txt', l('d/c.py')])
+ file_list.process_template_line("exclude *.rb")
+ self.assertEqual(file_list.files, ["b.txt", l("d/c.py")])
self.assertWarnings()
# global-include
file_list = FileList()
- file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')])
+ file_list.set_allfiles(["a.py", "b.txt", l("d/c.py")])
- file_list.process_template_line('global-include *.py')
- self.assertEqual(file_list.files, ['a.py', l('d/c.py')])
+ file_list.process_template_line("global-include *.py")
+ self.assertEqual(file_list.files, ["a.py", l("d/c.py")])
self.assertNoWarnings()
- file_list.process_template_line('global-include *.rb')
- self.assertEqual(file_list.files, ['a.py', l('d/c.py')])
+ file_list.process_template_line("global-include *.rb")
+ self.assertEqual(file_list.files, ["a.py", l("d/c.py")])
self.assertWarnings()
# global-exclude
file_list = FileList()
- file_list.files = ['a.py', 'b.txt', l('d/c.py')]
+ file_list.files = ["a.py", "b.txt", l("d/c.py")]
- file_list.process_template_line('global-exclude *.py')
- self.assertEqual(file_list.files, ['b.txt'])
+ file_list.process_template_line("global-exclude *.py")
+ self.assertEqual(file_list.files, ["b.txt"])
self.assertNoWarnings()
- file_list.process_template_line('global-exclude *.rb')
- self.assertEqual(file_list.files, ['b.txt'])
+ file_list.process_template_line("global-exclude *.rb")
+ self.assertEqual(file_list.files, ["b.txt"])
self.assertWarnings()
# recursive-include
file_list = FileList()
- file_list.set_allfiles(['a.py', l('d/b.py'), l('d/c.txt'),
- l('d/d/e.py')])
+ file_list.set_allfiles(["a.py", l("d/b.py"), l("d/c.txt"),
+ l("d/d/e.py")])
- file_list.process_template_line('recursive-include d *.py')
- self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')])
+ file_list.process_template_line("recursive-include d *.py")
+ self.assertEqual(file_list.files, [l("d/b.py"), l("d/d/e.py")])
self.assertNoWarnings()
- file_list.process_template_line('recursive-include e *.py')
- self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')])
+ file_list.process_template_line("recursive-include e *.py")
+ self.assertEqual(file_list.files, [l("d/b.py"), l("d/d/e.py")])
self.assertWarnings()
# recursive-exclude
file_list = FileList()
- file_list.files = ['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')]
+ file_list.files = ["a.py", l("d/b.py"), l("d/c.txt"), l("d/d/e.py")]
- file_list.process_template_line('recursive-exclude d *.py')
- self.assertEqual(file_list.files, ['a.py', l('d/c.txt')])
+ file_list.process_template_line("recursive-exclude d *.py")
+ self.assertEqual(file_list.files, ["a.py", l("d/c.txt")])
self.assertNoWarnings()
- file_list.process_template_line('recursive-exclude e *.py')
- self.assertEqual(file_list.files, ['a.py', l('d/c.txt')])
+ file_list.process_template_line("recursive-exclude e *.py")
+ self.assertEqual(file_list.files, ["a.py", l("d/c.txt")])
self.assertWarnings()
# graft
file_list = FileList()
- file_list.set_allfiles(['a.py', l('d/b.py'), l('d/d/e.py'),
- l('f/f.py')])
+ file_list.set_allfiles(["a.py", l("d/b.py"), l("d/d/e.py"),
+ l("f/f.py")])
- file_list.process_template_line('graft d')
- self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')])
+ file_list.process_template_line("graft d")
+ self.assertEqual(file_list.files, [l("d/b.py"), l("d/d/e.py")])
self.assertNoWarnings()
- file_list.process_template_line('graft e')
- self.assertEqual(file_list.files, [l('d/b.py'), l('d/d/e.py')])
+ file_list.process_template_line("graft e")
+ self.assertEqual(file_list.files, [l("d/b.py"), l("d/d/e.py")])
self.assertWarnings()
# prune
file_list = FileList()
- file_list.files = ['a.py', l('d/b.py'), l('d/d/e.py'), l('f/f.py')]
+ file_list.files = ["a.py", l("d/b.py"), l("d/d/e.py"), l("f/f.py")]
- file_list.process_template_line('prune d')
- self.assertEqual(file_list.files, ['a.py', l('f/f.py')])
+ file_list.process_template_line("prune d")
+ self.assertEqual(file_list.files, ["a.py", l("f/f.py")])
self.assertNoWarnings()
- file_list.process_template_line('prune e')
- self.assertEqual(file_list.files, ['a.py', l('f/f.py')])
+ file_list.process_template_line("prune e")
+ self.assertEqual(file_list.files, ["a.py", l("f/f.py")])
self.assertWarnings()
@@ -298,7 +298,7 @@ class FindAllTestCase(unittest.TestCase):
@os_helper.skip_unless_symlink
def test_missing_symlink(self):
with os_helper.temp_cwd():
- os.symlink('foo', 'bar')
+ os.symlink("foo", "bar")
self.assertEqual(filelist.findall(), [])
def test_basic_discovery(self):
@@ -308,11 +308,11 @@ def test_basic_discovery(self):
the results.
"""
with os_helper.temp_cwd():
- os.mkdir('foo')
- file1 = os.path.join('foo', 'file1.txt')
+ os.mkdir("foo")
+ file1 = os.path.join("foo", "file1.txt")
os_helper.create_empty_file(file1)
- os.mkdir('bar')
- file2 = os.path.join('bar', 'file2.txt')
+ os.mkdir("bar")
+ file2 = os.path.join("bar", "file2.txt")
os_helper.create_empty_file(file2)
expected = [file2, file1]
self.assertEqual(sorted(filelist.findall()), expected)
@@ -323,7 +323,7 @@ def test_non_local_discovery(self):
path name should be returned.
"""
with os_helper.temp_dir() as temp_dir:
- file1 = os.path.join(temp_dir, 'file1.txt')
+ file1 = os.path.join(temp_dir, "file1.txt")
os_helper.create_empty_file(file1)
expected = [file1]
self.assertEqual(filelist.findall(temp_dir), expected)
diff --git a/.venv3.10/Lib/distutils/tests/test_install.py b/.venv3.10/Lib/distutils/tests/test_install.py
index 0632024b..0a391407 100644
--- a/.venv3.10/Lib/distutils/tests/test_install.py
+++ b/.venv3.10/Lib/distutils/tests/test_install.py
@@ -21,7 +21,7 @@
def _make_ext_name(modname):
- return modname + sysconfig.get_config_var('EXT_SUFFIX')
+ return modname + sysconfig.get_config_var("EXT_SUFFIX")
class InstallTestCase(support.TempdirManager,
@@ -75,15 +75,15 @@ def check_path(got, expected):
check_path(cmd.install_scripts, os.path.join(destination, "bin"))
check_path(cmd.install_data, destination)
- @unittest.skipUnless(HAS_USER_SITE, 'need user site')
+ @unittest.skipUnless(HAS_USER_SITE, "need user site")
def test_user_site(self):
# test install with --user
# preparing the environment for the test
self.old_user_base = site.USER_BASE
self.old_user_site = site.USER_SITE
self.tmpdir = self.mkdtemp()
- self.user_base = os.path.join(self.tmpdir, 'B')
- self.user_site = os.path.join(self.tmpdir, 'S')
+ self.user_base = os.path.join(self.tmpdir, "B")
+ self.user_site = os.path.join(self.tmpdir, "S")
site.USER_BASE = self.user_base
site.USER_SITE = self.user_site
install_module.USER_BASE = self.user_base
@@ -104,16 +104,16 @@ def cleanup():
self.addCleanup(cleanup)
if HAS_USER_SITE:
- for key in ('nt_user', 'unix_user'):
+ for key in ("nt_user", "unix_user"):
self.assertIn(key, INSTALL_SCHEMES)
- dist = Distribution({'name': 'xx'})
+ dist = Distribution({"name": "xx"})
cmd = install(dist)
# making sure the user option is there
options = [name for name, short, lable in
cmd.user_options]
- self.assertIn('user', options)
+ self.assertIn("user", options)
# setting a value
cmd.user = 1
@@ -129,70 +129,70 @@ def cleanup():
self.assertTrue(os.path.exists(self.user_base))
self.assertTrue(os.path.exists(self.user_site))
- self.assertIn('userbase', cmd.config_vars)
- self.assertIn('usersite', cmd.config_vars)
+ self.assertIn("userbase", cmd.config_vars)
+ self.assertIn("usersite", cmd.config_vars)
def test_handle_extra_path(self):
- dist = Distribution({'name': 'xx', 'extra_path': 'path,dirs'})
+ dist = Distribution({"name": "xx", "extra_path": "path,dirs"})
cmd = install(dist)
# two elements
cmd.handle_extra_path()
- self.assertEqual(cmd.extra_path, ['path', 'dirs'])
- self.assertEqual(cmd.extra_dirs, 'dirs')
- self.assertEqual(cmd.path_file, 'path')
+ self.assertEqual(cmd.extra_path, ["path", "dirs"])
+ self.assertEqual(cmd.extra_dirs, "dirs")
+ self.assertEqual(cmd.path_file, "path")
# one element
- cmd.extra_path = ['path']
+ cmd.extra_path = ["path"]
cmd.handle_extra_path()
- self.assertEqual(cmd.extra_path, ['path'])
- self.assertEqual(cmd.extra_dirs, 'path')
- self.assertEqual(cmd.path_file, 'path')
+ self.assertEqual(cmd.extra_path, ["path"])
+ self.assertEqual(cmd.extra_dirs, "path")
+ self.assertEqual(cmd.path_file, "path")
# none
dist.extra_path = cmd.extra_path = None
cmd.handle_extra_path()
self.assertEqual(cmd.extra_path, None)
- self.assertEqual(cmd.extra_dirs, '')
+ self.assertEqual(cmd.extra_dirs, "")
self.assertEqual(cmd.path_file, None)
# three elements (no way !)
- cmd.extra_path = 'path,dirs,again'
+ cmd.extra_path = "path,dirs,again"
self.assertRaises(DistutilsOptionError, cmd.handle_extra_path)
def test_finalize_options(self):
- dist = Distribution({'name': 'xx'})
+ dist = Distribution({"name": "xx"})
cmd = install(dist)
# must supply either prefix/exec-prefix/home or
# install-base/install-platbase -- not both
- cmd.prefix = 'prefix'
- cmd.install_base = 'base'
+ cmd.prefix = "prefix"
+ cmd.install_base = "base"
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
# must supply either home or prefix/exec-prefix -- not both
cmd.install_base = None
- cmd.home = 'home'
+ cmd.home = "home"
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
# can't combine user with prefix/exec_prefix/home or
# install_(plat)base
cmd.prefix = None
- cmd.user = 'user'
+ cmd.user = "user"
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
def test_record(self):
install_dir = self.mkdtemp()
- project_dir, dist = self.create_dist(py_modules=['hello'],
- scripts=['sayhi'])
+ project_dir, dist = self.create_dist(py_modules=["hello"],
+ scripts=["sayhi"])
os.chdir(project_dir)
- self.write_file('hello.py', "def main(): print('o hai')")
- self.write_file('sayhi', 'from hello import main; main()')
+ self.write_file("hello.py", "def main(): print('o hai')")
+ self.write_file("sayhi", "from hello import main; main()")
cmd = install(dist)
- dist.command_obj['install'] = cmd
+ dist.command_obj["install"] = cmd
cmd.root = install_dir
- cmd.record = os.path.join(project_dir, 'filelist')
+ cmd.record = os.path.join(project_dir, "filelist")
cmd.ensure_finalized()
cmd.run()
@@ -203,18 +203,18 @@ def test_record(self):
f.close()
found = [os.path.basename(line) for line in content.splitlines()]
- expected = ['hello.py', 'hello.%s.pyc' % sys.implementation.cache_tag,
- 'sayhi',
- 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]]
+ expected = ["hello.py", "hello.%s.pyc" % sys.implementation.cache_tag,
+ "sayhi",
+ "UNKNOWN-0.0.0-py%s.%s.egg-info" % sys.version_info[:2]]
self.assertEqual(found, expected)
def test_record_extensions(self):
cmd = test_support.missing_compiler_executable()
if cmd is not None:
- self.skipTest('The %r command is not found' % cmd)
+ self.skipTest("The %r command is not found" % cmd)
install_dir = self.mkdtemp()
project_dir, dist = self.create_dist(ext_modules=[
- Extension('xx', ['xxmodule.c'])])
+ Extension("xx", ["xxmodule.c"])])
os.chdir(project_dir)
support.copy_xxmodule_c(project_dir)
@@ -223,10 +223,10 @@ def test_record_extensions(self):
buildextcmd.ensure_finalized()
cmd = install(dist)
- dist.command_obj['install'] = cmd
- dist.command_obj['build_ext'] = buildextcmd
+ dist.command_obj["install"] = cmd
+ dist.command_obj["build_ext"] = buildextcmd
cmd.root = install_dir
- cmd.record = os.path.join(project_dir, 'filelist')
+ cmd.record = os.path.join(project_dir, "filelist")
cmd.ensure_finalized()
cmd.run()
@@ -237,8 +237,8 @@ def test_record_extensions(self):
f.close()
found = [os.path.basename(line) for line in content.splitlines()]
- expected = [_make_ext_name('xx'),
- 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]]
+ expected = [_make_ext_name("xx"),
+ "UNKNOWN-0.0.0-py%s.%s.egg-info" % sys.version_info[:2]]
self.assertEqual(found, expected)
def test_debug_mode(self):
diff --git a/.venv3.10/Lib/distutils/tests/test_install_data.py b/.venv3.10/Lib/distutils/tests/test_install_data.py
index 32ab296a..cd6d36de 100644
--- a/.venv3.10/Lib/distutils/tests/test_install_data.py
+++ b/.venv3.10/Lib/distutils/tests/test_install_data.py
@@ -14,16 +14,16 @@ class InstallDataTestCase(support.TempdirManager,
def test_simple_run(self):
pkg_dir, dist = self.create_dist()
cmd = install_data(dist)
- cmd.install_dir = inst = os.path.join(pkg_dir, 'inst')
+ cmd.install_dir = inst = os.path.join(pkg_dir, "inst")
# data_files can contain
# - simple files
# - a tuple with a path, and a list of file
- one = os.path.join(pkg_dir, 'one')
- self.write_file(one, 'xxx')
- inst2 = os.path.join(pkg_dir, 'inst2')
- two = os.path.join(pkg_dir, 'two')
- self.write_file(two, 'xxx')
+ one = os.path.join(pkg_dir, "one")
+ self.write_file(one, "xxx")
+ inst2 = os.path.join(pkg_dir, "inst2")
+ two = os.path.join(pkg_dir, "two")
+ self.write_file(two, "xxx")
cmd.data_files = [one, (inst2, [two])]
self.assertEqual(cmd.get_inputs(), [one, (inst2, [two])])
@@ -52,13 +52,13 @@ def test_simple_run(self):
cmd.outfiles = []
# now using root and empty dir
- cmd.root = os.path.join(pkg_dir, 'root')
- inst3 = os.path.join(cmd.install_dir, 'inst3')
- inst4 = os.path.join(pkg_dir, 'inst4')
- three = os.path.join(cmd.install_dir, 'three')
- self.write_file(three, 'xx')
+ cmd.root = os.path.join(pkg_dir, "root")
+ inst3 = os.path.join(cmd.install_dir, "inst3")
+ inst4 = os.path.join(pkg_dir, "inst4")
+ three = os.path.join(cmd.install_dir, "three")
+ self.write_file(three, "xx")
cmd.data_files = [one, (inst2, [two]),
- ('inst3', [three]),
+ ("inst3", [three]),
(inst4, [])]
cmd.ensure_finalized()
cmd.run()
diff --git a/.venv3.10/Lib/distutils/tests/test_install_headers.py b/.venv3.10/Lib/distutils/tests/test_install_headers.py
index 2217b321..bca1d7c3 100644
--- a/.venv3.10/Lib/distutils/tests/test_install_headers.py
+++ b/.venv3.10/Lib/distutils/tests/test_install_headers.py
@@ -14,8 +14,8 @@ class InstallHeadersTestCase(support.TempdirManager,
def test_simple_run(self):
# we have two headers
header_list = self.mkdtemp()
- header1 = os.path.join(header_list, 'header1')
- header2 = os.path.join(header_list, 'header2')
+ header1 = os.path.join(header_list, "header1")
+ header2 = os.path.join(header_list, "header2")
self.write_file(header1)
self.write_file(header2)
headers = [header1, header2]
@@ -25,7 +25,7 @@ def test_simple_run(self):
self.assertEqual(cmd.get_inputs(), headers)
# let's run the command
- cmd.install_dir = os.path.join(pkg_dir, 'inst')
+ cmd.install_dir = os.path.join(pkg_dir, "inst")
cmd.ensure_finalized()
cmd.run()
diff --git a/.venv3.10/Lib/distutils/tests/test_install_lib.py b/.venv3.10/Lib/distutils/tests/test_install_lib.py
index fda6315b..77d6c318 100644
--- a/.venv3.10/Lib/distutils/tests/test_install_lib.py
+++ b/.venv3.10/Lib/distutils/tests/test_install_lib.py
@@ -25,27 +25,27 @@ def test_finalize_options(self):
self.assertEqual(cmd.optimize, 0)
# optimize must be 0, 1, or 2
- cmd.optimize = 'foo'
+ cmd.optimize = "foo"
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
- cmd.optimize = '4'
+ cmd.optimize = "4"
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
- cmd.optimize = '2'
+ cmd.optimize = "2"
cmd.finalize_options()
self.assertEqual(cmd.optimize, 2)
- @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
+ @unittest.skipIf(sys.dont_write_bytecode, "byte-compile disabled")
def test_byte_compile(self):
project_dir, dist = self.create_dist()
os.chdir(project_dir)
cmd = install_lib(dist)
cmd.compile = cmd.optimize = 1
- f = os.path.join(project_dir, 'foo.py')
- self.write_file(f, '# python file')
+ f = os.path.join(project_dir, "foo.py")
+ self.write_file(f, "# python file")
cmd.byte_compile([f])
- pyc_file = importlib.util.cache_from_source('foo.py', optimization='')
- pyc_opt_file = importlib.util.cache_from_source('foo.py',
+ pyc_file = importlib.util.cache_from_source("foo.py", optimization="")
+ pyc_opt_file = importlib.util.cache_from_source("foo.py",
optimization=cmd.optimize)
self.assertTrue(os.path.exists(pyc_file))
self.assertTrue(os.path.exists(pyc_opt_file))
@@ -53,17 +53,17 @@ def test_byte_compile(self):
def test_get_outputs(self):
project_dir, dist = self.create_dist()
os.chdir(project_dir)
- os.mkdir('spam')
+ os.mkdir("spam")
cmd = install_lib(dist)
# setting up a dist environment
cmd.compile = cmd.optimize = 1
cmd.install_dir = self.mkdtemp()
- f = os.path.join(project_dir, 'spam', '__init__.py')
- self.write_file(f, '# python package')
- cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
- cmd.distribution.packages = ['spam']
- cmd.distribution.script_name = 'setup.py'
+ f = os.path.join(project_dir, "spam", "__init__.py")
+ self.write_file(f, "# python package")
+ cmd.distribution.ext_modules = [Extension("foo", ["xxx"])]
+ cmd.distribution.packages = ["spam"]
+ cmd.distribution.script_name = "setup.py"
# get_outputs should return 4 elements: spam/__init__.py and .pyc,
# foo.import-tag-abiflags.so / foo.pyd
@@ -73,17 +73,17 @@ def test_get_outputs(self):
def test_get_inputs(self):
project_dir, dist = self.create_dist()
os.chdir(project_dir)
- os.mkdir('spam')
+ os.mkdir("spam")
cmd = install_lib(dist)
# setting up a dist environment
cmd.compile = cmd.optimize = 1
cmd.install_dir = self.mkdtemp()
- f = os.path.join(project_dir, 'spam', '__init__.py')
- self.write_file(f, '# python package')
- cmd.distribution.ext_modules = [Extension('foo', ['xxx'])]
- cmd.distribution.packages = ['spam']
- cmd.distribution.script_name = 'setup.py'
+ f = os.path.join(project_dir, "spam", "__init__.py")
+ self.write_file(f, "# python package")
+ cmd.distribution.ext_modules = [Extension("foo", ["xxx"])]
+ cmd.distribution.packages = ["spam"]
+ cmd.distribution.script_name = "setup.py"
# get_inputs should return 2 elements: spam/__init__.py and
# foo.import-tag-abiflags.so / foo.pyd
@@ -104,7 +104,7 @@ def test_dont_write_bytecode(self):
finally:
sys.dont_write_bytecode = old_dont_write_bytecode
- self.assertIn('byte-compiling is disabled',
+ self.assertIn("byte-compiling is disabled",
self.logs[0][1] % self.logs[0][2])
diff --git a/.venv3.10/Lib/distutils/tests/test_log.py b/.venv3.10/Lib/distutils/tests/test_log.py
index 75cf9006..02dbc09d 100644
--- a/.venv3.10/Lib/distutils/tests/test_log.py
+++ b/.venv3.10/Lib/distutils/tests/test_log.py
@@ -12,32 +12,32 @@ def test_non_ascii(self):
# Issues #8663, #34421: test that non-encodable text is escaped with
# backslashreplace error handler and encodable non-ASCII text is
# output as is.
- for errors in ('strict', 'backslashreplace', 'surrogateescape',
- 'replace', 'ignore'):
+ for errors in ("strict", "backslashreplace", "surrogateescape",
+ "replace", "ignore"):
with self.subTest(errors=errors):
stdout = io.TextIOWrapper(io.BytesIO(),
- encoding='cp437', errors=errors)
+ encoding="cp437", errors=errors)
stderr = io.TextIOWrapper(io.BytesIO(),
- encoding='cp437', errors=errors)
+ encoding="cp437", errors=errors)
old_threshold = log.set_threshold(log.DEBUG)
try:
- with swap_attr(sys, 'stdout', stdout), \
- swap_attr(sys, 'stderr', stderr):
- log.debug('Dεbug\tMėssãge')
- log.fatal('Fαtal\tÈrrōr')
+ with swap_attr(sys, "stdout", stdout), \
+ swap_attr(sys, "stderr", stderr):
+ log.debug("Dεbug\tMėssãge")
+ log.fatal("Fαtal\tÈrrōr")
finally:
log.set_threshold(old_threshold)
stdout.seek(0)
self.assertEqual(stdout.read().rstrip(),
- 'Dεbug\tM?ss?ge' if errors == 'replace' else
- 'Dεbug\tMssge' if errors == 'ignore' else
- 'Dεbug\tM\\u0117ss\\xe3ge')
+ "Dεbug\tM?ss?ge" if errors == "replace" else
+ "Dεbug\tMssge" if errors == "ignore" else
+ "Dεbug\tM\\u0117ss\\xe3ge")
stderr.seek(0)
self.assertEqual(stderr.read().rstrip(),
- 'Fαtal\t?rr?r' if errors == 'replace' else
- 'Fαtal\trrr' if errors == 'ignore' else
- 'Fαtal\t\\xc8rr\\u014dr')
+ "Fαtal\t?rr?r" if errors == "replace" else
+ "Fαtal\trrr" if errors == "ignore" else
+ "Fαtal\t\\xc8rr\\u014dr")
def test_suite():
return unittest.makeSuite(TestLog)
diff --git a/.venv3.10/Lib/distutils/tests/test_msvc9compiler.py b/.venv3.10/Lib/distutils/tests/test_msvc9compiler.py
index 77a07ef3..6a4bc9cd 100644
--- a/.venv3.10/Lib/distutils/tests/test_msvc9compiler.py
+++ b/.venv3.10/Lib/distutils/tests/test_msvc9compiler.py
@@ -116,33 +116,33 @@ def _find_vcvarsall(version):
msvc9compiler.find_vcvarsall = _find_vcvarsall
try:
self.assertRaises(DistutilsPlatformError, query_vcvarsall,
- 'wont find this version')
+ "wont find this version")
finally:
msvc9compiler.find_vcvarsall = old_find_vcvarsall
def test_reg_class(self):
from distutils.msvc9compiler import Reg
- self.assertRaises(KeyError, Reg.get_value, 'xxx', 'xxx')
+ self.assertRaises(KeyError, Reg.get_value, "xxx", "xxx")
# looking for values that should exist on all
# windows registry versions.
- path = r'Control Panel\Desktop'
- v = Reg.get_value(path, 'dragfullwindows')
- self.assertIn(v, ('0', '1', '2'))
+ path = r"Control Panel\Desktop"
+ v = Reg.get_value(path, "dragfullwindows")
+ self.assertIn(v, ("0", "1", "2"))
import winreg
HKCU = winreg.HKEY_CURRENT_USER
- keys = Reg.read_keys(HKCU, 'xxxx')
+ keys = Reg.read_keys(HKCU, "xxxx")
self.assertEqual(keys, None)
- keys = Reg.read_keys(HKCU, r'Control Panel')
- self.assertIn('Desktop', keys)
+ keys = Reg.read_keys(HKCU, r"Control Panel")
+ self.assertIn("Desktop", keys)
def test_remove_visual_c_ref(self):
from distutils.msvc9compiler import MSVCCompiler
tempdir = self.mkdtemp()
- manifest = os.path.join(tempdir, 'manifest')
- f = open(manifest, 'w')
+ manifest = os.path.join(tempdir, "manifest")
+ f = open(manifest, "w")
try:
f.write(_MANIFEST_WITH_MULTIPLE_REFERENCES)
finally:
@@ -155,7 +155,7 @@ def test_remove_visual_c_ref(self):
f = open(manifest)
try:
# removing trailing spaces
- content = '\n'.join([line.rstrip() for line in f.readlines()])
+ content = "\n".join([line.rstrip() for line in f.readlines()])
finally:
f.close()
@@ -165,8 +165,8 @@ def test_remove_visual_c_ref(self):
def test_remove_entire_manifest(self):
from distutils.msvc9compiler import MSVCCompiler
tempdir = self.mkdtemp()
- manifest = os.path.join(tempdir, 'manifest')
- f = open(manifest, 'w')
+ manifest = os.path.join(tempdir, "manifest")
+ f = open(manifest, "w")
try:
f.write(_MANIFEST_WITH_ONLY_MSVC_REFERENCE)
finally:
diff --git a/.venv3.10/Lib/distutils/tests/test_msvccompiler.py b/.venv3.10/Lib/distutils/tests/test_msvccompiler.py
index b518d6a7..7d28c386 100644
--- a/.venv3.10/Lib/distutils/tests/test_msvccompiler.py
+++ b/.venv3.10/Lib/distutils/tests/test_msvccompiler.py
@@ -28,27 +28,27 @@ def _find_vcvarsall(plat_spec):
try:
self.assertRaises(DistutilsPlatformError,
_msvccompiler._get_vc_env,
- 'wont find this version')
+ "wont find this version")
finally:
_msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_get_vc_env_unicode(self):
import distutils._msvccompiler as _msvccompiler
- test_var = 'ṰḖṤṪ┅ṼẨṜ'
- test_value = '₃⁴₅'
+ test_var = "ṰḖṤṪ┅ṼẨṜ"
+ test_value = "₃⁴₅"
# Ensure we don't early exit from _get_vc_env
- old_distutils_use_sdk = os.environ.pop('DISTUTILS_USE_SDK', None)
+ old_distutils_use_sdk = os.environ.pop("DISTUTILS_USE_SDK", None)
os.environ[test_var] = test_value
try:
- env = _msvccompiler._get_vc_env('x86')
+ env = _msvccompiler._get_vc_env("x86")
self.assertIn(test_var.lower(), env)
self.assertEqual(test_value, env[test_var.lower()])
finally:
os.environ.pop(test_var)
if old_distutils_use_sdk:
- os.environ['DISTUTILS_USE_SDK'] = old_distutils_use_sdk
+ os.environ["DISTUTILS_USE_SDK"] = old_distutils_use_sdk
def test_get_vc2017(self):
import distutils._msvccompiler as _msvccompiler
diff --git a/.venv3.10/Lib/distutils/tests/test_register.py b/.venv3.10/Lib/distutils/tests/test_register.py
index bba48633..2aa4becd 100644
--- a/.venv3.10/Lib/distutils/tests/test_register.py
+++ b/.venv3.10/Lib/distutils/tests/test_register.py
@@ -46,7 +46,7 @@ def __init__(self, *answers):
self.answers = answers
self.index = 0
- def __call__(self, prompt=''):
+ def __call__(self, prompt=""):
try:
return self.answers[self.index]
finally:
@@ -65,11 +65,11 @@ def open(self, req, data=None, timeout=None):
return self
def read(self):
- return b'xxx'
+ return b"xxx"
def getheader(self, name, default=None):
return {
- 'content-type': 'text/plain; charset=utf-8',
+ "content-type": "text/plain; charset=utf-8",
}.get(name.lower(), default)
@@ -80,7 +80,7 @@ def setUp(self):
# patching the password prompt
self._old_getpass = getpass.getpass
def _getpass(prompt):
- return 'password'
+ return "password"
getpass.getpass = _getpass
urllib.request._opener = None
self.old_opener = urllib.request.build_opener
@@ -94,9 +94,9 @@ def tearDown(self):
def _get_cmd(self, metadata=None):
if metadata is None:
- metadata = {'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx',
- 'name': 'xxx', 'version': 'xxx'}
+ metadata = {"url": "xxx", "author": "xxx",
+ "author_email": "xxx",
+ "name": "xxx", "version": "xxx"}
pkg_info, dist = self.create_dist(**metadata)
return register(dist)
@@ -118,7 +118,7 @@ def test_create_pypirc(self):
# Username : 'tarek'
# Password : 'password'
# Save your login (y/N)? : 'y'
- inputs = Inputs('1', 'tarek', 'y')
+ inputs = Inputs("1", "tarek", "y")
register_module.input = inputs.__call__
# let's run the command
try:
@@ -140,7 +140,7 @@ def test_create_pypirc(self):
# now let's make sure the .pypirc file generated
# really works : we shouldn't be asked anything
# if we run the command again
- def _no_way(prompt=''):
+ def _no_way(prompt=""):
raise AssertionError(prompt)
register_module.input = _no_way
@@ -153,9 +153,9 @@ def _no_way(prompt=''):
req1 = dict(self.conn.reqs[0].headers)
req2 = dict(self.conn.reqs[1].headers)
- self.assertEqual(req1['Content-length'], '1374')
- self.assertEqual(req2['Content-length'], '1374')
- self.assertIn(b'xxx', self.conn.reqs[1].data)
+ self.assertEqual(req1["Content-length"], "1374")
+ self.assertEqual(req2["Content-length"], "1374")
+ self.assertIn(b"xxx", self.conn.reqs[1].data)
def test_password_not_in_file(self):
@@ -167,12 +167,12 @@ def test_password_not_in_file(self):
# dist.password should be set
# therefore used afterwards by other commands
- self.assertEqual(cmd.distribution.password, 'password')
+ self.assertEqual(cmd.distribution.password, "password")
def test_registering(self):
# this test runs choice 2
cmd = self._get_cmd()
- inputs = Inputs('2', 'tarek', 'tarek@ziade.org')
+ inputs = Inputs("2", "tarek", "tarek@ziade.org")
register_module.input = inputs.__call__
try:
# let's run the command
@@ -184,13 +184,13 @@ def test_registering(self):
self.assertEqual(len(self.conn.reqs), 1)
req = self.conn.reqs[0]
headers = dict(req.headers)
- self.assertEqual(headers['Content-length'], '608')
- self.assertIn(b'tarek', req.data)
+ self.assertEqual(headers["Content-length"], "608")
+ self.assertIn(b"tarek", req.data)
def test_password_reset(self):
# this test runs choice 3
cmd = self._get_cmd()
- inputs = Inputs('3', 'tarek@ziade.org')
+ inputs = Inputs("3", "tarek@ziade.org")
register_module.input = inputs.__call__
try:
# let's run the command
@@ -202,10 +202,10 @@ def test_password_reset(self):
self.assertEqual(len(self.conn.reqs), 1)
req = self.conn.reqs[0]
headers = dict(req.headers)
- self.assertEqual(headers['Content-length'], '290')
- self.assertIn(b'tarek', req.data)
+ self.assertEqual(headers["Content-length"], "290")
+ self.assertIn(b"tarek", req.data)
- @unittest.skipUnless(docutils is not None, 'needs docutils')
+ @unittest.skipUnless(docutils is not None, "needs docutils")
def test_strict(self):
# testing the script option
# when on, the register command stops if
@@ -219,10 +219,10 @@ def test_strict(self):
self.assertRaises(DistutilsSetupError, cmd.run)
# metadata are OK but long_description is broken
- metadata = {'url': 'xxx', 'author': 'xxx',
- 'author_email': 'éxéxé',
- 'name': 'xxx', 'version': 'xxx',
- 'long_description': 'title\n==\n\ntext'}
+ metadata = {"url": "xxx", "author": "xxx",
+ "author_email": "éxéxé",
+ "name": "xxx", "version": "xxx",
+ "long_description": "title\n==\n\ntext"}
cmd = self._get_cmd(metadata)
cmd.ensure_finalized()
@@ -230,11 +230,11 @@ def test_strict(self):
self.assertRaises(DistutilsSetupError, cmd.run)
# now something that works
- metadata['long_description'] = 'title\n=====\n\ntext'
+ metadata["long_description"] = "title\n=====\n\ntext"
cmd = self._get_cmd(metadata)
cmd.ensure_finalized()
cmd.strict = 1
- inputs = Inputs('1', 'tarek', 'y')
+ inputs = Inputs("1", "tarek", "y")
register_module.input = inputs.__call__
# let's run the command
try:
@@ -245,7 +245,7 @@ def test_strict(self):
# strict is not by default
cmd = self._get_cmd()
cmd.ensure_finalized()
- inputs = Inputs('1', 'tarek', 'y')
+ inputs = Inputs("1", "tarek", "y")
register_module.input = inputs.__call__
# let's run the command
try:
@@ -254,16 +254,16 @@ def test_strict(self):
del register_module.input
# and finally a Unicode test (bug #12114)
- metadata = {'url': 'xxx', 'author': '\u00c9ric',
- 'author_email': 'xxx', 'name': 'xxx',
- 'version': 'xxx',
- 'description': 'Something about esszet \u00df',
- 'long_description': 'More things about esszet \u00df'}
+ metadata = {"url": "xxx", "author": "\u00c9ric",
+ "author_email": "xxx", "name": "xxx",
+ "version": "xxx",
+ "description": "Something about esszet \u00df",
+ "long_description": "More things about esszet \u00df"}
cmd = self._get_cmd(metadata)
cmd.ensure_finalized()
cmd.strict = 1
- inputs = Inputs('1', 'tarek', 'y')
+ inputs = Inputs("1", "tarek", "y")
register_module.input = inputs.__call__
# let's run the command
try:
@@ -271,19 +271,19 @@ def test_strict(self):
finally:
del register_module.input
- @unittest.skipUnless(docutils is not None, 'needs docutils')
+ @unittest.skipUnless(docutils is not None, "needs docutils")
def test_register_invalid_long_description(self):
- description = ':funkie:`str`' # mimic Sphinx-specific markup
- metadata = {'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx',
- 'name': 'xxx', 'version': 'xxx',
- 'long_description': description}
+ description = ":funkie:`str`" # mimic Sphinx-specific markup
+ metadata = {"url": "xxx", "author": "xxx",
+ "author_email": "xxx",
+ "name": "xxx", "version": "xxx",
+ "long_description": description}
cmd = self._get_cmd(metadata)
cmd.ensure_finalized()
cmd.strict = True
- inputs = Inputs('2', 'tarek', 'tarek@ziade.org')
+ inputs = Inputs("2", "tarek", "tarek@ziade.org")
register_module.input = inputs
- self.addCleanup(delattr, register_module, 'input')
+ self.addCleanup(delattr, register_module, "input")
self.assertRaises(DistutilsSetupError, cmd.run)
@@ -300,12 +300,12 @@ def test_list_classifiers(self):
cmd.list_classifiers = 1
cmd.run()
results = self.get_logs(INFO)
- self.assertEqual(results, ['running check', 'xxx'])
+ self.assertEqual(results, ["running check", "xxx"])
def test_show_response(self):
# test that the --show-response option return a well formatted response
cmd = self._get_cmd()
- inputs = Inputs('1', 'tarek', 'y')
+ inputs = Inputs("1", "tarek", "y")
register_module.input = inputs.__call__
cmd.show_response = 1
try:
@@ -314,7 +314,7 @@ def test_show_response(self):
del register_module.input
results = self.get_logs(INFO)
- self.assertEqual(results[3], 75 * '-' + '\nxxx\n' + 75 * '-')
+ self.assertEqual(results[3], 75 * "-" + "\nxxx\n" + 75 * "-")
def test_suite():
diff --git a/.venv3.10/Lib/distutils/tests/test_sdist.py b/.venv3.10/Lib/distutils/tests/test_sdist.py
index 752e9db5..ad7a0749 100644
--- a/.venv3.10/Lib/distutils/tests/test_sdist.py
+++ b/.venv3.10/Lib/distutils/tests/test_sdist.py
@@ -61,12 +61,12 @@ def setUp(self):
super(SDistTestCase, self).setUp()
# setting up an environment
self.old_path = os.getcwd()
- os.mkdir(join(self.tmp_dir, 'somecode'))
- os.mkdir(join(self.tmp_dir, 'dist'))
+ os.mkdir(join(self.tmp_dir, "somecode"))
+ os.mkdir(join(self.tmp_dir, "dist"))
# a package, and a README
- self.write_file((self.tmp_dir, 'README'), 'xxx')
- self.write_file((self.tmp_dir, 'somecode', '__init__.py'), '#')
- self.write_file((self.tmp_dir, 'setup.py'), SETUP_PY)
+ self.write_file((self.tmp_dir, "README"), "xxx")
+ self.write_file((self.tmp_dir, "somecode", "__init__.py"), "#")
+ self.write_file((self.tmp_dir, "setup.py"), SETUP_PY)
os.chdir(self.tmp_dir)
def tearDown(self):
@@ -77,96 +77,96 @@ def tearDown(self):
def get_cmd(self, metadata=None):
"""Returns a cmd"""
if metadata is None:
- metadata = {'name': 'fake', 'version': '1.0',
- 'url': 'xxx', 'author': 'xxx',
- 'author_email': 'xxx'}
+ metadata = {"name": "fake", "version": "1.0",
+ "url": "xxx", "author": "xxx",
+ "author_email": "xxx"}
dist = Distribution(metadata)
- dist.script_name = 'setup.py'
- dist.packages = ['somecode']
+ dist.script_name = "setup.py"
+ dist.packages = ["somecode"]
dist.include_package_data = True
cmd = sdist(dist)
- cmd.dist_dir = 'dist'
+ cmd.dist_dir = "dist"
return dist, cmd
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_prune_file_list(self):
# this test creates a project with some VCS dirs and an NFS rename
# file, then launches sdist to check they get pruned on all systems
# creating VCS directories with some files in them
- os.mkdir(join(self.tmp_dir, 'somecode', '.svn'))
- self.write_file((self.tmp_dir, 'somecode', '.svn', 'ok.py'), 'xxx')
+ os.mkdir(join(self.tmp_dir, "somecode", ".svn"))
+ self.write_file((self.tmp_dir, "somecode", ".svn", "ok.py"), "xxx")
- os.mkdir(join(self.tmp_dir, 'somecode', '.hg'))
- self.write_file((self.tmp_dir, 'somecode', '.hg',
- 'ok'), 'xxx')
+ os.mkdir(join(self.tmp_dir, "somecode", ".hg"))
+ self.write_file((self.tmp_dir, "somecode", ".hg",
+ "ok"), "xxx")
- os.mkdir(join(self.tmp_dir, 'somecode', '.git'))
- self.write_file((self.tmp_dir, 'somecode', '.git',
- 'ok'), 'xxx')
+ os.mkdir(join(self.tmp_dir, "somecode", ".git"))
+ self.write_file((self.tmp_dir, "somecode", ".git",
+ "ok"), "xxx")
- self.write_file((self.tmp_dir, 'somecode', '.nfs0001'), 'xxx')
+ self.write_file((self.tmp_dir, "somecode", ".nfs0001"), "xxx")
# now building a sdist
dist, cmd = self.get_cmd()
# zip is available universally
# (tar might not be installed under win32)
- cmd.formats = ['zip']
+ cmd.formats = ["zip"]
cmd.ensure_finalized()
cmd.run()
# now let's check what we have
- dist_folder = join(self.tmp_dir, 'dist')
+ dist_folder = join(self.tmp_dir, "dist")
files = os.listdir(dist_folder)
- self.assertEqual(files, ['fake-1.0.zip'])
+ self.assertEqual(files, ["fake-1.0.zip"])
- zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip'))
+ zip_file = zipfile.ZipFile(join(dist_folder, "fake-1.0.zip"))
try:
content = zip_file.namelist()
finally:
zip_file.close()
# making sure everything has been pruned correctly
- expected = ['', 'PKG-INFO', 'README', 'setup.py',
- 'somecode/', 'somecode/__init__.py']
- self.assertEqual(sorted(content), ['fake-1.0/' + x for x in expected])
+ expected = ["", "PKG-INFO", "README", "setup.py",
+ "somecode/", "somecode/__init__.py"]
+ self.assertEqual(sorted(content), ["fake-1.0/" + x for x in expected])
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
- @unittest.skipIf(find_executable('tar') is None,
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
+ @unittest.skipIf(find_executable("tar") is None,
"The tar command is not found")
- @unittest.skipIf(find_executable('gzip') is None,
+ @unittest.skipIf(find_executable("gzip") is None,
"The gzip command is not found")
def test_make_distribution(self):
# now building a sdist
dist, cmd = self.get_cmd()
# creating a gztar then a tar
- cmd.formats = ['gztar', 'tar']
+ cmd.formats = ["gztar", "tar"]
cmd.ensure_finalized()
cmd.run()
# making sure we have two files
- dist_folder = join(self.tmp_dir, 'dist')
+ dist_folder = join(self.tmp_dir, "dist")
result = os.listdir(dist_folder)
result.sort()
- self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'])
+ self.assertEqual(result, ["fake-1.0.tar", "fake-1.0.tar.gz"])
- os.remove(join(dist_folder, 'fake-1.0.tar'))
- os.remove(join(dist_folder, 'fake-1.0.tar.gz'))
+ os.remove(join(dist_folder, "fake-1.0.tar"))
+ os.remove(join(dist_folder, "fake-1.0.tar.gz"))
# now trying a tar then a gztar
- cmd.formats = ['tar', 'gztar']
+ cmd.formats = ["tar", "gztar"]
cmd.ensure_finalized()
cmd.run()
result = os.listdir(dist_folder)
result.sort()
- self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'])
+ self.assertEqual(result, ["fake-1.0.tar", "fake-1.0.tar.gz"])
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_add_defaults(self):
# http://bugs.python.org/issue2279
@@ -177,75 +177,75 @@ def test_add_defaults(self):
# filling data_files by pointing files
# in package_data
- dist.package_data = {'': ['*.cfg', '*.dat'],
- 'somecode': ['*.txt']}
- self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#')
- self.write_file((self.tmp_dir, 'somecode', 'doc.dat'), '#')
+ dist.package_data = {"": ["*.cfg", "*.dat"],
+ "somecode": ["*.txt"]}
+ self.write_file((self.tmp_dir, "somecode", "doc.txt"), "#")
+ self.write_file((self.tmp_dir, "somecode", "doc.dat"), "#")
# adding some data in data_files
- data_dir = join(self.tmp_dir, 'data')
+ data_dir = join(self.tmp_dir, "data")
os.mkdir(data_dir)
- self.write_file((data_dir, 'data.dt'), '#')
- some_dir = join(self.tmp_dir, 'some')
+ self.write_file((data_dir, "data.dt"), "#")
+ some_dir = join(self.tmp_dir, "some")
os.mkdir(some_dir)
# make sure VCS directories are pruned (#14004)
- hg_dir = join(self.tmp_dir, '.hg')
+ hg_dir = join(self.tmp_dir, ".hg")
os.mkdir(hg_dir)
- self.write_file((hg_dir, 'last-message.txt'), '#')
+ self.write_file((hg_dir, "last-message.txt"), "#")
# a buggy regex used to prevent this from working on windows (#6884)
- self.write_file((self.tmp_dir, 'buildout.cfg'), '#')
- self.write_file((self.tmp_dir, 'inroot.txt'), '#')
- self.write_file((some_dir, 'file.txt'), '#')
- self.write_file((some_dir, 'other_file.txt'), '#')
-
- dist.data_files = [('data', ['data/data.dt',
- 'buildout.cfg',
- 'inroot.txt',
- 'notexisting']),
- 'some/file.txt',
- 'some/other_file.txt']
+ self.write_file((self.tmp_dir, "buildout.cfg"), "#")
+ self.write_file((self.tmp_dir, "inroot.txt"), "#")
+ self.write_file((some_dir, "file.txt"), "#")
+ self.write_file((some_dir, "other_file.txt"), "#")
+
+ dist.data_files = [("data", ["data/data.dt",
+ "buildout.cfg",
+ "inroot.txt",
+ "notexisting"]),
+ "some/file.txt",
+ "some/other_file.txt"]
# adding a script
- script_dir = join(self.tmp_dir, 'scripts')
+ script_dir = join(self.tmp_dir, "scripts")
os.mkdir(script_dir)
- self.write_file((script_dir, 'script.py'), '#')
- dist.scripts = [join('scripts', 'script.py')]
+ self.write_file((script_dir, "script.py"), "#")
+ dist.scripts = [join("scripts", "script.py")]
- cmd.formats = ['zip']
+ cmd.formats = ["zip"]
cmd.use_defaults = True
cmd.ensure_finalized()
cmd.run()
# now let's check what we have
- dist_folder = join(self.tmp_dir, 'dist')
+ dist_folder = join(self.tmp_dir, "dist")
files = os.listdir(dist_folder)
- self.assertEqual(files, ['fake-1.0.zip'])
+ self.assertEqual(files, ["fake-1.0.zip"])
- zip_file = zipfile.ZipFile(join(dist_folder, 'fake-1.0.zip'))
+ zip_file = zipfile.ZipFile(join(dist_folder, "fake-1.0.zip"))
try:
content = zip_file.namelist()
finally:
zip_file.close()
# making sure everything was added
- expected = ['', 'PKG-INFO', 'README', 'buildout.cfg',
- 'data/', 'data/data.dt', 'inroot.txt',
- 'scripts/', 'scripts/script.py', 'setup.py',
- 'some/', 'some/file.txt', 'some/other_file.txt',
- 'somecode/', 'somecode/__init__.py', 'somecode/doc.dat',
- 'somecode/doc.txt']
- self.assertEqual(sorted(content), ['fake-1.0/' + x for x in expected])
+ expected = ["", "PKG-INFO", "README", "buildout.cfg",
+ "data/", "data/data.dt", "inroot.txt",
+ "scripts/", "scripts/script.py", "setup.py",
+ "some/", "some/file.txt", "some/other_file.txt",
+ "somecode/", "somecode/__init__.py", "somecode/doc.dat",
+ "somecode/doc.txt"]
+ self.assertEqual(sorted(content), ["fake-1.0/" + x for x in expected])
# checking the MANIFEST
- f = open(join(self.tmp_dir, 'MANIFEST'))
+ f = open(join(self.tmp_dir, "MANIFEST"))
try:
manifest = f.read()
finally:
f.close()
- self.assertEqual(manifest, MANIFEST % {'sep': os.sep})
+ self.assertEqual(manifest, MANIFEST % {"sep": os.sep})
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_metadata_check_option(self):
# testing the `medata-check` option
dist, cmd = self.get_cmd(metadata={})
@@ -255,7 +255,7 @@ def test_metadata_check_option(self):
cmd.ensure_finalized()
cmd.run()
warnings = [msg for msg in self.get_logs(WARN) if
- msg.startswith('warning: check:')]
+ msg.startswith("warning: check:")]
self.assertEqual(len(warnings), 2)
# trying with a complete set of metadata
@@ -265,7 +265,7 @@ def test_metadata_check_option(self):
cmd.metadata_check = 0
cmd.run()
warnings = [msg for msg in self.get_logs(WARN) if
- msg.startswith('warning: check:')]
+ msg.startswith("warning: check:")]
self.assertEqual(len(warnings), 0)
def test_check_metadata_deprecated(self):
@@ -282,8 +282,8 @@ def test_show_formats(self):
# the output should be a header line + one line per format
num_formats = len(ARCHIVE_FORMATS.keys())
- output = [line for line in stdout.getvalue().split('\n')
- if line.strip().startswith('--formats=')]
+ output = [line for line in stdout.getvalue().split("\n")
+ if line.strip().startswith("--formats=")]
self.assertEqual(len(output), num_formats)
def test_finalize_options(self):
@@ -291,19 +291,19 @@ def test_finalize_options(self):
cmd.finalize_options()
# default options set by finalize
- self.assertEqual(cmd.manifest, 'MANIFEST')
- self.assertEqual(cmd.template, 'MANIFEST.in')
- self.assertEqual(cmd.dist_dir, 'dist')
+ self.assertEqual(cmd.manifest, "MANIFEST")
+ self.assertEqual(cmd.template, "MANIFEST.in")
+ self.assertEqual(cmd.dist_dir, "dist")
# formats has to be a string splitable on (' ', ',') or
# a stringlist
cmd.formats = 1
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
- cmd.formats = ['zip']
+ cmd.formats = ["zip"]
cmd.finalize_options()
# formats has to be known
- cmd.formats = 'supazipa'
+ cmd.formats = "supazipa"
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
# the following tests make sure there is a nice error message instead
@@ -312,7 +312,7 @@ def test_finalize_options(self):
def _check_template(self, content):
dist, cmd = self.get_cmd()
os.chdir(self.tmp_dir)
- self.write_file('MANIFEST.in', content)
+ self.write_file("MANIFEST.in", content)
cmd.ensure_finalized()
cmd.filelist = FileList()
cmd.read_template()
@@ -320,44 +320,44 @@ def _check_template(self, content):
self.assertEqual(len(warnings), 1)
def test_invalid_template_unknown_command(self):
- self._check_template('taunt knights *')
+ self._check_template("taunt knights *")
def test_invalid_template_wrong_arguments(self):
# this manifest command takes one argument
- self._check_template('prune')
+ self._check_template("prune")
- @unittest.skipIf(os.name != 'nt', 'test relevant for Windows only')
+ @unittest.skipIf(os.name != "nt", "test relevant for Windows only")
def test_invalid_template_wrong_path(self):
# on Windows, trailing slashes are not allowed
# this used to crash instead of raising a warning: #8286
- self._check_template('include examples/')
+ self._check_template("include examples/")
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_get_file_list(self):
# make sure MANIFEST is recalculated
dist, cmd = self.get_cmd()
# filling data_files by pointing files in package_data
- dist.package_data = {'somecode': ['*.txt']}
- self.write_file((self.tmp_dir, 'somecode', 'doc.txt'), '#')
- cmd.formats = ['gztar']
+ dist.package_data = {"somecode": ["*.txt"]}
+ self.write_file((self.tmp_dir, "somecode", "doc.txt"), "#")
+ cmd.formats = ["gztar"]
cmd.ensure_finalized()
cmd.run()
f = open(cmd.manifest)
try:
- manifest = [line.strip() for line in f.read().split('\n')
- if line.strip() != '']
+ manifest = [line.strip() for line in f.read().split("\n")
+ if line.strip() != ""]
finally:
f.close()
self.assertEqual(len(manifest), 5)
# adding a file
- self.write_file((self.tmp_dir, 'somecode', 'doc2.txt'), '#')
+ self.write_file((self.tmp_dir, "somecode", "doc2.txt"), "#")
# make sure build_py is reinitialized, like a fresh run
- build_py = dist.get_command_obj('build_py')
+ build_py = dist.get_command_obj("build_py")
build_py.finalized = False
build_py.ensure_finalized()
@@ -365,16 +365,16 @@ def test_get_file_list(self):
f = open(cmd.manifest)
try:
- manifest2 = [line.strip() for line in f.read().split('\n')
- if line.strip() != '']
+ manifest2 = [line.strip() for line in f.read().split("\n")
+ if line.strip() != ""]
finally:
f.close()
# do we have the new file in MANIFEST ?
self.assertEqual(len(manifest2), 6)
- self.assertIn('doc2.txt', manifest2[-1])
+ self.assertIn("doc2.txt", manifest2[-1])
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_manifest_marker(self):
# check that autogenerated MANIFESTs have a marker
dist, cmd = self.get_cmd()
@@ -383,13 +383,13 @@ def test_manifest_marker(self):
f = open(cmd.manifest)
try:
- manifest = [line.strip() for line in f.read().split('\n')
- if line.strip() != '']
+ manifest = [line.strip() for line in f.read().split("\n")
+ if line.strip() != ""]
finally:
f.close()
self.assertEqual(manifest[0],
- '# file GENERATED by distutils, do NOT edit')
+ "# file GENERATED by distutils, do NOT edit")
@unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_manifest_comments(self):
@@ -402,61 +402,61 @@ def test_manifest_comments(self):
dist, cmd = self.get_cmd()
cmd.ensure_finalized()
self.write_file((self.tmp_dir, cmd.manifest), contents)
- self.write_file((self.tmp_dir, 'good.py'), '# pick me!')
- self.write_file((self.tmp_dir, 'bad.py'), "# don't pick me!")
- self.write_file((self.tmp_dir, '#bad.py'), "# don't pick me!")
+ self.write_file((self.tmp_dir, "good.py"), "# pick me!")
+ self.write_file((self.tmp_dir, "bad.py"), "# don't pick me!")
+ self.write_file((self.tmp_dir, "#bad.py"), "# don't pick me!")
cmd.run()
- self.assertEqual(cmd.filelist.files, ['good.py'])
+ self.assertEqual(cmd.filelist.files, ["good.py"])
- @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
+ @unittest.skipUnless(ZLIB_SUPPORT, "Need zlib support to run")
def test_manual_manifest(self):
# check that a MANIFEST without a marker is left alone
dist, cmd = self.get_cmd()
- cmd.formats = ['gztar']
+ cmd.formats = ["gztar"]
cmd.ensure_finalized()
- self.write_file((self.tmp_dir, cmd.manifest), 'README.manual')
- self.write_file((self.tmp_dir, 'README.manual'),
- 'This project maintains its MANIFEST file itself.')
+ self.write_file((self.tmp_dir, cmd.manifest), "README.manual")
+ self.write_file((self.tmp_dir, "README.manual"),
+ "This project maintains its MANIFEST file itself.")
cmd.run()
- self.assertEqual(cmd.filelist.files, ['README.manual'])
+ self.assertEqual(cmd.filelist.files, ["README.manual"])
f = open(cmd.manifest)
try:
- manifest = [line.strip() for line in f.read().split('\n')
- if line.strip() != '']
+ manifest = [line.strip() for line in f.read().split("\n")
+ if line.strip() != ""]
finally:
f.close()
- self.assertEqual(manifest, ['README.manual'])
+ self.assertEqual(manifest, ["README.manual"])
- archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz')
+ archive_name = join(self.tmp_dir, "dist", "fake-1.0.tar.gz")
archive = tarfile.open(archive_name)
try:
filenames = [tarinfo.name for tarinfo in archive]
finally:
archive.close()
- self.assertEqual(sorted(filenames), ['fake-1.0', 'fake-1.0/PKG-INFO',
- 'fake-1.0/README.manual'])
+ self.assertEqual(sorted(filenames), ["fake-1.0", "fake-1.0/PKG-INFO",
+ "fake-1.0/README.manual"])
@unittest.skipUnless(ZLIB_SUPPORT, "requires zlib")
@unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
- @unittest.skipIf(find_executable('tar') is None,
+ @unittest.skipIf(find_executable("tar") is None,
"The tar command is not found")
- @unittest.skipIf(find_executable('gzip') is None,
+ @unittest.skipIf(find_executable("gzip") is None,
"The gzip command is not found")
def test_make_distribution_owner_group(self):
# now building a sdist
dist, cmd = self.get_cmd()
# creating a gztar and specifying the owner+group
- cmd.formats = ['gztar']
+ cmd.formats = ["gztar"]
cmd.owner = pwd.getpwuid(0)[0]
cmd.group = grp.getgrgid(0)[0]
cmd.ensure_finalized()
cmd.run()
# making sure we have the good rights
- archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz')
+ archive_name = join(self.tmp_dir, "dist", "fake-1.0.tar.gz")
archive = tarfile.open(archive_name)
try:
for member in archive.getmembers():
@@ -469,12 +469,12 @@ def test_make_distribution_owner_group(self):
dist, cmd = self.get_cmd()
# creating a gztar
- cmd.formats = ['gztar']
+ cmd.formats = ["gztar"]
cmd.ensure_finalized()
cmd.run()
# making sure we have the good rights
- archive_name = join(self.tmp_dir, 'dist', 'fake-1.0.tar.gz')
+ archive_name = join(self.tmp_dir, "dist", "fake-1.0.tar.gz")
archive = tarfile.open(archive_name)
# note that we are not testing the group ownership here
diff --git a/.venv3.10/Lib/distutils/tests/test_spawn.py b/.venv3.10/Lib/distutils/tests/test_spawn.py
index 4ec767b1..18ccd457 100644
--- a/.venv3.10/Lib/distutils/tests/test_spawn.py
+++ b/.venv3.10/Lib/distutils/tests/test_spawn.py
@@ -15,30 +15,30 @@ class SpawnTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
- @unittest.skipUnless(os.name in ('nt', 'posix'),
- 'Runs only under posix or nt')
+ @unittest.skipUnless(os.name in ("nt", "posix"),
+ "Runs only under posix or nt")
def test_spawn(self):
tmpdir = self.mkdtemp()
# creating something executable
# through the shell that returns 1
- if sys.platform != 'win32':
- exe = os.path.join(tmpdir, 'foo.sh')
- self.write_file(exe, '#!%s\nexit 1' % unix_shell)
+ if sys.platform != "win32":
+ exe = os.path.join(tmpdir, "foo.sh")
+ self.write_file(exe, "#!%s\nexit 1" % unix_shell)
else:
- exe = os.path.join(tmpdir, 'foo.bat')
- self.write_file(exe, 'exit 1')
+ exe = os.path.join(tmpdir, "foo.bat")
+ self.write_file(exe, "exit 1")
os.chmod(exe, 0o777)
self.assertRaises(DistutilsExecError, spawn, [exe])
# now something that works
- if sys.platform != 'win32':
- exe = os.path.join(tmpdir, 'foo.sh')
- self.write_file(exe, '#!%s\nexit 0' % unix_shell)
+ if sys.platform != "win32":
+ exe = os.path.join(tmpdir, "foo.sh")
+ self.write_file(exe, "#!%s\nexit 0" % unix_shell)
else:
- exe = os.path.join(tmpdir, 'foo.bat')
- self.write_file(exe, 'exit 0')
+ exe = os.path.join(tmpdir, "foo.bat")
+ self.write_file(exe, "exit 0")
os.chmod(exe, 0o777)
spawn([exe]) # should work without any error
@@ -60,7 +60,7 @@ def test_find_executable(self):
rv = find_executable(program, path=tmp_dir)
self.assertEqual(rv, filename)
- if sys.platform == 'win32':
+ if sys.platform == "win32":
# test without ".exe" extension
rv = find_executable(program_noeext, path=tmp_dir)
self.assertEqual(rv, filename)
@@ -77,10 +77,10 @@ def test_find_executable(self):
# PATH='': no match, except in the current directory
with os_helper.EnvironmentVarGuard() as env:
- env['PATH'] = ''
- with unittest.mock.patch('distutils.spawn.os.confstr',
+ env["PATH"] = ""
+ with unittest.mock.patch("distutils.spawn.os.confstr",
return_value=tmp_dir, create=True), \
- unittest.mock.patch('distutils.spawn.os.defpath',
+ unittest.mock.patch("distutils.spawn.os.defpath",
tmp_dir):
rv = find_executable(program)
self.assertIsNone(rv)
@@ -92,10 +92,10 @@ def test_find_executable(self):
# PATH=':': explicitly looks in the current directory
with os_helper.EnvironmentVarGuard() as env:
- env['PATH'] = os.pathsep
- with unittest.mock.patch('distutils.spawn.os.confstr',
- return_value='', create=True), \
- unittest.mock.patch('distutils.spawn.os.defpath', ''):
+ env["PATH"] = os.pathsep
+ with unittest.mock.patch("distutils.spawn.os.confstr",
+ return_value="", create=True), \
+ unittest.mock.patch("distutils.spawn.os.defpath", ""):
rv = find_executable(program)
self.assertIsNone(rv)
@@ -106,27 +106,27 @@ def test_find_executable(self):
# missing PATH: test os.confstr("CS_PATH") and os.defpath
with os_helper.EnvironmentVarGuard() as env:
- env.pop('PATH', None)
+ env.pop("PATH", None)
# without confstr
- with unittest.mock.patch('distutils.spawn.os.confstr',
+ with unittest.mock.patch("distutils.spawn.os.confstr",
side_effect=ValueError,
create=True), \
- unittest.mock.patch('distutils.spawn.os.defpath',
+ unittest.mock.patch("distutils.spawn.os.defpath",
tmp_dir):
rv = find_executable(program)
self.assertEqual(rv, filename)
# with confstr
- with unittest.mock.patch('distutils.spawn.os.confstr',
+ with unittest.mock.patch("distutils.spawn.os.confstr",
return_value=tmp_dir, create=True), \
- unittest.mock.patch('distutils.spawn.os.defpath', ''):
+ unittest.mock.patch("distutils.spawn.os.defpath", ""):
rv = find_executable(program)
self.assertEqual(rv, filename)
def test_spawn_missing_exe(self):
with self.assertRaises(DistutilsExecError) as ctx:
- spawn(['does-not-exist'])
+ spawn(["does-not-exist"])
self.assertIn("command 'does-not-exist' failed", str(ctx.exception))
diff --git a/.venv3.10/Lib/distutils/tests/test_sysconfig.py b/.venv3.10/Lib/distutils/tests/test_sysconfig.py
index 59676b0e..383160ed 100644
--- a/.venv3.10/Lib/distutils/tests/test_sysconfig.py
+++ b/.venv3.10/Lib/distutils/tests/test_sysconfig.py
@@ -50,7 +50,7 @@ def test_get_config_vars(self):
def test_srcdir(self):
# See Issues #15322, #15364.
- srcdir = sysconfig.get_config_var('srcdir')
+ srcdir = sysconfig.get_config_var("srcdir")
self.assertTrue(os.path.isabs(srcdir), srcdir)
self.assertTrue(os.path.isdir(srcdir), srcdir)
@@ -58,10 +58,10 @@ def test_srcdir(self):
if sysconfig.python_build:
# The python executable has not been installed so srcdir
# should be a full source checkout.
- Python_h = os.path.join(srcdir, 'Include', 'Python.h')
+ Python_h = os.path.join(srcdir, "Include", "Python.h")
self.assertTrue(os.path.exists(Python_h), Python_h)
self.assertTrue(sysconfig._is_python_source_dir(srcdir))
- elif os.name == 'posix':
+ elif os.name == "posix":
self.assertEqual(
os.path.dirname(sysconfig.get_makefile_filename()),
srcdir)
@@ -69,11 +69,11 @@ def test_srcdir(self):
def test_srcdir_independent_of_cwd(self):
# srcdir should be independent of the current working directory
# See Issues #15322, #15364.
- srcdir = sysconfig.get_config_var('srcdir')
+ srcdir = sysconfig.get_config_var("srcdir")
cwd = os.getcwd()
try:
- os.chdir('..')
- srcdir2 = sysconfig.get_config_var('srcdir')
+ os.chdir("..")
+ srcdir2 = sysconfig.get_config_var("srcdir")
finally:
os.chdir(cwd)
self.assertEqual(srcdir, srcdir2)
@@ -81,23 +81,23 @@ def test_srcdir_independent_of_cwd(self):
def customize_compiler(self):
# make sure AR gets caught
class compiler:
- compiler_type = 'unix'
+ compiler_type = "unix"
def set_executables(self, **kw):
self.exes = kw
sysconfig_vars = {
- 'AR': 'sc_ar',
- 'CC': 'sc_cc',
- 'CXX': 'sc_cxx',
- 'ARFLAGS': '--sc-arflags',
- 'CFLAGS': '--sc-cflags',
- 'CCSHARED': '--sc-ccshared',
- 'LDSHARED': 'sc_ldshared',
- 'SHLIB_SUFFIX': 'sc_shutil_suffix',
+ "AR": "sc_ar",
+ "CC": "sc_cc",
+ "CXX": "sc_cxx",
+ "ARFLAGS": "--sc-arflags",
+ "CFLAGS": "--sc-cflags",
+ "CCSHARED": "--sc-ccshared",
+ "LDSHARED": "sc_ldshared",
+ "SHLIB_SUFFIX": "sc_shutil_suffix",
# On macOS, disable _osx_support.customize_compiler()
- 'CUSTOMIZED_OSX_COMPILER': 'True',
+ "CUSTOMIZED_OSX_COMPILER": "True",
}
comp = compiler()
@@ -108,102 +108,102 @@ def set_executables(self, **kw):
return comp
- @unittest.skipUnless(get_default_compiler() == 'unix',
- 'not testing if default compiler is not unix')
+ @unittest.skipUnless(get_default_compiler() == "unix",
+ "not testing if default compiler is not unix")
def test_customize_compiler(self):
# Make sure that sysconfig._config_vars is initialized
sysconfig.get_config_vars()
- os.environ['AR'] = 'env_ar'
- os.environ['CC'] = 'env_cc'
- os.environ['CPP'] = 'env_cpp'
- os.environ['CXX'] = 'env_cxx --env-cxx-flags'
- os.environ['LDSHARED'] = 'env_ldshared'
- os.environ['LDFLAGS'] = '--env-ldflags'
- os.environ['ARFLAGS'] = '--env-arflags'
- os.environ['CFLAGS'] = '--env-cflags'
- os.environ['CPPFLAGS'] = '--env-cppflags'
+ os.environ["AR"] = "env_ar"
+ os.environ["CC"] = "env_cc"
+ os.environ["CPP"] = "env_cpp"
+ os.environ["CXX"] = "env_cxx --env-cxx-flags"
+ os.environ["LDSHARED"] = "env_ldshared"
+ os.environ["LDFLAGS"] = "--env-ldflags"
+ os.environ["ARFLAGS"] = "--env-arflags"
+ os.environ["CFLAGS"] = "--env-cflags"
+ os.environ["CPPFLAGS"] = "--env-cppflags"
comp = self.customize_compiler()
- self.assertEqual(comp.exes['archiver'],
- 'env_ar --env-arflags')
- self.assertEqual(comp.exes['preprocessor'],
- 'env_cpp --env-cppflags')
- self.assertEqual(comp.exes['compiler'],
- 'env_cc --sc-cflags --env-cflags --env-cppflags')
- self.assertEqual(comp.exes['compiler_so'],
- ('env_cc --sc-cflags '
- '--env-cflags ''--env-cppflags --sc-ccshared'))
- self.assertEqual(comp.exes['compiler_cxx'],
- 'env_cxx --env-cxx-flags')
- self.assertEqual(comp.exes['linker_exe'],
- 'env_cc')
- self.assertEqual(comp.exes['linker_so'],
- ('env_ldshared --env-ldflags --env-cflags'
- ' --env-cppflags'))
- self.assertEqual(comp.shared_lib_extension, 'sc_shutil_suffix')
-
- del os.environ['AR']
- del os.environ['CC']
- del os.environ['CPP']
- del os.environ['CXX']
- del os.environ['LDSHARED']
- del os.environ['LDFLAGS']
- del os.environ['ARFLAGS']
- del os.environ['CFLAGS']
- del os.environ['CPPFLAGS']
+ self.assertEqual(comp.exes["archiver"],
+ "env_ar --env-arflags")
+ self.assertEqual(comp.exes["preprocessor"],
+ "env_cpp --env-cppflags")
+ self.assertEqual(comp.exes["compiler"],
+ "env_cc --sc-cflags --env-cflags --env-cppflags")
+ self.assertEqual(comp.exes["compiler_so"],
+ ("env_cc --sc-cflags "
+ "--env-cflags ""--env-cppflags --sc-ccshared"))
+ self.assertEqual(comp.exes["compiler_cxx"],
+ "env_cxx --env-cxx-flags")
+ self.assertEqual(comp.exes["linker_exe"],
+ "env_cc")
+ self.assertEqual(comp.exes["linker_so"],
+ ("env_ldshared --env-ldflags --env-cflags"
+ " --env-cppflags"))
+ self.assertEqual(comp.shared_lib_extension, "sc_shutil_suffix")
+
+ del os.environ["AR"]
+ del os.environ["CC"]
+ del os.environ["CPP"]
+ del os.environ["CXX"]
+ del os.environ["LDSHARED"]
+ del os.environ["LDFLAGS"]
+ del os.environ["ARFLAGS"]
+ del os.environ["CFLAGS"]
+ del os.environ["CPPFLAGS"]
comp = self.customize_compiler()
- self.assertEqual(comp.exes['archiver'],
- 'sc_ar --sc-arflags')
- self.assertEqual(comp.exes['preprocessor'],
- 'sc_cc -E')
- self.assertEqual(comp.exes['compiler'],
- 'sc_cc --sc-cflags')
- self.assertEqual(comp.exes['compiler_so'],
- 'sc_cc --sc-cflags --sc-ccshared')
- self.assertEqual(comp.exes['compiler_cxx'],
- 'sc_cxx')
- self.assertEqual(comp.exes['linker_exe'],
- 'sc_cc')
- self.assertEqual(comp.exes['linker_so'],
- 'sc_ldshared')
- self.assertEqual(comp.shared_lib_extension, 'sc_shutil_suffix')
+ self.assertEqual(comp.exes["archiver"],
+ "sc_ar --sc-arflags")
+ self.assertEqual(comp.exes["preprocessor"],
+ "sc_cc -E")
+ self.assertEqual(comp.exes["compiler"],
+ "sc_cc --sc-cflags")
+ self.assertEqual(comp.exes["compiler_so"],
+ "sc_cc --sc-cflags --sc-ccshared")
+ self.assertEqual(comp.exes["compiler_cxx"],
+ "sc_cxx")
+ self.assertEqual(comp.exes["linker_exe"],
+ "sc_cc")
+ self.assertEqual(comp.exes["linker_so"],
+ "sc_ldshared")
+ self.assertEqual(comp.shared_lib_extension, "sc_shutil_suffix")
def test_parse_makefile_base(self):
self.makefile = TESTFN
- fd = open(self.makefile, 'w')
+ fd = open(self.makefile, "w")
try:
- fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'" '\n')
- fd.write('VAR=$OTHER\nOTHER=foo')
+ fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=LIB'" "\n")
+ fd.write("VAR=$OTHER\nOTHER=foo")
finally:
fd.close()
d = sysconfig.parse_makefile(self.makefile)
- self.assertEqual(d, {'CONFIG_ARGS': "'--arg1=optarg1' 'ENV=LIB'",
- 'OTHER': 'foo'})
+ self.assertEqual(d, {"CONFIG_ARGS": "'--arg1=optarg1' 'ENV=LIB'",
+ "OTHER": "foo"})
def test_parse_makefile_literal_dollar(self):
self.makefile = TESTFN
- fd = open(self.makefile, 'w')
+ fd = open(self.makefile, "w")
try:
- fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=\$$LIB'" '\n')
- fd.write('VAR=$OTHER\nOTHER=foo')
+ fd.write(r"CONFIG_ARGS= '--arg1=optarg1' 'ENV=\$$LIB'" "\n")
+ fd.write("VAR=$OTHER\nOTHER=foo")
finally:
fd.close()
d = sysconfig.parse_makefile(self.makefile)
- self.assertEqual(d, {'CONFIG_ARGS': r"'--arg1=optarg1' 'ENV=\$LIB'",
- 'OTHER': 'foo'})
+ self.assertEqual(d, {"CONFIG_ARGS": r"'--arg1=optarg1' 'ENV=\$LIB'",
+ "OTHER": "foo"})
def test_sysconfig_module(self):
import sysconfig as global_sysconfig
- self.assertEqual(global_sysconfig.get_config_var('CFLAGS'),
- sysconfig.get_config_var('CFLAGS'))
- self.assertEqual(global_sysconfig.get_config_var('LDFLAGS'),
- sysconfig.get_config_var('LDFLAGS'))
+ self.assertEqual(global_sysconfig.get_config_var("CFLAGS"),
+ sysconfig.get_config_var("CFLAGS"))
+ self.assertEqual(global_sysconfig.get_config_var("LDFLAGS"),
+ sysconfig.get_config_var("LDFLAGS"))
- @unittest.skipIf(sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'),
- 'compiler flags customized')
+ @unittest.skipIf(sysconfig.get_config_var("CUSTOMIZED_OSX_COMPILER"),
+ "compiler flags customized")
def test_sysconfig_compiler_vars(self):
# On OS X, binary installers support extension module building on
# various levels of the operating system with differing Xcode
@@ -220,45 +220,45 @@ def test_sysconfig_compiler_vars(self):
# The longer-term solution is to only have one version of sysconfig.
import sysconfig as global_sysconfig
- if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'):
- self.skipTest('compiler flags customized')
- self.assertEqual(global_sysconfig.get_config_var('LDSHARED'),
- sysconfig.get_config_var('LDSHARED'))
- self.assertEqual(global_sysconfig.get_config_var('CC'),
- sysconfig.get_config_var('CC'))
-
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
+ if sysconfig.get_config_var("CUSTOMIZED_OSX_COMPILER"):
+ self.skipTest("compiler flags customized")
+ self.assertEqual(global_sysconfig.get_config_var("LDSHARED"),
+ sysconfig.get_config_var("LDSHARED"))
+ self.assertEqual(global_sysconfig.get_config_var("CC"),
+ sysconfig.get_config_var("CC"))
+
+ @unittest.skipIf(sysconfig.get_config_var("EXT_SUFFIX") is None,
+ "EXT_SUFFIX required for this test")
def test_SO_deprecation(self):
self.assertWarns(DeprecationWarning,
- sysconfig.get_config_var, 'SO')
+ sysconfig.get_config_var, "SO")
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
+ @unittest.skipIf(sysconfig.get_config_var("EXT_SUFFIX") is None,
+ "EXT_SUFFIX required for this test")
def test_SO_value(self):
- with check_warnings(('', DeprecationWarning)):
- self.assertEqual(sysconfig.get_config_var('SO'),
- sysconfig.get_config_var('EXT_SUFFIX'))
+ with check_warnings(("", DeprecationWarning)):
+ self.assertEqual(sysconfig.get_config_var("SO"),
+ sysconfig.get_config_var("EXT_SUFFIX"))
- @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None,
- 'EXT_SUFFIX required for this test')
+ @unittest.skipIf(sysconfig.get_config_var("EXT_SUFFIX") is None,
+ "EXT_SUFFIX required for this test")
def test_SO_in_vars(self):
vars = sysconfig.get_config_vars()
- self.assertIsNotNone(vars['SO'])
- self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
+ self.assertIsNotNone(vars["SO"])
+ self.assertEqual(vars["SO"], vars["EXT_SUFFIX"])
def test_customize_compiler_before_get_config_vars(self):
# Issue #21923: test that a Distribution compiler
# instance can be called without an explicit call to
# get_config_vars().
- with open(TESTFN, 'w') as f:
- f.writelines(textwrap.dedent('''\
+ with open(TESTFN, "w") as f:
+ f.writelines(textwrap.dedent("""\
from distutils.core import Distribution
config = Distribution().get_command_obj('config')
# try_compile may pass or it may fail if no compiler
# is found but it should not raise an exception.
rc = config.try_compile('int x;')
- '''))
+ """))
p = subprocess.Popen([str(sys.executable), TESTFN],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
@@ -273,5 +273,5 @@ def test_suite():
return suite
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/tests/test_text_file.py b/.venv3.10/Lib/distutils/tests/test_text_file.py
index 7e76240a..1c2671d3 100644
--- a/.venv3.10/Lib/distutils/tests/test_text_file.py
+++ b/.venv3.10/Lib/distutils/tests/test_text_file.py
@@ -19,9 +19,9 @@ def test_class(self):
# so they are really called by the buildbots
# result 1: no fancy options
- result1 = ['# test file\n', '\n', 'line 3 \\\n',
- '# intervening comment\n',
- ' continues on next line\n']
+ result1 = ["# test file\n", "\n", "line 3 \\\n",
+ "# intervening comment\n",
+ " continues on next line\n"]
# result 2: just strip comments
result2 = ["\n",
diff --git a/.venv3.10/Lib/distutils/tests/test_unixccompiler.py b/.venv3.10/Lib/distutils/tests/test_unixccompiler.py
index 24725ead..be9a61be 100644
--- a/.venv3.10/Lib/distutils/tests/test_unixccompiler.py
+++ b/.venv3.10/Lib/distutils/tests/test_unixccompiler.py
@@ -15,7 +15,7 @@ def setUp(self):
self._backup_config_vars = dict(sysconfig._config_vars)
class CompilerWrapper(UnixCCompiler):
def rpath_foo(self):
- return self.runtime_library_dir_option('/foo')
+ return self.runtime_library_dir_option("/foo")
self.cc = CompilerWrapper()
def tearDown(self):
@@ -24,7 +24,7 @@ def tearDown(self):
sysconfig._config_vars.clear()
sysconfig._config_vars.update(self._backup_config_vars)
- @unittest.skipIf(sys.platform == 'win32', "can't test on Windows")
+ @unittest.skipIf(sys.platform == "win32", "can't test on Windows")
def test_runtime_libdir_option(self):
# Issue#5900
#
@@ -32,110 +32,110 @@ def test_runtime_libdir_option(self):
# GNU ld is used
# darwin
- sys.platform = 'darwin'
- self.assertEqual(self.cc.rpath_foo(), '-L/foo')
+ sys.platform = "darwin"
+ self.assertEqual(self.cc.rpath_foo(), "-L/foo")
# hp-ux
- sys.platform = 'hp-ux'
+ sys.platform = "hp-ux"
old_gcv = sysconfig.get_config_var
def gcv(v):
- return 'xxx'
+ return "xxx"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), ['+s', '-L/foo'])
+ self.assertEqual(self.cc.rpath_foo(), ["+s", "-L/foo"])
def gcv(v):
- return 'gcc'
+ return "gcc"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo'])
+ self.assertEqual(self.cc.rpath_foo(), ["-Wl,+s", "-L/foo"])
def gcv(v):
- return 'g++'
+ return "g++"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo'])
+ self.assertEqual(self.cc.rpath_foo(), ["-Wl,+s", "-L/foo"])
sysconfig.get_config_var = old_gcv
# GCC GNULD
- sys.platform = 'bar'
+ sys.platform = "bar"
def gcv(v):
- if v == 'CC':
- return 'gcc'
- elif v == 'GNULD':
- return 'yes'
+ if v == "CC":
+ return "gcc"
+ elif v == "GNULD":
+ return "yes"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo')
+ self.assertEqual(self.cc.rpath_foo(), "-Wl,--enable-new-dtags,-R/foo")
# GCC non-GNULD
- sys.platform = 'bar'
+ sys.platform = "bar"
def gcv(v):
- if v == 'CC':
- return 'gcc'
- elif v == 'GNULD':
- return 'no'
+ if v == "CC":
+ return "gcc"
+ elif v == "GNULD":
+ return "no"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), '-Wl,-R/foo')
+ self.assertEqual(self.cc.rpath_foo(), "-Wl,-R/foo")
# GCC GNULD with fully qualified configuration prefix
# see #7617
- sys.platform = 'bar'
+ sys.platform = "bar"
def gcv(v):
- if v == 'CC':
- return 'x86_64-pc-linux-gnu-gcc-4.4.2'
- elif v == 'GNULD':
- return 'yes'
+ if v == "CC":
+ return "x86_64-pc-linux-gnu-gcc-4.4.2"
+ elif v == "GNULD":
+ return "yes"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo')
+ self.assertEqual(self.cc.rpath_foo(), "-Wl,--enable-new-dtags,-R/foo")
# non-GCC GNULD
- sys.platform = 'bar'
+ sys.platform = "bar"
def gcv(v):
- if v == 'CC':
- return 'cc'
- elif v == 'GNULD':
- return 'yes'
+ if v == "CC":
+ return "cc"
+ elif v == "GNULD":
+ return "yes"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), '-R/foo')
+ self.assertEqual(self.cc.rpath_foo(), "-R/foo")
# non-GCC non-GNULD
- sys.platform = 'bar'
+ sys.platform = "bar"
def gcv(v):
- if v == 'CC':
- return 'cc'
- elif v == 'GNULD':
- return 'no'
+ if v == "CC":
+ return "cc"
+ elif v == "GNULD":
+ return "no"
sysconfig.get_config_var = gcv
- self.assertEqual(self.cc.rpath_foo(), '-R/foo')
+ self.assertEqual(self.cc.rpath_foo(), "-R/foo")
- @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X')
+ @unittest.skipUnless(sys.platform == "darwin", "test only relevant for OS X")
def test_osx_cc_overrides_ldshared(self):
# Issue #18080:
# ensure that setting CC env variable also changes default linker
def gcv(v):
- if v == 'LDSHARED':
- return 'gcc-4.2 -bundle -undefined dynamic_lookup '
- return 'gcc-4.2'
+ if v == "LDSHARED":
+ return "gcc-4.2 -bundle -undefined dynamic_lookup "
+ return "gcc-4.2"
sysconfig.get_config_var = gcv
with EnvironmentVarGuard() as env:
- env['CC'] = 'my_cc'
- del env['LDSHARED']
+ env["CC"] = "my_cc"
+ del env["LDSHARED"]
sysconfig.customize_compiler(self.cc)
- self.assertEqual(self.cc.linker_so[0], 'my_cc')
+ self.assertEqual(self.cc.linker_so[0], "my_cc")
- @unittest.skipUnless(sys.platform == 'darwin', 'test only relevant for OS X')
+ @unittest.skipUnless(sys.platform == "darwin", "test only relevant for OS X")
def test_osx_explicit_ldshared(self):
# Issue #18080:
# ensure that setting CC env variable does not change
# explicit LDSHARED setting for linker
def gcv(v):
- if v == 'LDSHARED':
- return 'gcc-4.2 -bundle -undefined dynamic_lookup '
- return 'gcc-4.2'
+ if v == "LDSHARED":
+ return "gcc-4.2 -bundle -undefined dynamic_lookup "
+ return "gcc-4.2"
sysconfig.get_config_var = gcv
with EnvironmentVarGuard() as env:
- env['CC'] = 'my_cc'
- env['LDSHARED'] = 'my_ld -bundle -dynamic'
+ env["CC"] = "my_cc"
+ env["LDSHARED"] = "my_ld -bundle -dynamic"
sysconfig.customize_compiler(self.cc)
- self.assertEqual(self.cc.linker_so[0], 'my_ld')
+ self.assertEqual(self.cc.linker_so[0], "my_ld")
def test_suite():
diff --git a/.venv3.10/Lib/distutils/tests/test_upload.py b/.venv3.10/Lib/distutils/tests/test_upload.py
index 74f0bc0a..8093a2fd 100644
--- a/.venv3.10/Lib/distutils/tests/test_upload.py
+++ b/.venv3.10/Lib/distutils/tests/test_upload.py
@@ -51,16 +51,16 @@ def __init__(self, url, msg=None, code=None):
self.req = url
else:
self.req = None
- self.msg = msg or 'OK'
+ self.msg = msg or "OK"
self.code = code or 200
def getheader(self, name, default=None):
return {
- 'content-type': 'text/plain; charset=utf-8',
+ "content-type": "text/plain; charset=utf-8",
}.get(name.lower(), default)
def read(self):
- return b'xyzzy'
+ return b"xyzzy"
def getcode(self):
return self.code
@@ -91,9 +91,9 @@ def test_finalize_options(self):
dist = Distribution()
cmd = upload(dist)
cmd.finalize_options()
- for attr, waited in (('username', 'me'), ('password', 'secret'),
- ('realm', 'pypi'),
- ('repository', 'https://upload.pypi.org/legacy/')):
+ for attr, waited in (("username", "me"), ("password", "secret"),
+ ("realm", "pypi"),
+ ("repository", "https://upload.pypi.org/legacy/")):
self.assertEqual(getattr(cmd, attr), waited)
def test_saved_password(self):
@@ -108,16 +108,16 @@ def test_saved_password(self):
# make sure we get it as well, if another command
# initialized it at the dist level
- dist.password = 'xxx'
+ dist.password = "xxx"
cmd = upload(dist)
cmd.finalize_options()
- self.assertEqual(cmd.password, 'xxx')
+ self.assertEqual(cmd.password, "xxx")
def test_upload(self):
tmp = self.mkdtemp()
- path = os.path.join(tmp, 'xxx')
+ path = os.path.join(tmp, "xxx")
self.write_file(path)
- command, pyversion, filename = 'xxx', '2.6', path
+ command, pyversion, filename = "xxx", "2.6", path
dist_files = [(command, pyversion, filename)]
self.write_file(self.rc, PYPIRC_LONG_PASSWORD)
@@ -130,43 +130,43 @@ def test_upload(self):
# what did we send ?
headers = dict(self.last_open.req.headers)
- self.assertGreaterEqual(int(headers['Content-length']), 2162)
- content_type = headers['Content-type']
- self.assertTrue(content_type.startswith('multipart/form-data'))
- self.assertEqual(self.last_open.req.get_method(), 'POST')
- expected_url = 'https://upload.pypi.org/legacy/'
+ self.assertGreaterEqual(int(headers["Content-length"]), 2162)
+ content_type = headers["Content-type"]
+ self.assertTrue(content_type.startswith("multipart/form-data"))
+ self.assertEqual(self.last_open.req.get_method(), "POST")
+ expected_url = "https://upload.pypi.org/legacy/"
self.assertEqual(self.last_open.req.get_full_url(), expected_url)
data = self.last_open.req.data
- self.assertIn(b'xxx',data)
- self.assertIn(b'protocol_version', data)
- self.assertIn(b'sha256_digest', data)
+ self.assertIn(b"xxx",data)
+ self.assertIn(b"protocol_version", data)
+ self.assertIn(b"sha256_digest", data)
self.assertIn(
- b'cd2eb0837c9b4c962c22d2ff8b5441b7b45805887f051d39bf133b583baf'
- b'6860',
+ b"cd2eb0837c9b4c962c22d2ff8b5441b7b45805887f051d39bf133b583baf"
+ b"6860",
data
)
- if b'md5_digest' in data:
- self.assertIn(b'f561aaf6ef0bf14d4208bb46a4ccb3ad', data)
- if b'blake2_256_digest' in data:
+ if b"md5_digest" in data:
+ self.assertIn(b"f561aaf6ef0bf14d4208bb46a4ccb3ad", data)
+ if b"blake2_256_digest" in data:
self.assertIn(
- b'b6f289a27d4fe90da63c503bfe0a9b761a8f76bb86148565065f040be'
- b'6d1c3044cf7ded78ef800509bccb4b648e507d88dc6383d67642aadcc'
- b'ce443f1534330a',
+ b"b6f289a27d4fe90da63c503bfe0a9b761a8f76bb86148565065f040be"
+ b"6d1c3044cf7ded78ef800509bccb4b648e507d88dc6383d67642aadcc"
+ b"ce443f1534330a",
data
)
# The PyPI response body was echoed
results = self.get_logs(INFO)
- self.assertEqual(results[-1], 75 * '-' + '\nxyzzy\n' + 75 * '-')
+ self.assertEqual(results[-1], 75 * "-" + "\nxyzzy\n" + 75 * "-")
# bpo-32304: archives whose last byte was b'\r' were corrupted due to
# normalization intended for Mac OS 9.
def test_upload_correct_cr(self):
# content that ends with \r should not be modified.
tmp = self.mkdtemp()
- path = os.path.join(tmp, 'xxx')
- self.write_file(path, content='yy\r')
- command, pyversion, filename = 'xxx', '2.6', path
+ path = os.path.join(tmp, "xxx")
+ self.write_file(path, content="yy\r")
+ command, pyversion, filename = "xxx", "2.6", path
dist_files = [(command, pyversion, filename)]
self.write_file(self.rc, PYPIRC_LONG_PASSWORD)
@@ -174,7 +174,7 @@ def test_upload_correct_cr(self):
# preserved.
pkg_dir, dist = self.create_dist(
dist_files=dist_files,
- description='long description\r'
+ description="long description\r"
)
cmd = upload(dist)
cmd.show_response = 1
@@ -182,8 +182,8 @@ def test_upload_correct_cr(self):
cmd.run()
headers = dict(self.last_open.req.headers)
- self.assertGreaterEqual(int(headers['Content-length']), 2172)
- self.assertIn(b'long description\r', self.last_open.req.data)
+ self.assertGreaterEqual(int(headers["Content-length"]), 2172)
+ self.assertIn(b"long description\r", self.last_open.req.data)
def test_upload_fails(self):
self.next_msg = "Not Found"
@@ -192,20 +192,20 @@ def test_upload_fails(self):
def test_wrong_exception_order(self):
tmp = self.mkdtemp()
- path = os.path.join(tmp, 'xxx')
+ path = os.path.join(tmp, "xxx")
self.write_file(path)
- dist_files = [('xxx', '2.6', path)] # command, pyversion, filename
+ dist_files = [("xxx", "2.6", path)] # command, pyversion, filename
self.write_file(self.rc, PYPIRC_LONG_PASSWORD)
pkg_dir, dist = self.create_dist(dist_files=dist_files)
tests = [
- (OSError('oserror'), 'oserror', OSError),
- (HTTPError('url', 400, 'httperror', {}, None),
- 'Upload failed (400): httperror', DistutilsError),
+ (OSError("oserror"), "oserror", OSError),
+ (HTTPError("url", 400, "httperror", {}, None),
+ "Upload failed (400): httperror", DistutilsError),
]
for exception, expected, raised_exception in tests:
with self.subTest(exception=type(exception).__name__):
- with mock.patch('distutils.command.upload.urlopen',
+ with mock.patch("distutils.command.upload.urlopen",
new=mock.Mock(side_effect=exception)):
with self.assertRaises(raised_exception):
cmd = upload(dist)
diff --git a/.venv3.10/Lib/distutils/tests/test_util.py b/.venv3.10/Lib/distutils/tests/test_util.py
index d4a01c6e..1182a811 100644
--- a/.venv3.10/Lib/distutils/tests/test_util.py
+++ b/.venv3.10/Lib/distutils/tests/test_util.py
@@ -32,7 +32,7 @@ def setUp(self):
self._config_vars = copy(sysconfig._config_vars)
# patching os.uname
- if hasattr(os, 'uname'):
+ if hasattr(os, "uname"):
self.uname = os.uname
self._uname = os.uname()
else:
@@ -67,211 +67,211 @@ def _get_uname(self):
def test_get_platform(self):
# windows XP, 32bits
- os.name = 'nt'
- sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
- '[MSC v.1310 32 bit (Intel)]')
- sys.platform = 'win32'
- self.assertEqual(get_platform(), 'win32')
+ os.name = "nt"
+ sys.version = ("2.4.4 (#71, Oct 18 2006, 08:34:43) "
+ "[MSC v.1310 32 bit (Intel)]")
+ sys.platform = "win32"
+ self.assertEqual(get_platform(), "win32")
# windows XP, amd64
- os.name = 'nt'
- sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
- '[MSC v.1310 32 bit (Amd64)]')
- sys.platform = 'win32'
- self.assertEqual(get_platform(), 'win-amd64')
+ os.name = "nt"
+ sys.version = ("2.4.4 (#71, Oct 18 2006, 08:34:43) "
+ "[MSC v.1310 32 bit (Amd64)]")
+ sys.platform = "win32"
+ self.assertEqual(get_platform(), "win-amd64")
# macbook
- os.name = 'posix'
- sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) '
- '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]')
- sys.platform = 'darwin'
- self._set_uname(('Darwin', 'macziade', '8.11.1',
- ('Darwin Kernel Version 8.11.1: '
- 'Wed Oct 10 18:23:28 PDT 2007; '
- 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
+ os.name = "posix"
+ sys.version = ("2.5 (r25:51918, Sep 19 2006, 08:49:13) "
+ "\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]")
+ sys.platform = "darwin"
+ self._set_uname(("Darwin", "macziade", "8.11.1",
+ ("Darwin Kernel Version 8.11.1: "
+ "Wed Oct 10 18:23:28 PDT 2007; "
+ "root:xnu-792.25.20~1/RELEASE_I386"), "i386"))
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+ get_config_vars()["MACOSX_DEPLOYMENT_TARGET"] = "10.3"
- get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
- '-fwrapv -O3 -Wall -Wstrict-prototypes')
+ get_config_vars()["CFLAGS"] = ("-fno-strict-aliasing -DNDEBUG -g "
+ "-fwrapv -O3 -Wall -Wstrict-prototypes")
cursize = sys.maxsize
sys.maxsize = (2 ** 31)-1
try:
- self.assertEqual(get_platform(), 'macosx-10.3-i386')
+ self.assertEqual(get_platform(), "macosx-10.3-i386")
finally:
sys.maxsize = cursize
# macbook with fat binaries (fat, universal or fat64)
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
- get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
- '/Developer/SDKs/MacOSX10.4u.sdk '
- '-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3')
+ get_config_vars()["MACOSX_DEPLOYMENT_TARGET"] = "10.4"
+ get_config_vars()["CFLAGS"] = ("-arch ppc -arch i386 -isysroot "
+ "/Developer/SDKs/MacOSX10.4u.sdk "
+ "-fno-strict-aliasing -fno-common "
+ "-dynamic -DNDEBUG -g -O3")
- self.assertEqual(get_platform(), 'macosx-10.4-fat')
+ self.assertEqual(get_platform(), "macosx-10.4-fat")
_osx_support._remove_original_values(get_config_vars())
- os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
- self.assertEqual(get_platform(), 'macosx-10.4-fat')
+ os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.1"
+ self.assertEqual(get_platform(), "macosx-10.4-fat")
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
- '/Developer/SDKs/MacOSX10.4u.sdk '
- '-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3')
+ get_config_vars()["CFLAGS"] = ("-arch x86_64 -arch i386 -isysroot "
+ "/Developer/SDKs/MacOSX10.4u.sdk "
+ "-fno-strict-aliasing -fno-common "
+ "-dynamic -DNDEBUG -g -O3")
- self.assertEqual(get_platform(), 'macosx-10.4-intel')
+ self.assertEqual(get_platform(), "macosx-10.4-intel")
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
- '/Developer/SDKs/MacOSX10.4u.sdk '
- '-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3')
- self.assertEqual(get_platform(), 'macosx-10.4-fat3')
+ get_config_vars()["CFLAGS"] = ("-arch x86_64 -arch ppc -arch i386 -isysroot "
+ "/Developer/SDKs/MacOSX10.4u.sdk "
+ "-fno-strict-aliasing -fno-common "
+ "-dynamic -DNDEBUG -g -O3")
+ self.assertEqual(get_platform(), "macosx-10.4-fat3")
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
- '/Developer/SDKs/MacOSX10.4u.sdk '
- '-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3')
- self.assertEqual(get_platform(), 'macosx-10.4-universal')
+ get_config_vars()["CFLAGS"] = ("-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot "
+ "/Developer/SDKs/MacOSX10.4u.sdk "
+ "-fno-strict-aliasing -fno-common "
+ "-dynamic -DNDEBUG -g -O3")
+ self.assertEqual(get_platform(), "macosx-10.4-universal")
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
- '/Developer/SDKs/MacOSX10.4u.sdk '
- '-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3')
+ get_config_vars()["CFLAGS"] = ("-arch x86_64 -arch ppc64 -isysroot "
+ "/Developer/SDKs/MacOSX10.4u.sdk "
+ "-fno-strict-aliasing -fno-common "
+ "-dynamic -DNDEBUG -g -O3")
- self.assertEqual(get_platform(), 'macosx-10.4-fat64')
+ self.assertEqual(get_platform(), "macosx-10.4-fat64")
- for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
+ for arch in ("ppc", "i386", "x86_64", "ppc64"):
_osx_support._remove_original_values(get_config_vars())
- get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
- '/Developer/SDKs/MacOSX10.4u.sdk '
- '-fno-strict-aliasing -fno-common '
- '-dynamic -DNDEBUG -g -O3'%(arch,))
+ get_config_vars()["CFLAGS"] = ("-arch %s -isysroot "
+ "/Developer/SDKs/MacOSX10.4u.sdk "
+ "-fno-strict-aliasing -fno-common "
+ "-dynamic -DNDEBUG -g -O3"%(arch,))
- self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
+ self.assertEqual(get_platform(), "macosx-10.4-%s"%(arch,))
# linux debian sarge
- os.name = 'posix'
- sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) '
- '\n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]')
- sys.platform = 'linux2'
- self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7',
- '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686'))
+ os.name = "posix"
+ sys.version = ("2.3.5 (#1, Jul 4 2007, 17:28:59) "
+ "\n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]")
+ sys.platform = "linux2"
+ self._set_uname(("Linux", "aglae", "2.6.21.1dedibox-r7",
+ "#1 Mon Apr 30 17:25:38 CEST 2007", "i686"))
- self.assertEqual(get_platform(), 'linux-i686')
+ self.assertEqual(get_platform(), "linux-i686")
# XXX more platforms to tests here
def test_convert_path(self):
# linux/mac
- os.sep = '/'
+ os.sep = "/"
def _join(path):
- return '/'.join(path)
+ return "/".join(path)
os.path.join = _join
- self.assertEqual(convert_path('/home/to/my/stuff'),
- '/home/to/my/stuff')
+ self.assertEqual(convert_path("/home/to/my/stuff"),
+ "/home/to/my/stuff")
# win
- os.sep = '\\'
+ os.sep = "\\"
def _join(*path):
- return '\\'.join(path)
+ return "\\".join(path)
os.path.join = _join
- self.assertRaises(ValueError, convert_path, '/home/to/my/stuff')
- self.assertRaises(ValueError, convert_path, 'home/to/my/stuff/')
+ self.assertRaises(ValueError, convert_path, "/home/to/my/stuff")
+ self.assertRaises(ValueError, convert_path, "home/to/my/stuff/")
- self.assertEqual(convert_path('home/to/my/stuff'),
- 'home\\to\\my\\stuff')
- self.assertEqual(convert_path('.'),
+ self.assertEqual(convert_path("home/to/my/stuff"),
+ "home\\to\\my\\stuff")
+ self.assertEqual(convert_path("."),
os.curdir)
def test_change_root(self):
# linux/mac
- os.name = 'posix'
+ os.name = "posix"
def _isabs(path):
- return path[0] == '/'
+ return path[0] == "/"
os.path.isabs = _isabs
def _join(*path):
- return '/'.join(path)
+ return "/".join(path)
os.path.join = _join
- self.assertEqual(change_root('/root', '/old/its/here'),
- '/root/old/its/here')
- self.assertEqual(change_root('/root', 'its/here'),
- '/root/its/here')
+ self.assertEqual(change_root("/root", "/old/its/here"),
+ "/root/old/its/here")
+ self.assertEqual(change_root("/root", "its/here"),
+ "/root/its/here")
# windows
- os.name = 'nt'
+ os.name = "nt"
def _isabs(path):
- return path.startswith('c:\\')
+ return path.startswith("c:\\")
os.path.isabs = _isabs
def _splitdrive(path):
- if path.startswith('c:'):
- return ('', path.replace('c:', ''))
- return ('', path)
+ if path.startswith("c:"):
+ return ("", path.replace("c:", ""))
+ return ("", path)
os.path.splitdrive = _splitdrive
def _join(*path):
- return '\\'.join(path)
+ return "\\".join(path)
os.path.join = _join
- self.assertEqual(change_root('c:\\root', 'c:\\old\\its\\here'),
- 'c:\\root\\old\\its\\here')
- self.assertEqual(change_root('c:\\root', 'its\\here'),
- 'c:\\root\\its\\here')
+ self.assertEqual(change_root("c:\\root", "c:\\old\\its\\here"),
+ "c:\\root\\old\\its\\here")
+ self.assertEqual(change_root("c:\\root", "its\\here"),
+ "c:\\root\\its\\here")
# BugsBunny os (it's a great os)
- os.name = 'BugsBunny'
+ os.name = "BugsBunny"
self.assertRaises(DistutilsPlatformError,
- change_root, 'c:\\root', 'its\\here')
+ change_root, "c:\\root", "its\\here")
# XXX platforms to be covered: mac
def test_check_environ(self):
util._environ_checked = 0
- os.environ.pop('HOME', None)
+ os.environ.pop("HOME", None)
check_environ()
- self.assertEqual(os.environ['PLAT'], get_platform())
+ self.assertEqual(os.environ["PLAT"], get_platform())
self.assertEqual(util._environ_checked, 1)
- @unittest.skipUnless(os.name == 'posix', 'specific to posix')
+ @unittest.skipUnless(os.name == "posix", "specific to posix")
def test_check_environ_getpwuid(self):
util._environ_checked = 0
- os.environ.pop('HOME', None)
+ os.environ.pop("HOME", None)
import pwd
# only set pw_dir field, other fields are not used
result = pwd.struct_passwd((None, None, None, None, None,
- '/home/distutils', None))
- with mock.patch.object(pwd, 'getpwuid', return_value=result):
+ "/home/distutils", None))
+ with mock.patch.object(pwd, "getpwuid", return_value=result):
check_environ()
- self.assertEqual(os.environ['HOME'], '/home/distutils')
+ self.assertEqual(os.environ["HOME"], "/home/distutils")
util._environ_checked = 0
- os.environ.pop('HOME', None)
+ os.environ.pop("HOME", None)
# bpo-10496: Catch pwd.getpwuid() error
- with mock.patch.object(pwd, 'getpwuid', side_effect=KeyError):
+ with mock.patch.object(pwd, "getpwuid", side_effect=KeyError):
check_environ()
- self.assertNotIn('HOME', os.environ)
+ self.assertNotIn("HOME", os.environ)
def test_split_quoted(self):
self.assertEqual(split_quoted('""one"" "two" \'three\' \\four'),
- ['one', 'two', 'three', 'four'])
+ ["one", "two", "three", "four"])
def test_strtobool(self):
- yes = ('y', 'Y', 'yes', 'True', 't', 'true', 'True', 'On', 'on', '1')
- no = ('n', 'no', 'f', 'false', 'off', '0', 'Off', 'No', 'N')
+ yes = ("y", "Y", "yes", "True", "t", "true", "True", "On", "on", "1")
+ no = ("n", "no", "f", "false", "off", "0", "Off", "No", "N")
for y in yes:
self.assertTrue(strtobool(y))
@@ -280,10 +280,10 @@ def test_strtobool(self):
self.assertFalse(strtobool(n))
def test_rfc822_escape(self):
- header = 'I am a\npoor\nlonesome\nheader\n'
+ header = "I am a\npoor\nlonesome\nheader\n"
res = rfc822_escape(header)
- wanted = ('I am a%(8s)spoor%(8s)slonesome%(8s)s'
- 'header%(8s)s') % {'8s': '\n'+8*' '}
+ wanted = ("I am a%(8s)spoor%(8s)slonesome%(8s)s"
+ "header%(8s)s") % {"8s": "\n"+8*" "}
self.assertEqual(res, wanted)
def test_dont_write_bytecode(self):
diff --git a/.venv3.10/Lib/distutils/tests/test_version.py b/.venv3.10/Lib/distutils/tests/test_version.py
index 8671cd2f..bf02e17d 100644
--- a/.venv3.10/Lib/distutils/tests/test_version.py
+++ b/.venv3.10/Lib/distutils/tests/test_version.py
@@ -7,30 +7,30 @@
class VersionTestCase(unittest.TestCase):
def test_prerelease(self):
- version = StrictVersion('1.2.3a1')
+ version = StrictVersion("1.2.3a1")
self.assertEqual(version.version, (1, 2, 3))
- self.assertEqual(version.prerelease, ('a', 1))
- self.assertEqual(str(version), '1.2.3a1')
+ self.assertEqual(version.prerelease, ("a", 1))
+ self.assertEqual(str(version), "1.2.3a1")
- version = StrictVersion('1.2.0')
- self.assertEqual(str(version), '1.2')
+ version = StrictVersion("1.2.0")
+ self.assertEqual(str(version), "1.2")
def test_cmp_strict(self):
- versions = (('1.5.1', '1.5.2b2', -1),
- ('161', '3.10a', ValueError),
- ('8.02', '8.02', 0),
- ('3.4j', '1996.07.12', ValueError),
- ('3.2.pl0', '3.1.1.6', ValueError),
- ('2g6', '11g', ValueError),
- ('0.9', '2.2', -1),
- ('1.2.1', '1.2', 1),
- ('1.1', '1.2.2', -1),
- ('1.2', '1.1', 1),
- ('1.2.1', '1.2.2', -1),
- ('1.2.2', '1.2', 1),
- ('1.2', '1.2.2', -1),
- ('0.4.0', '0.4', 0),
- ('1.13++', '5.5.kw', ValueError))
+ versions = (("1.5.1", "1.5.2b2", -1),
+ ("161", "3.10a", ValueError),
+ ("8.02", "8.02", 0),
+ ("3.4j", "1996.07.12", ValueError),
+ ("3.2.pl0", "3.1.1.6", ValueError),
+ ("2g6", "11g", ValueError),
+ ("0.9", "2.2", -1),
+ ("1.2.1", "1.2", 1),
+ ("1.1", "1.2.2", -1),
+ ("1.2", "1.1", 1),
+ ("1.2.1", "1.2.2", -1),
+ ("1.2.2", "1.2", 1),
+ ("1.2", "1.2.2", -1),
+ ("0.4.0", "0.4", 0),
+ ("1.13++", "5.5.kw", ValueError))
for v1, v2, wanted in versions:
try:
@@ -43,41 +43,41 @@ def test_cmp_strict(self):
"shouldn't raise ValueError")
% (v1, v2))
self.assertEqual(res, wanted,
- 'cmp(%s, %s) should be %s, got %s' %
+ "cmp(%s, %s) should be %s, got %s" %
(v1, v2, wanted, res))
res = StrictVersion(v1)._cmp(v2)
self.assertEqual(res, wanted,
- 'cmp(%s, %s) should be %s, got %s' %
+ "cmp(%s, %s) should be %s, got %s" %
(v1, v2, wanted, res))
res = StrictVersion(v1)._cmp(object())
self.assertIs(res, NotImplemented,
- 'cmp(%s, %s) should be NotImplemented, got %s' %
+ "cmp(%s, %s) should be NotImplemented, got %s" %
(v1, v2, res))
def test_cmp(self):
- versions = (('1.5.1', '1.5.2b2', -1),
- ('161', '3.10a', 1),
- ('8.02', '8.02', 0),
- ('3.4j', '1996.07.12', -1),
- ('3.2.pl0', '3.1.1.6', 1),
- ('2g6', '11g', -1),
- ('0.960923', '2.2beta29', -1),
- ('1.13++', '5.5.kw', -1))
+ versions = (("1.5.1", "1.5.2b2", -1),
+ ("161", "3.10a", 1),
+ ("8.02", "8.02", 0),
+ ("3.4j", "1996.07.12", -1),
+ ("3.2.pl0", "3.1.1.6", 1),
+ ("2g6", "11g", -1),
+ ("0.960923", "2.2beta29", -1),
+ ("1.13++", "5.5.kw", -1))
for v1, v2, wanted in versions:
res = LooseVersion(v1)._cmp(LooseVersion(v2))
self.assertEqual(res, wanted,
- 'cmp(%s, %s) should be %s, got %s' %
+ "cmp(%s, %s) should be %s, got %s" %
(v1, v2, wanted, res))
res = LooseVersion(v1)._cmp(v2)
self.assertEqual(res, wanted,
- 'cmp(%s, %s) should be %s, got %s' %
+ "cmp(%s, %s) should be %s, got %s" %
(v1, v2, wanted, res))
res = LooseVersion(v1)._cmp(object())
self.assertIs(res, NotImplemented,
- 'cmp(%s, %s) should be NotImplemented, got %s' %
+ "cmp(%s, %s) should be NotImplemented, got %s" %
(v1, v2, res))
def test_suite():
diff --git a/.venv3.10/Lib/distutils/tests/test_versionpredicate.py b/.venv3.10/Lib/distutils/tests/test_versionpredicate.py
index 28ae09dc..9d2cb77e 100644
--- a/.venv3.10/Lib/distutils/tests/test_versionpredicate.py
+++ b/.venv3.10/Lib/distutils/tests/test_versionpredicate.py
@@ -9,5 +9,5 @@
def test_suite():
return doctest.DocTestSuite(distutils.versionpredicate)
-if __name__ == '__main__':
+if __name__ == "__main__":
run_unittest(test_suite())
diff --git a/.venv3.10/Lib/distutils/text_file.py b/.venv3.10/Lib/distutils/text_file.py
index 93abad38..cc821d12 100644
--- a/.venv3.10/Lib/distutils/text_file.py
+++ b/.venv3.10/Lib/distutils/text_file.py
@@ -4,7 +4,8 @@
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
-import sys, io
+import sys
+import io
class TextFile:
@@ -66,13 +67,13 @@ class TextFile:
an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
not."""
- default_options = { 'strip_comments': 1,
- 'skip_blanks': 1,
- 'lstrip_ws': 0,
- 'rstrip_ws': 1,
- 'join_lines': 0,
- 'collapse_join': 0,
- 'errors': 'strict',
+ default_options = { "strip_comments": 1,
+ "skip_blanks": 1,
+ "lstrip_ws": 0,
+ "rstrip_ws": 1,
+ "join_lines": 0,
+ "collapse_join": 0,
+ "errors": "strict",
}
def __init__(self, filename=None, file=None, **options):
@@ -112,7 +113,7 @@ def open(self, filename):
"""Open a new file named 'filename'. This overrides both the
'filename' and 'file' arguments to the constructor."""
self.filename = filename
- self.file = io.open(self.filename, 'r', errors=self.errors)
+ self.file = io.open(self.filename, "r", errors=self.errors)
self.current_line = 0
def close(self):
@@ -168,12 +169,12 @@ def readline(self):
del self.linebuf[-1]
return line
- buildup_line = ''
+ buildup_line = ""
while True:
# read the line, make it None if EOF
line = self.file.readline()
- if line == '':
+ if line == "":
line = None
if self.strip_comments and line:
@@ -199,7 +200,7 @@ def readline(self):
# (NB. this means that if the final line is all comment
# and has no trailing newline, we will think that it's
# EOF; I think that's OK.)
- eol = (line[-1] == '\n') and '\n' or ''
+ eol = (line[-1] == "\n") and "\n" or ""
line = line[0:pos] + eol
# If all that's left is whitespace, then skip line
@@ -254,16 +255,16 @@ def readline(self):
# blank line (whether we rstrip'ed or not)? skip to next line
# if appropriate
- if (line == '' or line == '\n') and self.skip_blanks:
+ if (line == "" or line == "\n") and self.skip_blanks:
continue
if self.join_lines:
- if line[-1] == '\\':
+ if line[-1] == "\\":
buildup_line = line[:-1]
continue
- if line[-2:] == '\\\n':
- buildup_line = line[0:-2] + '\n'
+ if line[-2:] == "\\\n":
+ buildup_line = line[0:-2] + "\n"
continue
# well, I guess there's some actual content there: return it
diff --git a/.venv3.10/Lib/distutils/unixccompiler.py b/.venv3.10/Lib/distutils/unixccompiler.py
index 54dd556f..fb46f9f5 100644
--- a/.venv3.10/Lib/distutils/unixccompiler.py
+++ b/.venv3.10/Lib/distutils/unixccompiler.py
@@ -13,7 +13,9 @@
* link shared library handled by 'cc -shared'
"""
-import os, sys, re
+import os
+import sys
+import re
from distutils import sysconfig
from distutils.dep_util import newer
@@ -23,7 +25,7 @@
DistutilsExecError, CompileError, LibError, LinkError
from distutils import log
-if sys.platform == 'darwin':
+if sys.platform == "darwin":
import _osx_support
# XXX Things not currently handled:
@@ -44,7 +46,7 @@
class UnixCCompiler(CCompiler):
- compiler_type = 'unix'
+ compiler_type = "unix"
# These are used by CCompiler in two places: the constructor sets
# instance attributes 'preprocessor', 'compiler', etc. from them, and
@@ -52,18 +54,18 @@ class UnixCCompiler(CCompiler):
# are pretty generic; they will probably have to be set by an outsider
# (eg. using information discovered by the sysconfig about building
# Python extensions).
- executables = {'preprocessor' : None,
- 'compiler' : ["cc"],
- 'compiler_so' : ["cc"],
- 'compiler_cxx' : ["cc"],
- 'linker_so' : ["cc", "-shared"],
- 'linker_exe' : ["cc"],
- 'archiver' : ["ar", "-cr"],
- 'ranlib' : None,
+ executables = {"preprocessor" : None,
+ "compiler" : ["cc"],
+ "compiler_so" : ["cc"],
+ "compiler_cxx" : ["cc"],
+ "linker_so" : ["cc", "-shared"],
+ "linker_exe" : ["cc"],
+ "archiver" : ["ar", "-cr"],
+ "ranlib" : None,
}
if sys.platform[:6] == "darwin":
- executables['ranlib'] = ["ranlib"]
+ executables["ranlib"] = ["ranlib"]
# Needed for the filename generation methods provided by the base
# class, CCompiler. NB. whoever instantiates/uses a particular
@@ -89,7 +91,7 @@ def preprocess(self, source, output_file=None, macros=None,
pp_opts = gen_preprocess_options(macros, include_dirs)
pp_args = self.preprocessor + pp_opts
if output_file:
- pp_args.extend(['-o', output_file])
+ pp_args.extend(["-o", output_file])
if extra_preargs:
pp_args[:0] = extra_preargs
if extra_postargs:
@@ -110,11 +112,11 @@ def preprocess(self, source, output_file=None, macros=None,
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
compiler_so = self.compiler_so
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
compiler_so = _osx_support.compiler_fixup(compiler_so,
cc_args + extra_postargs)
try:
- self.spawn(compiler_so + cc_args + [src, '-o', obj] +
+ self.spawn(compiler_so + cc_args + [src, "-o", obj] +
extra_postargs)
except DistutilsExecError as msg:
raise CompileError(msg)
@@ -164,9 +166,9 @@ def link(self, target_desc, objects,
if self._need_link(objects, output_filename):
ld_args = (objects + self.objects +
- lib_opts + ['-o', output_filename])
+ lib_opts + ["-o", output_filename])
if debug:
- ld_args[:0] = ['-g']
+ ld_args[:0] = ["-g"]
if extra_preargs:
ld_args[:0] = extra_preargs
if extra_postargs:
@@ -186,10 +188,10 @@ def link(self, target_desc, objects,
i = 0
if os.path.basename(linker[0]) == "env":
i = 1
- while '=' in linker[i]:
+ while "=" in linker[i]:
i += 1
- if os.path.basename(linker[i]) == 'ld_so_aix':
+ if os.path.basename(linker[i]) == "ld_so_aix":
# AIX platforms prefix the compiler with the ld_so_aix
# script, so we need to adjust our linker index
offset = 1
@@ -198,7 +200,7 @@ def link(self, target_desc, objects,
linker[i+offset] = self.compiler_cxx[i]
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
linker = _osx_support.compiler_fixup(linker, ld_args)
self.spawn(linker + ld_args)
@@ -265,12 +267,12 @@ def library_option(self, lib):
return "-l" + lib
def find_library_file(self, dirs, lib, debug=0):
- shared_f = self.library_filename(lib, lib_type='shared')
- dylib_f = self.library_filename(lib, lib_type='dylib')
- xcode_stub_f = self.library_filename(lib, lib_type='xcode_stub')
- static_f = self.library_filename(lib, lib_type='static')
+ shared_f = self.library_filename(lib, lib_type="shared")
+ dylib_f = self.library_filename(lib, lib_type="dylib")
+ xcode_stub_f = self.library_filename(lib, lib_type="xcode_stub")
+ static_f = self.library_filename(lib, lib_type="static")
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
# On OSX users can specify an alternate SDK using
# '-isysroot', calculate the SDK root if it is specified
# (and use it further on)
@@ -289,10 +291,10 @@ def find_library_file(self, dirs, lib, debug=0):
# usr/lib/libedit.tbd
# vs
# /usr/lib/libedit.dylib
- cflags = sysconfig.get_config_var('CFLAGS')
- m = re.search(r'-isysroot\s*(\S+)', cflags)
+ cflags = sysconfig.get_config_var("CFLAGS")
+ m = re.search(r"-isysroot\s*(\S+)", cflags)
if m is None:
- sysroot = _osx_support._default_sysroot(sysconfig.get_config_var('CC'))
+ sysroot = _osx_support._default_sysroot(sysconfig.get_config_var("CC"))
else:
sysroot = m.group(1)
@@ -304,9 +306,9 @@ def find_library_file(self, dirs, lib, debug=0):
static = os.path.join(dir, static_f)
xcode_stub = os.path.join(dir, xcode_stub_f)
- if sys.platform == 'darwin' and (
- dir.startswith('/System/') or (
- dir.startswith('/usr/') and not dir.startswith('/usr/local/'))):
+ if sys.platform == "darwin" and (
+ dir.startswith("/System/") or (
+ dir.startswith("/usr/") and not dir.startswith("/usr/local/"))):
shared = os.path.join(sysroot, dir[1:], shared_f)
dylib = os.path.join(sysroot, dir[1:], dylib_f)
diff --git a/.venv3.10/Lib/distutils/util.py b/.venv3.10/Lib/distutils/util.py
index 2ce5c5b6..a021ab4e 100644
--- a/.venv3.10/Lib/distutils/util.py
+++ b/.venv3.10/Lib/distutils/util.py
@@ -36,20 +36,20 @@ def get_host_platform():
For other non-POSIX platforms, currently just returns 'sys.platform'.
"""
- if os.name == 'nt':
- if 'amd64' in sys.version.lower():
- return 'win-amd64'
- if '(arm)' in sys.version.lower():
- return 'win-arm32'
- if '(arm64)' in sys.version.lower():
- return 'win-arm64'
+ if os.name == "nt":
+ if "amd64" in sys.version.lower():
+ return "win-amd64"
+ if "(arm)" in sys.version.lower():
+ return "win-arm32"
+ if "(arm64)" in sys.version.lower():
+ return "win-arm64"
return sys.platform
# Set for cross builds explicitly
if "_PYTHON_HOST_PLATFORM" in os.environ:
return os.environ["_PYTHON_HOST_PLATFORM"]
- if os.name != "posix" or not hasattr(os, 'uname'):
+ if os.name != "posix" or not hasattr(os, "uname"):
# XXX what about the architecture? NT is Intel or Alpha,
# Mac OS is M68k or PPC, etc.
return sys.platform
@@ -60,9 +60,9 @@ def get_host_platform():
# Convert the OS name to lowercase, remove '/' characters, and translate
# spaces (for "Power Macintosh")
- osname = osname.lower().replace('/', '')
- machine = machine.replace(' ', '_')
- machine = machine.replace('/', '-')
+ osname = osname.lower().replace("/", "")
+ machine = machine.replace(" ", "_")
+ machine = machine.replace("/", "-")
if osname[:5] == "linux":
# At least on Linux/Intel, 'machine' is the processor --
@@ -84,12 +84,13 @@ def get_host_platform():
return aix_platform()
elif osname[:6] == "cygwin":
osname = "cygwin"
- rel_re = re.compile (r'[\d.]+', re.ASCII)
+ rel_re = re.compile (r"[\d.]+", re.ASCII)
m = rel_re.match(release)
if m:
release = m.group()
elif osname[:6] == "darwin":
- import _osx_support, distutils.sysconfig
+ import _osx_support
+ import distutils.sysconfig
osname, release, machine = _osx_support.get_platform_osx(
distutils.sysconfig.get_config_vars(),
osname, release, machine)
@@ -97,13 +98,13 @@ def get_host_platform():
return "%s-%s-%s" % (osname, release, machine)
def get_platform():
- if os.name == 'nt':
+ if os.name == "nt":
TARGET_TO_PLAT = {
- 'x86' : 'win32',
- 'x64' : 'win-amd64',
- 'arm' : 'win-arm32',
+ "x86" : "win32",
+ "x64" : "win-amd64",
+ "arm" : "win-arm32",
}
- return TARGET_TO_PLAT.get(os.environ.get('VSCMD_ARG_TGT_ARCH')) or get_host_platform()
+ return TARGET_TO_PLAT.get(os.environ.get("VSCMD_ARG_TGT_ARCH")) or get_host_platform()
else:
return get_host_platform()
@@ -116,18 +117,18 @@ def convert_path (pathname):
ValueError on non-Unix-ish systems if 'pathname' either starts or
ends with a slash.
"""
- if os.sep == '/':
+ if os.sep == "/":
return pathname
if not pathname:
return pathname
- if pathname[0] == '/':
+ if pathname[0] == "/":
raise ValueError("path '%s' cannot be absolute" % pathname)
- if pathname[-1] == '/':
+ if pathname[-1] == "/":
raise ValueError("path '%s' cannot end with '/'" % pathname)
- paths = pathname.split('/')
- while '.' in paths:
- paths.remove('.')
+ paths = pathname.split("/")
+ while "." in paths:
+ paths.remove(".")
if not paths:
return os.curdir
return os.path.join(*paths)
@@ -141,15 +142,15 @@ def change_root (new_root, pathname):
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS.
"""
- if os.name == 'posix':
+ if os.name == "posix":
if not os.path.isabs(pathname):
return os.path.join(new_root, pathname)
else:
return os.path.join(new_root, pathname[1:])
- elif os.name == 'nt':
+ elif os.name == "nt":
(drive, path) = os.path.splitdrive(pathname)
- if path[0] == '\\':
+ if path[0] == "\\":
path = path[1:]
return os.path.join(new_root, path)
@@ -170,17 +171,17 @@ def check_environ ():
if _environ_checked:
return
- if os.name == 'posix' and 'HOME' not in os.environ:
+ if os.name == "posix" and "HOME" not in os.environ:
try:
import pwd
- os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
+ os.environ["HOME"] = pwd.getpwuid(os.getuid())[5]
except (ImportError, KeyError):
# bpo-10496: if the current user identifier doesn't exist in the
# password database, do nothing
pass
- if 'PLAT' not in os.environ:
- os.environ['PLAT'] = get_platform()
+ if "PLAT" not in os.environ:
+ os.environ["PLAT"] = get_platform()
_environ_checked = 1
@@ -203,7 +204,7 @@ def _subst (match, local_vars=local_vars):
return os.environ[var_name]
try:
- return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s)
+ return re.sub(r"\$([a-zA-Z_][a-zA-Z_0-9]*)", _subst, s)
except KeyError as var:
raise ValueError("invalid variable '$%s'" % var)
@@ -257,7 +258,7 @@ def split_quoted (s):
s = s[end:].lstrip()
pos = 0
- elif s[end] == '\\': # preserve whatever is being escaped;
+ elif s[end] == "\\": # preserve whatever is being escaped;
# will become part of the current word
s = s[:end] + s[end+1:]
pos = end+1
@@ -297,8 +298,8 @@ def execute (func, args, msg=None, verbose=0, dry_run=0):
"""
if msg is None:
msg = "%s%r" % (func.__name__, args)
- if msg[-2:] == ',)': # correct for singleton tuple
- msg = msg[0:-2] + ')'
+ if msg[-2:] == ",)": # correct for singleton tuple
+ msg = msg[0:-2] + ")"
log.info(msg)
if not dry_run:
@@ -313,9 +314,9 @@ def strtobool (val):
'val' is anything else.
"""
val = val.lower()
- if val in ('y', 'yes', 't', 'true', 'on', '1'):
+ if val in ("y", "yes", "t", "true", "on", "1"):
return 1
- elif val in ('n', 'no', 'f', 'false', 'off', '0'):
+ elif val in ("n", "no", "f", "false", "off", "0"):
return 0
else:
raise ValueError("invalid truth value %r" % (val,))
@@ -361,7 +362,7 @@ def byte_compile (py_files,
# nothing is done if sys.dont_write_bytecode is True
if sys.dont_write_bytecode:
- raise DistutilsByteCompileError('byte-compiling is disabled.')
+ raise DistutilsByteCompileError("byte-compiling is disabled.")
# First, if the caller didn't force us into direct or indirect mode,
# figure out which mode we should be in. We take a conservative
@@ -423,7 +424,7 @@ def byte_compile (py_files,
msg = distutils._DEPRECATION_MESSAGE
cmd = [sys.executable]
cmd.extend(subprocess._optim_args_from_interpreter_flags())
- cmd.append(f'-Wignore:{msg}:DeprecationWarning')
+ cmd.append(f"-Wignore:{msg}:DeprecationWarning")
cmd.append(script_name)
spawn(cmd, dry_run=dry_run)
execute(os.remove, (script_name,), "removing %s" % script_name,
@@ -446,7 +447,7 @@ def byte_compile (py_files,
# cfile - byte-compiled file
# dfile - purported source filename (same as 'file' by default)
if optimize >= 0:
- opt = '' if optimize == 0 else optimize
+ opt = "" if optimize == 0 else optimize
cfile = importlib.util.cache_from_source(
file, optimization=opt)
else:
@@ -476,8 +477,8 @@ def rfc822_escape (header):
"""Return a version of the string escaped for inclusion in an
RFC-822 header, by ensuring there are 8 spaces space after each newline.
"""
- lines = header.split('\n')
- sep = '\n' + 8 * ' '
+ lines = header.split("\n")
+ sep = "\n" + 8 * " "
return sep.join(lines)
# 2to3 support
@@ -505,7 +506,7 @@ def log_debug(self, msg, *args):
log.debug(msg, *args)
if fixer_names is None:
- fixer_names = get_fixers_from_package('lib2to3.fixes')
+ fixer_names = get_fixers_from_package("lib2to3.fixes")
r = DistutilsRefactoringTool(fixer_names, options=options)
r.refactor(files, write=True)
@@ -538,15 +539,15 @@ def copydir_run_2to3(src, dest, template=None, fixer_names=None,
mkpath(os.path.dirname(outname))
res = copy_file(os.path.join(src, filename), outname, update=1)
if res[1]: copied.append(outname)
- run_2to3([fn for fn in copied if fn.lower().endswith('.py')],
+ run_2to3([fn for fn in copied if fn.lower().endswith(".py")],
fixer_names=fixer_names, options=options, explicit=explicit)
return copied
class Mixin2to3:
- '''Mixin class for commands that run 2to3.
+ """Mixin class for commands that run 2to3.
To configure 2to3, setup scripts may either change
the class variables, or inherit from individual commands
- to override how 2to3 is invoked.'''
+ to override how 2to3 is invoked."""
# provide list of fixers to run;
# defaults to all from lib2to3.fixers
diff --git a/.venv3.10/Lib/distutils/version.py b/.venv3.10/Lib/distutils/version.py
index c33bebae..edf686f0 100644
--- a/.venv3.10/Lib/distutils/version.py
+++ b/.venv3.10/Lib/distutils/version.py
@@ -127,7 +127,7 @@ class StrictVersion (Version):
in the distutils documentation.
"""
- version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$',
+ version_re = re.compile(r"^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$",
re.VERBOSE | re.ASCII)
@@ -153,9 +153,9 @@ def parse (self, vstring):
def __str__ (self):
if self.version[2] == 0:
- vstring = '.'.join(map(str, self.version[0:2]))
+ vstring = ".".join(map(str, self.version[0:2]))
else:
- vstring = '.'.join(map(str, self.version))
+ vstring = ".".join(map(str, self.version))
if self.prerelease:
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])
@@ -299,7 +299,7 @@ class LooseVersion (Version):
of "want").
"""
- component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)
+ component_re = re.compile(r"(\d+ | [a-z]+ | \.)", re.VERBOSE)
def __init__ (self, vstring=None):
if vstring:
@@ -312,7 +312,7 @@ def parse (self, vstring):
# use by __str__
self.vstring = vstring
components = [x for x in self.component_re.split(vstring)
- if x and x != '.']
+ if x and x != "."]
for i, obj in enumerate(components):
try:
components[i] = int(obj)
diff --git a/.venv3.10/Lib/doctest.py b/.venv3.10/Lib/doctest.py
index 37b31cfb..7df8d5d5 100644
--- a/.venv3.10/Lib/doctest.py
+++ b/.venv3.10/Lib/doctest.py
@@ -45,51 +45,51 @@ def _test():
details.
"""
-__docformat__ = 'reStructuredText en'
+__docformat__ = "reStructuredText en"
__all__ = [
# 0, Option Flags
- 'register_optionflag',
- 'DONT_ACCEPT_TRUE_FOR_1',
- 'DONT_ACCEPT_BLANKLINE',
- 'NORMALIZE_WHITESPACE',
- 'ELLIPSIS',
- 'SKIP',
- 'IGNORE_EXCEPTION_DETAIL',
- 'COMPARISON_FLAGS',
- 'REPORT_UDIFF',
- 'REPORT_CDIFF',
- 'REPORT_NDIFF',
- 'REPORT_ONLY_FIRST_FAILURE',
- 'REPORTING_FLAGS',
- 'FAIL_FAST',
+ "register_optionflag",
+ "DONT_ACCEPT_TRUE_FOR_1",
+ "DONT_ACCEPT_BLANKLINE",
+ "NORMALIZE_WHITESPACE",
+ "ELLIPSIS",
+ "SKIP",
+ "IGNORE_EXCEPTION_DETAIL",
+ "COMPARISON_FLAGS",
+ "REPORT_UDIFF",
+ "REPORT_CDIFF",
+ "REPORT_NDIFF",
+ "REPORT_ONLY_FIRST_FAILURE",
+ "REPORTING_FLAGS",
+ "FAIL_FAST",
# 1. Utility Functions
# 2. Example & DocTest
- 'Example',
- 'DocTest',
+ "Example",
+ "DocTest",
# 3. Doctest Parser
- 'DocTestParser',
+ "DocTestParser",
# 4. Doctest Finder
- 'DocTestFinder',
+ "DocTestFinder",
# 5. Doctest Runner
- 'DocTestRunner',
- 'OutputChecker',
- 'DocTestFailure',
- 'UnexpectedException',
- 'DebugRunner',
+ "DocTestRunner",
+ "OutputChecker",
+ "DocTestFailure",
+ "UnexpectedException",
+ "DebugRunner",
# 6. Test Functions
- 'testmod',
- 'testfile',
- 'run_docstring_examples',
+ "testmod",
+ "testfile",
+ "run_docstring_examples",
# 7. Unittest Support
- 'DocTestSuite',
- 'DocFileSuite',
- 'set_unittest_reportflags',
+ "DocTestSuite",
+ "DocFileSuite",
+ "set_unittest_reportflags",
# 8. Debugging Support
- 'script_from_examples',
- 'testsource',
- 'debug_src',
- 'debug',
+ "script_from_examples",
+ "testsource",
+ "debug_src",
+ "debug",
]
import __future__
@@ -105,7 +105,7 @@ def _test():
from io import StringIO, IncrementalNewlineDecoder
from collections import namedtuple
-TestResults = namedtuple('TestResults', 'failed attempted')
+TestResults = namedtuple("TestResults", "failed attempted")
# There are 4 basic classes:
# - Example: a pair, plus an intra-docstring line number.
@@ -133,12 +133,12 @@ def register_optionflag(name):
# Create a new flag unless `name` is already known.
return OPTIONFLAGS_BY_NAME.setdefault(name, 1 << len(OPTIONFLAGS_BY_NAME))
-DONT_ACCEPT_TRUE_FOR_1 = register_optionflag('DONT_ACCEPT_TRUE_FOR_1')
-DONT_ACCEPT_BLANKLINE = register_optionflag('DONT_ACCEPT_BLANKLINE')
-NORMALIZE_WHITESPACE = register_optionflag('NORMALIZE_WHITESPACE')
-ELLIPSIS = register_optionflag('ELLIPSIS')
-SKIP = register_optionflag('SKIP')
-IGNORE_EXCEPTION_DETAIL = register_optionflag('IGNORE_EXCEPTION_DETAIL')
+DONT_ACCEPT_TRUE_FOR_1 = register_optionflag("DONT_ACCEPT_TRUE_FOR_1")
+DONT_ACCEPT_BLANKLINE = register_optionflag("DONT_ACCEPT_BLANKLINE")
+NORMALIZE_WHITESPACE = register_optionflag("NORMALIZE_WHITESPACE")
+ELLIPSIS = register_optionflag("ELLIPSIS")
+SKIP = register_optionflag("SKIP")
+IGNORE_EXCEPTION_DETAIL = register_optionflag("IGNORE_EXCEPTION_DETAIL")
COMPARISON_FLAGS = (DONT_ACCEPT_TRUE_FOR_1 |
DONT_ACCEPT_BLANKLINE |
@@ -147,11 +147,11 @@ def register_optionflag(name):
SKIP |
IGNORE_EXCEPTION_DETAIL)
-REPORT_UDIFF = register_optionflag('REPORT_UDIFF')
-REPORT_CDIFF = register_optionflag('REPORT_CDIFF')
-REPORT_NDIFF = register_optionflag('REPORT_NDIFF')
-REPORT_ONLY_FIRST_FAILURE = register_optionflag('REPORT_ONLY_FIRST_FAILURE')
-FAIL_FAST = register_optionflag('FAIL_FAST')
+REPORT_UDIFF = register_optionflag("REPORT_UDIFF")
+REPORT_CDIFF = register_optionflag("REPORT_CDIFF")
+REPORT_NDIFF = register_optionflag("REPORT_NDIFF")
+REPORT_ONLY_FIRST_FAILURE = register_optionflag("REPORT_ONLY_FIRST_FAILURE")
+FAIL_FAST = register_optionflag("FAIL_FAST")
REPORTING_FLAGS = (REPORT_UDIFF |
REPORT_CDIFF |
@@ -160,8 +160,8 @@ def register_optionflag(name):
FAIL_FAST)
# Special string markers for use in `want` strings:
-BLANKLINE_MARKER = ''
-ELLIPSIS_MARKER = '...'
+BLANKLINE_MARKER = ""
+ELLIPSIS_MARKER = "..."
######################################################################
## Table of Contents
@@ -207,7 +207,7 @@ def _normalize_module(module, depth=2):
elif isinstance(module, str):
return __import__(module, globals(), locals(), ["*"])
elif module is None:
- return sys.modules[sys._getframe(depth).f_globals['__name__']]
+ return sys.modules[sys._getframe(depth).f_globals["__name__"]]
else:
raise TypeError("Expected a module, string, or None")
@@ -219,12 +219,12 @@ def _load_testfile(filename, package, module_relative, encoding):
if module_relative:
package = _normalize_module(package, 3)
filename = _module_relative_path(package, filename)
- if (loader := getattr(package, '__loader__', None)) is None:
+ if (loader := getattr(package, "__loader__", None)) is None:
try:
loader = package.__spec__.loader
except AttributeError:
pass
- if hasattr(loader, 'get_data'):
+ if hasattr(loader, "get_data"):
file_contents = loader.get_data(filename)
file_contents = file_contents.decode(encoding)
# get_data() opens files as 'rb', so one must do the equivalent
@@ -239,7 +239,7 @@ def _indent(s, indent=4):
every non-blank line in `s`, and return the result.
"""
# This regexp matches the start of non-blank lines:
- return re.sub('(?m)^(?!$)', indent*' ', s)
+ return re.sub("(?m)^(?!$)", indent*" ", s)
def _exception_traceback(exc_info):
"""
@@ -321,9 +321,9 @@ def _comment_line(line):
"Return a commented form of the given line"
line = line.rstrip()
if line:
- return '# '+line
+ return "# "+line
else:
- return '#'
+ return "#"
def _strip_exception_details(msg):
# Support for IGNORE_EXCEPTION_DETAIL.
@@ -342,11 +342,11 @@ def _strip_exception_details(msg):
if i >= 0:
end = i
# retain up to the first colon (if any)
- i = msg.find(':', 0, end)
+ i = msg.find(":", 0, end)
if i >= 0:
end = i
# retain just the exception name
- i = msg.rfind('.', 0, end)
+ i = msg.rfind(".", 0, end)
if i >= 0:
start = i+1
return msg[start: end]
@@ -390,25 +390,25 @@ def trace_dispatch(self, *args):
# [XX] Normalize with respect to os.path.pardir?
def _module_relative_path(module, test_path):
if not inspect.ismodule(module):
- raise TypeError('Expected a module: %r' % module)
- if test_path.startswith('/'):
- raise ValueError('Module-relative files may not have absolute paths')
+ raise TypeError("Expected a module: %r" % module)
+ if test_path.startswith("/"):
+ raise ValueError("Module-relative files may not have absolute paths")
# Normalize the path. On Windows, replace "/" with "\".
- test_path = os.path.join(*(test_path.split('/')))
+ test_path = os.path.join(*(test_path.split("/")))
# Find the base directory for the path.
- if hasattr(module, '__file__'):
+ if hasattr(module, "__file__"):
# A normal module/package
basedir = os.path.split(module.__file__)[0]
- elif module.__name__ == '__main__':
+ elif module.__name__ == "__main__":
# An interactive session.
- if len(sys.argv)>0 and sys.argv[0] != '':
+ if len(sys.argv)>0 and sys.argv[0] != "":
basedir = os.path.split(sys.argv[0])[0]
else:
basedir = os.curdir
else:
- if hasattr(module, '__path__'):
+ if hasattr(module, "__path__"):
for directory in module.__path__:
fullpath = os.path.join(directory, test_path)
if os.path.exists(fullpath):
@@ -472,12 +472,12 @@ class Example:
def __init__(self, source, want, exc_msg=None, lineno=0, indent=0,
options=None):
# Normalize inputs.
- if not source.endswith('\n'):
- source += '\n'
- if want and not want.endswith('\n'):
- want += '\n'
- if exc_msg is not None and not exc_msg.endswith('\n'):
- exc_msg += '\n'
+ if not source.endswith("\n"):
+ source += "\n"
+ if want and not want.endswith("\n"):
+ want += "\n"
+ if exc_msg is not None and not exc_msg.endswith("\n"):
+ exc_msg += "\n"
# Store properties.
self.source = source
self.want = want
@@ -542,12 +542,12 @@ def __init__(self, examples, globs, name, filename, lineno, docstring):
def __repr__(self):
if len(self.examples) == 0:
- examples = 'no examples'
+ examples = "no examples"
elif len(self.examples) == 1:
- examples = '1 example'
+ examples = "1 example"
else:
- examples = '%d examples' % len(self.examples)
- return ('<%s %s from %s:%s (%s)>' %
+ examples = "%d examples" % len(self.examples)
+ return ("<%s %s from %s:%s (%s)>" %
(self.__class__.__name__,
self.name, self.filename, self.lineno, examples))
@@ -586,7 +586,7 @@ class DocTestParser:
# (including leading indentation and prompts); `indent` is the
# indentation of the first (PS1) line of the source code; and
# `want` is the expected output (including leading indentation).
- _EXAMPLE_RE = re.compile(r'''
+ _EXAMPLE_RE = re.compile(r"""
# Source consists of a PS1 line followed by zero or more PS2 lines.
(?P
(?:^(?P [ ]*) >>> .*) # PS1 line
@@ -597,7 +597,7 @@ class DocTestParser:
(?![ ]*>>>) # Not a line starting with PS1
.+$\n? # But any other line
)*)
- ''', re.MULTILINE | re.VERBOSE)
+ """, re.MULTILINE | re.VERBOSE)
# A regular expression for handling `want` strings that contain
# expected exceptions. It divides `want` into three pieces:
@@ -623,9 +623,9 @@ class DocTestParser:
# A callable returning a true value iff its argument is a blank line
# or contains a single comment.
- _IS_BLANK_OR_COMMENT = re.compile(r'^[ ]*(#.*)?$').match
+ _IS_BLANK_OR_COMMENT = re.compile(r"^[ ]*(#.*)?$").match
- def parse(self, string, name=''):
+ def parse(self, string, name=""):
"""
Divide the given string into examples and intervening text,
and return them as a list of alternating Examples and strings.
@@ -637,7 +637,7 @@ def parse(self, string, name=''):
# If all lines begin with the same indentation, then strip it.
min_indent = self._min_indent(string)
if min_indent > 0:
- string = '\n'.join([l[min_indent:] for l in string.split('\n')])
+ string = "\n".join([l[min_indent:] for l in string.split("\n")])
output = []
charno, lineno = 0, 0
@@ -646,7 +646,7 @@ def parse(self, string, name=''):
# Add the pre-example text to `output`.
output.append(string[charno:m.start()])
# Update lineno (lines before this example)
- lineno += string.count('\n', charno, m.start())
+ lineno += string.count("\n", charno, m.start())
# Extract info from the regexp match.
(source, options, want, exc_msg) = \
self._parse_example(m, name, lineno)
@@ -654,10 +654,10 @@ def parse(self, string, name=''):
if not self._IS_BLANK_OR_COMMENT(source):
output.append( Example(source, want, exc_msg,
lineno=lineno,
- indent=min_indent+len(m.group('indent')),
+ indent=min_indent+len(m.group("indent")),
options=options) )
# Update lineno (lines inside this example)
- lineno += string.count('\n', m.start(), m.end())
+ lineno += string.count("\n", m.start(), m.end())
# Update charno.
charno = m.end()
# Add any remaining post-example text to `output`.
@@ -676,7 +676,7 @@ def get_doctest(self, string, globs, name, filename, lineno):
return DocTest(self.get_examples(string, name), globs,
name, filename, lineno, string)
- def get_examples(self, string, name=''):
+ def get_examples(self, string, name=""):
"""
Extract all doctest examples from the given string, and return
them as a list of `Example` objects. Line numbers are
@@ -702,30 +702,30 @@ def _parse_example(self, m, name, lineno):
where the example starts; both are used for error messages.
"""
# Get the example's indentation level.
- indent = len(m.group('indent'))
+ indent = len(m.group("indent"))
# Divide source into lines; check that they're properly
# indented; and then strip their indentation & prompts.
- source_lines = m.group('source').split('\n')
+ source_lines = m.group("source").split("\n")
self._check_prompt_blank(source_lines, indent, name, lineno)
- self._check_prefix(source_lines[1:], ' '*indent + '.', name, lineno)
- source = '\n'.join([sl[indent+4:] for sl in source_lines])
+ self._check_prefix(source_lines[1:], " "*indent + ".", name, lineno)
+ source = "\n".join([sl[indent+4:] for sl in source_lines])
# Divide want into lines; check that it's properly indented; and
# then strip the indentation. Spaces before the last newline should
# be preserved, so plain rstrip() isn't good enough.
- want = m.group('want')
- want_lines = want.split('\n')
- if len(want_lines) > 1 and re.match(r' *$', want_lines[-1]):
+ want = m.group("want")
+ want_lines = want.split("\n")
+ if len(want_lines) > 1 and re.match(r" *$", want_lines[-1]):
del want_lines[-1] # forget final newline & spaces after it
- self._check_prefix(want_lines, ' '*indent, name,
+ self._check_prefix(want_lines, " "*indent, name,
lineno + len(source_lines))
- want = '\n'.join([wl[indent:] for wl in want_lines])
+ want = "\n".join([wl[indent:] for wl in want_lines])
# If `want` contains a traceback message, then extract it.
m = self._EXCEPTION_RE.match(want)
if m:
- exc_msg = m.group('msg')
+ exc_msg = m.group("msg")
else:
exc_msg = None
@@ -755,24 +755,24 @@ def _find_options(self, source, name, lineno):
options = {}
# (note: with the current regexp, this will match at most once:)
for m in self._OPTION_DIRECTIVE_RE.finditer(source):
- option_strings = m.group(1).replace(',', ' ').split()
+ option_strings = m.group(1).replace(",", " ").split()
for option in option_strings:
- if (option[0] not in '+-' or
+ if (option[0] not in "+-" or
option[1:] not in OPTIONFLAGS_BY_NAME):
- raise ValueError('line %r of the doctest for %s '
- 'has an invalid option: %r' %
+ raise ValueError("line %r of the doctest for %s "
+ "has an invalid option: %r" %
(lineno+1, name, option))
flag = OPTIONFLAGS_BY_NAME[option[1:]]
- options[flag] = (option[0] == '+')
+ options[flag] = (option[0] == "+")
if options and self._IS_BLANK_OR_COMMENT(source):
- raise ValueError('line %r of the doctest for %s has an option '
- 'directive on a line with no example: %r' %
+ raise ValueError("line %r of the doctest for %s has an option "
+ "directive on a line with no example: %r" %
(lineno, name, source))
return options
# This regular expression finds the indentation of every non-blank
# line in a string.
- _INDENT_RE = re.compile(r'^([ ]*)(?=\S)', re.MULTILINE)
+ _INDENT_RE = re.compile(r"^([ ]*)(?=\S)", re.MULTILINE)
def _min_indent(self, s):
"Return the minimum indentation of any non-blank line in `s`"
@@ -790,9 +790,9 @@ def _check_prompt_blank(self, lines, indent, name, lineno):
a space character, then raise ValueError.
"""
for i, line in enumerate(lines):
- if len(line) >= indent+4 and line[indent+3] != ' ':
- raise ValueError('line %r of the docstring for %s '
- 'lacks blank after %s: %r' %
+ if len(line) >= indent+4 and line[indent+3] != " ":
+ raise ValueError("line %r of the docstring for %s "
+ "lacks blank after %s: %r" %
(lineno+i+1, name,
line[indent:indent+3], line))
@@ -803,8 +803,8 @@ def _check_prefix(self, lines, prefix, name, lineno):
"""
for i, line in enumerate(lines):
if line and not line.startswith(prefix):
- raise ValueError('line %r of the docstring for %s has '
- 'inconsistent leading whitespace: %r' %
+ raise ValueError("line %r of the docstring for %s has "
+ "inconsistent leading whitespace: %r" %
(lineno+i+1, name, line))
@@ -880,7 +880,7 @@ def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
"""
# If name was not specified, then extract it from the object.
if name is None:
- name = getattr(obj, '__name__', None)
+ name = getattr(obj, "__name__", None)
if name is None:
raise ValueError("DocTestFinder.find: name must be given "
"when obj.__name__ doesn't exist: %r" %
@@ -906,7 +906,7 @@ def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
# Check to see if it's one of our special internal "files"
# (see __patched_linecache_getlines).
file = inspect.getfile(obj)
- if not file[0]+file[-2:] == '<]>': file = None
+ if not file[0]+file[-2:] == "<]>": file = None
if file is None:
source_lines = None
else:
@@ -932,8 +932,8 @@ def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
globs = globs.copy()
if extraglobs is not None:
globs.update(extraglobs)
- if '__name__' not in globs:
- globs['__name__'] = '__main__' # provide a default module name
+ if "__name__" not in globs:
+ globs["__name__"] = "__main__" # provide a default module name
# Recursively explore `obj`, extracting DocTests.
tests = []
@@ -957,16 +957,16 @@ def _from_module(self, module, object):
elif inspect.isfunction(object):
return module.__dict__ is object.__globals__
elif inspect.ismethoddescriptor(object):
- if hasattr(object, '__objclass__'):
+ if hasattr(object, "__objclass__"):
obj_mod = object.__objclass__.__module__
- elif hasattr(object, '__module__'):
+ elif hasattr(object, "__module__"):
obj_mod = object.__module__
else:
return True # [XX] no easy way to tell otherwise
return module.__name__ == obj_mod
elif inspect.isclass(object):
return module.__name__ == object.__module__
- elif hasattr(object, '__module__'):
+ elif hasattr(object, "__module__"):
return module.__name__ == object.__module__
elif isinstance(object, property):
return True # [XX] no way not be sure.
@@ -990,7 +990,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
add them to `tests`.
"""
if self._verbose:
- print('Finding tests in %s' % name)
+ print("Finding tests in %s" % name)
# If we've already processed this object, then ignore it.
if id(obj) in seen:
@@ -1005,7 +1005,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
# Look for tests in a module's contained objects.
if inspect.ismodule(obj) and self._recurse:
for valname, val in obj.__dict__.items():
- valname = '%s.%s' % (name, valname)
+ valname = "%s.%s" % (name, valname)
# Recurse to functions & classes.
if ((self._is_routine(val) or inspect.isclass(val)) and
@@ -1015,7 +1015,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
# Look for tests in a module's __test__ dictionary.
if inspect.ismodule(obj) and self._recurse:
- for valname, val in getattr(obj, '__test__', {}).items():
+ for valname, val in getattr(obj, "__test__", {}).items():
if not isinstance(valname, str):
raise ValueError("DocTestFinder.find: __test__ keys "
"must be strings: %r" %
@@ -1026,7 +1026,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
"must be strings, functions, methods, "
"classes, or modules: %r" %
(type(val),))
- valname = '%s.__test__.%s' % (name, valname)
+ valname = "%s.__test__.%s" % (name, valname)
self._find(tests, val, valname, module, source_lines,
globs, seen)
@@ -1041,7 +1041,7 @@ def _find(self, tests, obj, name, module, source_lines, globs, seen):
if ((inspect.isroutine(val) or inspect.isclass(val) or
isinstance(val, property)) and
self._from_module(module, val)):
- valname = '%s.%s' % (name, valname)
+ valname = "%s.%s" % (name, valname)
self._find(tests, val, valname, module, source_lines,
globs, seen)
@@ -1057,13 +1057,13 @@ def _get_test(self, obj, name, module, globs, source_lines):
else:
try:
if obj.__doc__ is None:
- docstring = ''
+ docstring = ""
else:
docstring = obj.__doc__
if not isinstance(docstring, str):
docstring = str(docstring)
except (TypeError, AttributeError):
- docstring = ''
+ docstring = ""
# Find the docstring's location in the file.
lineno = self._find_lineno(obj, source_lines)
@@ -1077,7 +1077,7 @@ def _get_test(self, obj, name, module, globs, source_lines):
filename = None
else:
# __file__ can be None for namespace packages.
- filename = getattr(module, '__file__', None) or module.__name__
+ filename = getattr(module, "__file__", None) or module.__name__
if filename[-4:] == ".pyc":
filename = filename[:-1]
return self._parser.get_doctest(docstring, globs, name,
@@ -1090,7 +1090,7 @@ def _find_lineno(self, obj, source_lines):
Returns `None` if the given object does not have a docstring.
"""
lineno = None
- docstring = getattr(obj, '__doc__', None)
+ docstring = getattr(obj, "__doc__", None)
# Find the line number for modules.
if inspect.ismodule(obj) and docstring is not None:
@@ -1102,8 +1102,8 @@ def _find_lineno(self, obj, source_lines):
if inspect.isclass(obj) and docstring is not None:
if source_lines is None:
return None
- pat = re.compile(r'^\s*class\s*%s\b' %
- getattr(obj, '__name__', '-'))
+ pat = re.compile(r"^\s*class\s*%s\b" %
+ getattr(obj, "__name__", "-"))
for i, line in enumerate(source_lines):
if pat.match(line):
lineno = i
@@ -1111,13 +1111,13 @@ def _find_lineno(self, obj, source_lines):
# Find the line number for functions & methods.
if inspect.ismethod(obj): obj = obj.__func__
- if inspect.isfunction(obj) and getattr(obj, '__doc__', None):
+ if inspect.isfunction(obj) and getattr(obj, "__doc__", None):
# We don't use `docstring` var here, because `obj` can be changed.
obj = obj.__code__
if inspect.istraceback(obj): obj = obj.tb_frame
if inspect.isframe(obj): obj = obj.f_code
if inspect.iscode(obj):
- lineno = getattr(obj, 'co_firstlineno', None)-1
+ lineno = getattr(obj, "co_firstlineno", None)-1
# Find the line number where the docstring starts. Assume
# that it's the first line that begins with a quote mark.
@@ -1218,7 +1218,7 @@ def __init__(self, checker=None, verbose=None, optionflags=0):
"""
self._checker = checker or OutputChecker()
if verbose is None:
- verbose = '-v' in sys.argv
+ verbose = "-v" in sys.argv
self._verbose = verbose
self.optionflags = optionflags
self.original_optionflags = optionflags
@@ -1242,11 +1242,11 @@ def report_start(self, out, test, example):
"""
if self._verbose:
if example.want:
- out('Trying:\n' + _indent(example.source) +
- 'Expecting:\n' + _indent(example.want))
+ out("Trying:\n" + _indent(example.source) +
+ "Expecting:\n" + _indent(example.want))
else:
- out('Trying:\n' + _indent(example.source) +
- 'Expecting nothing\n')
+ out("Trying:\n" + _indent(example.source) +
+ "Expecting nothing\n")
def report_success(self, out, test, example, got):
"""
@@ -1268,7 +1268,7 @@ def report_unexpected_exception(self, out, test, example, exc_info):
Report that the given example raised an unexpected exception.
"""
out(self._failure_header(test, example) +
- 'Exception raised:\n' + _indent(_exception_traceback(exc_info)))
+ "Exception raised:\n" + _indent(_exception_traceback(exc_info)))
def _failure_header(self, test, example):
out = [self.DIVIDER]
@@ -1276,15 +1276,15 @@ def _failure_header(self, test, example):
if test.lineno is not None and example.lineno is not None:
lineno = test.lineno + example.lineno + 1
else:
- lineno = '?'
+ lineno = "?"
out.append('File "%s", line %s, in %s' %
(test.filename, lineno, test.name))
else:
- out.append('Line %s, in %s' % (example.lineno+1, test.name))
- out.append('Failed example:')
+ out.append("Line %s, in %s" % (example.lineno+1, test.name))
+ out.append("Failed example:")
source = example.source
out.append(_indent(source))
- return '\n'.join(out)
+ return "\n".join(out)
#/////////////////////////////////////////////////////////////////
# DocTest Running
@@ -1340,7 +1340,7 @@ def __run(self, test, compileflags, out):
# Use a special filename for compile(), so we can retrieve
# the source code during interactive debugging (see
# __patched_linecache_getlines).
- filename = '' % (test.name, examplenum)
+ filename = "" % (test.name, examplenum)
# Run the example in the given context (globs), and record
# any exception that gets raised. (But don't intercept
@@ -1425,13 +1425,13 @@ def __record_outcome(self, test, f, t):
self.failures += f
self.tries += t
- __LINECACHE_FILENAME_RE = re.compile(r'.+)'
- r'\[(?P\d+)\]>$')
+ __LINECACHE_FILENAME_RE = re.compile(r".+)"
+ r"\[(?P\d+)\]>$")
def __patched_linecache_getlines(self, filename, module_globals=None):
m = self.__LINECACHE_FILENAME_RE.match(filename)
- if m and m.group('name') == self.test.name:
- example = self.test.examples[int(m.group('examplenum'))]
+ if m and m.group("name") == self.test.name:
+ example = self.test.examples[int(m.group("examplenum"))]
return example.source.splitlines(keepends=True)
else:
return self.save_linecache_getlines(filename, module_globals)
@@ -1464,12 +1464,12 @@ def run(self, test, compileflags=None, out=None, clear_globs=True):
save_stdout = sys.stdout
if out is None:
encoding = save_stdout.encoding
- if encoding is None or encoding.lower() == 'utf-8':
+ if encoding is None or encoding.lower() == "utf-8":
out = save_stdout.write
else:
# Use backslashreplace error handling on write
def out(s):
- s = str(s.encode(encoding, 'backslashreplace'), encoding)
+ s = str(s.encode(encoding, "backslashreplace"), encoding)
save_stdout.write(s)
sys.stdout = self._fakeout
@@ -1591,7 +1591,7 @@ def _toAscii(self, s):
"""
Convert string to hex-escaped ASCII string.
"""
- return str(s.encode('ASCII', 'backslashreplace'), "ASCII")
+ return str(s.encode("ASCII", "backslashreplace"), "ASCII")
def check_output(self, want, got, optionflags):
"""
@@ -1629,11 +1629,11 @@ def check_output(self, want, got, optionflags):
# blank line, unless the DONT_ACCEPT_BLANKLINE flag is used.
if not (optionflags & DONT_ACCEPT_BLANKLINE):
# Replace in want with a blank line.
- want = re.sub(r'(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER),
- '', want)
+ want = re.sub(r"(?m)^%s\s*?$" % re.escape(BLANKLINE_MARKER),
+ "", want)
# If a line in got contains only spaces, then remove the
# spaces.
- got = re.sub(r'(?m)^[^\S\n]+$', '', got)
+ got = re.sub(r"(?m)^[^\S\n]+$", "", got)
if got == want:
return True
@@ -1641,8 +1641,8 @@ def check_output(self, want, got, optionflags):
# contents of whitespace strings. Note that this can be used
# in conjunction with the ELLIPSIS flag.
if optionflags & NORMALIZE_WHITESPACE:
- got = ' '.join(got.split())
- want = ' '.join(want.split())
+ got = " ".join(got.split())
+ want = " ".join(want.split())
if got == want:
return True
@@ -1677,7 +1677,7 @@ def _do_a_fancy_diff(self, want, got, optionflags):
return True
# The other diff types need at least a few lines to be helpful.
- return want.count('\n') > 2 and got.count('\n') > 2
+ return want.count("\n") > 2 and got.count("\n") > 2
def output_difference(self, example, got, optionflags):
"""
@@ -1690,7 +1690,7 @@ def output_difference(self, example, got, optionflags):
# If s are being used, then replace blank lines
# with in the actual output string.
if not (optionflags & DONT_ACCEPT_BLANKLINE):
- got = re.sub('(?m)^[ ]*(?=\n)', BLANKLINE_MARKER, got)
+ got = re.sub("(?m)^[ ]*(?=\n)", BLANKLINE_MARKER, got)
# Check if we should use diff.
if self._do_a_fancy_diff(want, got, optionflags):
@@ -1701,29 +1701,29 @@ def output_difference(self, example, got, optionflags):
if optionflags & REPORT_UDIFF:
diff = difflib.unified_diff(want_lines, got_lines, n=2)
diff = list(diff)[2:] # strip the diff header
- kind = 'unified diff with -expected +actual'
+ kind = "unified diff with -expected +actual"
elif optionflags & REPORT_CDIFF:
diff = difflib.context_diff(want_lines, got_lines, n=2)
diff = list(diff)[2:] # strip the diff header
- kind = 'context diff with expected followed by actual'
+ kind = "context diff with expected followed by actual"
elif optionflags & REPORT_NDIFF:
engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)
diff = list(engine.compare(want_lines, got_lines))
- kind = 'ndiff with -expected +actual'
+ kind = "ndiff with -expected +actual"
else:
- assert 0, 'Bad diff option'
- return 'Differences (%s):\n' % kind + _indent(''.join(diff))
+ assert 0, "Bad diff option"
+ return "Differences (%s):\n" % kind + _indent("".join(diff))
# If we're not using diff, then simply list the expected
# output followed by the actual output.
if want and got:
- return 'Expected:\n%sGot:\n%s' % (_indent(want), _indent(got))
+ return "Expected:\n%sGot:\n%s" % (_indent(want), _indent(got))
elif want:
- return 'Expected:\n%sGot nothing\n' % _indent(want)
+ return "Expected:\n%sGot nothing\n" % _indent(want)
elif got:
- return 'Expected nothing\nGot:\n%s' % _indent(got)
+ return "Expected nothing\nGot:\n%s" % _indent(got)
else:
- return 'Expected nothing\nGot nothing\n'
+ return "Expected nothing\nGot nothing\n"
class DocTestFailure(Exception):
"""A DocTest example has failed in debugging mode.
@@ -1948,7 +1948,7 @@ class doctest.Tester, then merges the results into (or creates)
# DWA - m will still be None if this wasn't invoked from the command
# line, in which case the following TypeError is about as good an error
# as we should expect
- m = sys.modules.get('__main__')
+ m = sys.modules.get("__main__")
# Check that we were actually given a module.
if not inspect.ismodule(m):
@@ -2080,8 +2080,8 @@ class doctest.Tester, then merges the results into (or creates)
globs = globs.copy()
if extraglobs is not None:
globs.update(extraglobs)
- if '__name__' not in globs:
- globs['__name__'] = '__main__'
+ if "__name__" not in globs:
+ globs["__name__"] = "__main__"
if raise_on_error:
runner = DebugRunner(verbose=verbose, optionflags=optionflags)
@@ -2223,10 +2223,10 @@ def runTest(self):
def format_failure(self, err):
test = self._dt_test
if test.lineno is None:
- lineno = 'unknown line number'
+ lineno = "unknown line number"
else:
- lineno = '%s' % test.lineno
- lname = '.'.join(test.name.split('.')[-1:])
+ lineno = "%s" % test.lineno
+ lname = ".".join(test.name.split(".")[-1:])
return ('Failed doctest test for %s\n'
' File "%s", line %s, in %s\n\n%s'
% (test.name, test.filename, lineno, lname, err)
@@ -2322,8 +2322,8 @@ def __hash__(self):
self._dt_checker))
def __repr__(self):
- name = self._dt_test.name.split('.')
- return "%s (%s)" % (name[-1], '.'.join(name[:-1]))
+ name = self._dt_test.name.split(".")
+ return "%s (%s)" % (name[-1], ".".join(name[:-1]))
__str__ = object.__str__
@@ -2420,7 +2420,7 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
class DocFileCase(DocTestCase):
def id(self):
- return '_'.join(self._dt_test.name.split('.'))
+ return "_".join(self._dt_test.name.split("."))
def __repr__(self):
return self._dt_test.filename
@@ -2517,8 +2517,8 @@ def DocFileSuite(*paths, **kw):
# We do this here so that _normalize_module is called at the right
# level. If it were called in DocFileTest, then this function
# would be the caller and we might guess the package incorrectly.
- if kw.get('module_relative', True):
- kw['package'] = _normalize_module(kw.get('package'))
+ if kw.get("module_relative", True):
+ kw["package"] = _normalize_module(kw.get("package"))
for path in paths:
suite.addTest(DocFileTest(path, **kw))
@@ -2595,21 +2595,21 @@ def script_from_examples(s):
# Add the expected output:
want = piece.want
if want:
- output.append('# Expected:')
- output += ['## '+l for l in want.split('\n')[:-1]]
+ output.append("# Expected:")
+ output += ["## "+l for l in want.split("\n")[:-1]]
else:
# Add non-example text.
output += [_comment_line(l)
- for l in piece.split('\n')[:-1]]
+ for l in piece.split("\n")[:-1]]
# Trim junk on both ends.
- while output and output[-1] == '#':
+ while output and output[-1] == "#":
output.pop()
- while output and output[0] == '#':
+ while output and output[0] == "#":
output.pop(0)
# Combine the output, and return it.
# Add a courtesy newline to prevent exec from choking (see bug #1172785)
- return '\n'.join(output) + '\n'
+ return "\n".join(output) + "\n"
def testsource(module, name):
"""Extract the test sources from a doctest docstring as a script.
@@ -2765,19 +2765,19 @@ def _test():
import argparse
parser = argparse.ArgumentParser(description="doctest runner")
- parser.add_argument('-v', '--verbose', action='store_true', default=False,
- help='print very verbose output for all tests')
- parser.add_argument('-o', '--option', action='append',
+ parser.add_argument("-v", "--verbose", action="store_true", default=False,
+ help="print very verbose output for all tests")
+ parser.add_argument("-o", "--option", action="append",
choices=OPTIONFLAGS_BY_NAME.keys(), default=[],
- help=('specify a doctest option flag to apply'
- ' to the test run; may be specified more'
- ' than once to apply multiple options'))
- parser.add_argument('-f', '--fail-fast', action='store_true',
- help=('stop running tests after first failure (this'
- ' is a shorthand for -o FAIL_FAST, and is'
- ' in addition to any other -o options)'))
- parser.add_argument('file', nargs='+',
- help='file containing the tests to run')
+ help=("specify a doctest option flag to apply"
+ " to the test run; may be specified more"
+ " than once to apply multiple options"))
+ parser.add_argument("-f", "--fail-fast", action="store_true",
+ help=("stop running tests after first failure (this"
+ " is a shorthand for -o FAIL_FAST, and is"
+ " in addition to any other -o options)"))
+ parser.add_argument("file", nargs="+",
+ help="file containing the tests to run")
args = parser.parse_args()
testfiles = args.file
# Verbose used to be handled by the "inspect argv" magic in DocTestRunner,
diff --git a/.venv3.10/Lib/email/__init__.py b/.venv3.10/Lib/email/__init__.py
index fae87243..243c51d9 100644
--- a/.venv3.10/Lib/email/__init__.py
+++ b/.venv3.10/Lib/email/__init__.py
@@ -5,27 +5,27 @@
"""A package for parsing, handling, and generating email messages."""
__all__ = [
- 'base64mime',
- 'charset',
- 'encoders',
- 'errors',
- 'feedparser',
- 'generator',
- 'header',
- 'iterators',
- 'message',
- 'message_from_file',
- 'message_from_binary_file',
- 'message_from_string',
- 'message_from_bytes',
- 'mime',
- 'parser',
- 'quoprimime',
- 'utils',
+ "base64mime",
+ "charset",
+ "encoders",
+ "errors",
+ "feedparser",
+ "generator",
+ "header",
+ "iterators",
+ "message",
+ "message_from_file",
+ "message_from_binary_file",
+ "message_from_string",
+ "message_from_bytes",
+ "mime",
+ "parser",
+ "quoprimime",
+ "utils",
]
-
+
# Some convenience routines. Don't import Parser and Message as side-effects
# of importing email since those cascadingly import most of the rest of the
# email package.
diff --git a/.venv3.10/Lib/email/_encoded_words.py b/.venv3.10/Lib/email/_encoded_words.py
index 6795a606..de1fb13b 100644
--- a/.venv3.10/Lib/email/_encoded_words.py
+++ b/.venv3.10/Lib/email/_encoded_words.py
@@ -46,14 +46,14 @@
from string import ascii_letters, digits
from email import errors
-__all__ = ['decode_q',
- 'encode_q',
- 'decode_b',
- 'encode_b',
- 'len_q',
- 'len_b',
- 'decode',
- 'encode',
+__all__ = ["decode_q",
+ "encode_q",
+ "decode_b",
+ "encode_b",
+ "len_q",
+ "len_b",
+ "decode",
+ "encode",
]
#
@@ -61,18 +61,18 @@
#
# regex based decoder.
-_q_byte_subber = functools.partial(re.compile(br'=([a-fA-F0-9]{2})').sub,
+_q_byte_subber = functools.partial(re.compile(br"=([a-fA-F0-9]{2})").sub,
lambda m: bytes.fromhex(m.group(1).decode()))
def decode_q(encoded):
- encoded = encoded.replace(b'_', b' ')
+ encoded = encoded.replace(b"_", b" ")
return _q_byte_subber(encoded), []
# dict mapping bytes to their encoded form
class _QByteMap(dict):
- safe = b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii')
+ safe = b"-!*+/" + ascii_letters.encode("ascii") + digits.encode("ascii")
def __missing__(self, key):
if key in self.safe:
@@ -84,10 +84,10 @@ def __missing__(self, key):
_q_byte_map = _QByteMap()
# In headers spaces are mapped to '_'.
-_q_byte_map[ord(' ')] = '_'
+_q_byte_map[ord(" ")] = "_"
def encode_q(bstring):
- return ''.join(_q_byte_map[x] for x in bstring)
+ return "".join(_q_byte_map[x] for x in bstring)
def len_q(bstring):
return sum(len(_q_byte_map[x]) for x in bstring)
@@ -101,7 +101,7 @@ def decode_b(encoded):
# First try encoding with validate=True, fixing the padding if needed.
# This will succeed only if encoded includes no invalid characters.
pad_err = len(encoded) % 4
- missing_padding = b'==='[:4-pad_err] if pad_err else b''
+ missing_padding = b"==="[:4-pad_err] if pad_err else b""
try:
return (
base64.b64decode(encoded + missing_padding, validate=True),
@@ -123,7 +123,7 @@ def decode_b(encoded):
# is ignored).
try:
return (
- base64.b64decode(encoded + b'==', validate=False),
+ base64.b64decode(encoded + b"==", validate=False),
[errors.InvalidBase64CharactersDefect(),
errors.InvalidBase64PaddingDefect()],
)
@@ -136,7 +136,7 @@ def decode_b(encoded):
return encoded, [errors.InvalidBase64LengthDefect()]
def encode_b(bstring):
- return base64.b64encode(bstring).decode('ascii')
+ return base64.b64encode(bstring).decode("ascii")
def len_b(bstring):
groups_of_3, leftover = divmod(len(bstring), 3)
@@ -145,8 +145,8 @@ def len_b(bstring):
_cte_decoders = {
- 'q': decode_q,
- 'b': decode_b,
+ "q": decode_q,
+ "b": decode_b,
}
def decode(ew):
@@ -170,11 +170,11 @@ def decode(ew):
which is rarely if ever encountered, is the empty string.
"""
- _, charset, cte, cte_string, _ = ew.split('?')
- charset, _, lang = charset.partition('*')
+ _, charset, cte, cte_string, _ = ew.split("?")
+ charset, _, lang = charset.partition("*")
cte = cte.lower()
# Recover the original bytes and do CTE decoding.
- bstring = cte_string.encode('ascii', 'surrogateescape')
+ bstring = cte_string.encode("ascii", "surrogateescape")
bstring, defects = _cte_decoders[cte](bstring)
# Turn the CTE decoded bytes into unicode.
try:
@@ -182,26 +182,26 @@ def decode(ew):
except UnicodeDecodeError:
defects.append(errors.UndecodableBytesDefect("Encoded word "
f"contains bytes not decodable using {charset!r} charset"))
- string = bstring.decode(charset, 'surrogateescape')
+ string = bstring.decode(charset, "surrogateescape")
except (LookupError, UnicodeEncodeError):
- string = bstring.decode('ascii', 'surrogateescape')
- if charset.lower() != 'unknown-8bit':
+ string = bstring.decode("ascii", "surrogateescape")
+ if charset.lower() != "unknown-8bit":
defects.append(errors.CharsetError(f"Unknown charset {charset!r} "
f"in encoded word; decoded as unknown bytes"))
return string, charset, lang, defects
_cte_encoders = {
- 'q': encode_q,
- 'b': encode_b,
+ "q": encode_q,
+ "b": encode_b,
}
_cte_encode_length = {
- 'q': len_q,
- 'b': len_b,
+ "q": len_q,
+ "b": len_b,
}
-def encode(string, charset='utf-8', encoding=None, lang=''):
+def encode(string, charset="utf-8", encoding=None, lang=""):
"""Encode string using the CTE encoding that produces the shorter result.
Produces an RFC 2047/2243 encoded word of the form:
@@ -218,16 +218,16 @@ def encode(string, charset='utf-8', encoding=None, lang=''):
RFC 2243 language string to specify in the encoded word.
"""
- if charset == 'unknown-8bit':
- bstring = string.encode('ascii', 'surrogateescape')
+ if charset == "unknown-8bit":
+ bstring = string.encode("ascii", "surrogateescape")
else:
bstring = string.encode(charset)
if encoding is None:
- qlen = _cte_encode_length['q'](bstring)
- blen = _cte_encode_length['b'](bstring)
+ qlen = _cte_encode_length["q"](bstring)
+ blen = _cte_encode_length["b"](bstring)
# Bias toward q. 5 is arbitrary.
- encoding = 'q' if qlen - blen < 5 else 'b'
+ encoding = "q" if qlen - blen < 5 else "b"
encoded = _cte_encoders[encoding](bstring)
if lang:
- lang = '*' + lang
+ lang = "*" + lang
return "=?{}{}?{}?{}?=".format(charset, lang, encoding, encoded)
diff --git a/.venv3.10/Lib/email/_header_value_parser.py b/.venv3.10/Lib/email/_header_value_parser.py
index dbc0bd81..d305995b 100644
--- a/.venv3.10/Lib/email/_header_value_parser.py
+++ b/.venv3.10/Lib/email/_header_value_parser.py
@@ -80,25 +80,25 @@
# Useful constants and functions
#
-WSP = set(' \t')
-CFWS_LEADER = WSP | set('(')
+WSP = set(" \t")
+CFWS_LEADER = WSP | set("(")
SPECIALS = set(r'()<>@,:;.\"[]')
ATOM_ENDS = SPECIALS | WSP
-DOT_ATOM_ENDS = ATOM_ENDS - set('.')
+DOT_ATOM_ENDS = ATOM_ENDS - set(".")
# '.', '"', and '(' do not end phrases in order to support obs-phrase
PHRASE_ENDS = SPECIALS - set('."(')
-TSPECIALS = (SPECIALS | set('/?=')) - set('.')
+TSPECIALS = (SPECIALS | set("/?=")) - set(".")
TOKEN_ENDS = TSPECIALS | WSP
ASPECIALS = TSPECIALS | set("*'%")
ATTRIBUTE_ENDS = ASPECIALS | WSP
-EXTENDED_ATTRIBUTE_ENDS = ATTRIBUTE_ENDS - set('%')
-NLSET = {'\n', '\r'}
+EXTENDED_ATTRIBUTE_ENDS = ATTRIBUTE_ENDS - set("%")
+NLSET = {"\n", "\r"}
SPECIALSNL = SPECIALS | NLSET
def make_quoted_pairs(value):
"""Escape dquote and backslash for use within a quoted-string."""
- return str(value).replace('\\', '\\\\').replace('"', '\\"')
+ return str(value).replace("\\", "\\\\").replace('"', '\\"')
def quote_string(value):
@@ -107,7 +107,7 @@ def quote_string(value):
# Match a RFC 2047 word, looks like =?utf-8?q?someword?=
-rfc2047_matcher = re.compile(r'''
+rfc2047_matcher = re.compile(r"""
=\? # literal =?
[^?]* # charset
\? # literal ?
@@ -115,7 +115,7 @@ def quote_string(value):
\? # literal ?
.*? # encoded word
\?= # literal ?=
-''', re.VERBOSE | re.MULTILINE)
+""", re.VERBOSE | re.MULTILINE)
#
@@ -133,15 +133,15 @@ def __init__(self, *args, **kw):
self.defects = []
def __str__(self):
- return ''.join(str(x) for x in self)
+ return "".join(str(x) for x in self)
def __repr__(self):
- return '{}({})'.format(self.__class__.__name__,
+ return "{}({})".format(self.__class__.__name__,
super().__repr__())
@property
def value(self):
- return ''.join(x.value for x in self if x.value)
+ return "".join(x.value for x in self if x.value)
@property
def all_defects(self):
@@ -165,67 +165,67 @@ def comments(self):
def fold(self, *, policy):
return _refold_parse_tree(self, policy=policy)
- def pprint(self, indent=''):
+ def pprint(self, indent=""):
print(self.ppstr(indent=indent))
- def ppstr(self, indent=''):
- return '\n'.join(self._pp(indent=indent))
+ def ppstr(self, indent=""):
+ return "\n".join(self._pp(indent=indent))
- def _pp(self, indent=''):
- yield '{}{}/{}('.format(
+ def _pp(self, indent=""):
+ yield "{}{}/{}(".format(
indent,
self.__class__.__name__,
self.token_type)
for token in self:
- if not hasattr(token, '_pp'):
- yield (indent + ' !! invalid element in token '
- 'list: {!r}'.format(token))
+ if not hasattr(token, "_pp"):
+ yield (indent + " !! invalid element in token "
+ "list: {!r}".format(token))
else:
- yield from token._pp(indent+' ')
+ yield from token._pp(indent+" ")
if self.defects:
- extra = ' Defects: {}'.format(self.defects)
+ extra = " Defects: {}".format(self.defects)
else:
- extra = ''
- yield '{}){}'.format(indent, extra)
+ extra = ""
+ yield "{}){}".format(indent, extra)
class WhiteSpaceTokenList(TokenList):
@property
def value(self):
- return ' '
+ return " "
@property
def comments(self):
- return [x.content for x in self if x.token_type=='comment']
+ return [x.content for x in self if x.token_type=="comment"]
class UnstructuredTokenList(TokenList):
- token_type = 'unstructured'
+ token_type = "unstructured"
class Phrase(TokenList):
- token_type = 'phrase'
+ token_type = "phrase"
class Word(TokenList):
- token_type = 'word'
+ token_type = "word"
class CFWSList(WhiteSpaceTokenList):
- token_type = 'cfws'
+ token_type = "cfws"
class Atom(TokenList):
- token_type = 'atom'
+ token_type = "atom"
class Token(TokenList):
- token_type = 'token'
+ token_type = "token"
encode_as_ew = False
class EncodedWord(TokenList):
- token_type = 'encoded-word'
+ token_type = "encoded-word"
cte = None
charset = None
lang = None
@@ -233,64 +233,64 @@ class EncodedWord(TokenList):
class QuotedString(TokenList):
- token_type = 'quoted-string'
+ token_type = "quoted-string"
@property
def content(self):
for x in self:
- if x.token_type == 'bare-quoted-string':
+ if x.token_type == "bare-quoted-string":
return x.value
@property
def quoted_value(self):
res = []
for x in self:
- if x.token_type == 'bare-quoted-string':
+ if x.token_type == "bare-quoted-string":
res.append(str(x))
else:
res.append(x.value)
- return ''.join(res)
+ return "".join(res)
@property
def stripped_value(self):
for token in self:
- if token.token_type == 'bare-quoted-string':
+ if token.token_type == "bare-quoted-string":
return token.value
class BareQuotedString(QuotedString):
- token_type = 'bare-quoted-string'
+ token_type = "bare-quoted-string"
def __str__(self):
- return quote_string(''.join(str(x) for x in self))
+ return quote_string("".join(str(x) for x in self))
@property
def value(self):
- return ''.join(str(x) for x in self)
+ return "".join(str(x) for x in self)
class Comment(WhiteSpaceTokenList):
- token_type = 'comment'
+ token_type = "comment"
def __str__(self):
- return ''.join(sum([
+ return "".join(sum([
["("],
[self.quote(x) for x in self],
[")"],
], []))
def quote(self, value):
- if value.token_type == 'comment':
+ if value.token_type == "comment":
return str(value)
- return str(value).replace('\\', '\\\\').replace(
- '(', r'\(').replace(
- ')', r'\)')
+ return str(value).replace("\\", "\\\\").replace(
+ "(", r"\(").replace(
+ ")", r"\)")
@property
def content(self):
- return ''.join(str(x) for x in self)
+ return "".join(str(x) for x in self)
@property
def comments(self):
@@ -298,75 +298,75 @@ def comments(self):
class AddressList(TokenList):
- token_type = 'address-list'
+ token_type = "address-list"
@property
def addresses(self):
- return [x for x in self if x.token_type=='address']
+ return [x for x in self if x.token_type=="address"]
@property
def mailboxes(self):
return sum((x.mailboxes
- for x in self if x.token_type=='address'), [])
+ for x in self if x.token_type=="address"), [])
@property
def all_mailboxes(self):
return sum((x.all_mailboxes
- for x in self if x.token_type=='address'), [])
+ for x in self if x.token_type=="address"), [])
class Address(TokenList):
- token_type = 'address'
+ token_type = "address"
@property
def display_name(self):
- if self[0].token_type == 'group':
+ if self[0].token_type == "group":
return self[0].display_name
@property
def mailboxes(self):
- if self[0].token_type == 'mailbox':
+ if self[0].token_type == "mailbox":
return [self[0]]
- elif self[0].token_type == 'invalid-mailbox':
+ elif self[0].token_type == "invalid-mailbox":
return []
return self[0].mailboxes
@property
def all_mailboxes(self):
- if self[0].token_type == 'mailbox':
+ if self[0].token_type == "mailbox":
return [self[0]]
- elif self[0].token_type == 'invalid-mailbox':
+ elif self[0].token_type == "invalid-mailbox":
return [self[0]]
return self[0].all_mailboxes
class MailboxList(TokenList):
- token_type = 'mailbox-list'
+ token_type = "mailbox-list"
@property
def mailboxes(self):
- return [x for x in self if x.token_type=='mailbox']
+ return [x for x in self if x.token_type=="mailbox"]
@property
def all_mailboxes(self):
return [x for x in self
- if x.token_type in ('mailbox', 'invalid-mailbox')]
+ if x.token_type in ("mailbox", "invalid-mailbox")]
class GroupList(TokenList):
- token_type = 'group-list'
+ token_type = "group-list"
@property
def mailboxes(self):
- if not self or self[0].token_type != 'mailbox-list':
+ if not self or self[0].token_type != "mailbox-list":
return []
return self[0].mailboxes
@property
def all_mailboxes(self):
- if not self or self[0].token_type != 'mailbox-list':
+ if not self or self[0].token_type != "mailbox-list":
return []
return self[0].all_mailboxes
@@ -377,13 +377,13 @@ class Group(TokenList):
@property
def mailboxes(self):
- if self[2].token_type != 'group-list':
+ if self[2].token_type != "group-list":
return []
return self[2].mailboxes
@property
def all_mailboxes(self):
- if self[2].token_type != 'group-list':
+ if self[2].token_type != "group-list":
return []
return self[2].all_mailboxes
@@ -394,7 +394,7 @@ def display_name(self):
class NameAddr(TokenList):
- token_type = 'name-addr'
+ token_type = "name-addr"
@property
def display_name(self):
@@ -421,54 +421,54 @@ def addr_spec(self):
class AngleAddr(TokenList):
- token_type = 'angle-addr'
+ token_type = "angle-addr"
@property
def local_part(self):
for x in self:
- if x.token_type == 'addr-spec':
+ if x.token_type == "addr-spec":
return x.local_part
@property
def domain(self):
for x in self:
- if x.token_type == 'addr-spec':
+ if x.token_type == "addr-spec":
return x.domain
@property
def route(self):
for x in self:
- if x.token_type == 'obs-route':
+ if x.token_type == "obs-route":
return x.domains
@property
def addr_spec(self):
for x in self:
- if x.token_type == 'addr-spec':
+ if x.token_type == "addr-spec":
if x.local_part:
return x.addr_spec
else:
return quote_string(x.local_part) + x.addr_spec
else:
- return '<>'
+ return "<>"
class ObsRoute(TokenList):
- token_type = 'obs-route'
+ token_type = "obs-route"
@property
def domains(self):
- return [x.domain for x in self if x.token_type == 'domain']
+ return [x.domain for x in self if x.token_type == "domain"]
class Mailbox(TokenList):
- token_type = 'mailbox'
+ token_type = "mailbox"
@property
def display_name(self):
- if self[0].token_type == 'name-addr':
+ if self[0].token_type == "name-addr":
return self[0].display_name
@property
@@ -481,7 +481,7 @@ def domain(self):
@property
def route(self):
- if self[0].token_type == 'name-addr':
+ if self[0].token_type == "name-addr":
return self[0].route
@property
@@ -491,7 +491,7 @@ def addr_spec(self):
class InvalidMailbox(TokenList):
- token_type = 'invalid-mailbox'
+ token_type = "invalid-mailbox"
@property
def display_name(self):
@@ -502,31 +502,31 @@ def display_name(self):
class Domain(TokenList):
- token_type = 'domain'
+ token_type = "domain"
as_ew_allowed = False
@property
def domain(self):
- return ''.join(super().value.split())
+ return "".join(super().value.split())
class DotAtom(TokenList):
- token_type = 'dot-atom'
+ token_type = "dot-atom"
class DotAtomText(TokenList):
- token_type = 'dot-atom-text'
+ token_type = "dot-atom-text"
as_ew_allowed = True
class NoFoldLiteral(TokenList):
- token_type = 'no-fold-literal'
+ token_type = "no-fold-literal"
as_ew_allowed = False
class AddrSpec(TokenList):
- token_type = 'addr-spec'
+ token_type = "addr-spec"
as_ew_allowed = False
@property
@@ -553,19 +553,19 @@ def addr_spec(self):
else:
lp = self.local_part
if self.domain is not None:
- return lp + '@' + self.domain
+ return lp + "@" + self.domain
return lp
class ObsLocalPart(TokenList):
- token_type = 'obs-local-part'
+ token_type = "obs-local-part"
as_ew_allowed = False
class DisplayName(Phrase):
- token_type = 'display-name'
+ token_type = "display-name"
ew_combine_allowed = False
@property
@@ -573,15 +573,15 @@ def display_name(self):
res = TokenList(self)
if len(res) == 0:
return res.value
- if res[0].token_type == 'cfws':
+ if res[0].token_type == "cfws":
res.pop(0)
else:
- if res[0][0].token_type == 'cfws':
+ if res[0][0].token_type == "cfws":
res[0] = TokenList(res[0][1:])
- if res[-1].token_type == 'cfws':
+ if res[-1].token_type == "cfws":
res.pop()
else:
- if res[-1][-1].token_type == 'cfws':
+ if res[-1][-1].token_type == "cfws":
res[-1] = TokenList(res[-1][:-1])
return res.value
@@ -592,14 +592,14 @@ def value(self):
quote = True
else:
for x in self:
- if x.token_type == 'quoted-string':
+ if x.token_type == "quoted-string":
quote = True
if len(self) != 0 and quote:
- pre = post = ''
- if self[0].token_type=='cfws' or self[0][0].token_type=='cfws':
- pre = ' '
- if self[-1].token_type=='cfws' or self[-1][-1].token_type=='cfws':
- post = ' '
+ pre = post = ""
+ if self[0].token_type=="cfws" or self[0][0].token_type=="cfws":
+ pre = " "
+ if self[-1].token_type=="cfws" or self[-1][-1].token_type=="cfws":
+ post = " "
return pre+quote_string(self.display_name)+post
else:
return super().value
@@ -607,7 +607,7 @@ def value(self):
class LocalPart(TokenList):
- token_type = 'local-part'
+ token_type = "local-part"
as_ew_allowed = False
@property
@@ -624,14 +624,14 @@ def local_part(self):
last = DOT
last_is_tl = False
for tok in self[0] + [DOT]:
- if tok.token_type == 'cfws':
+ if tok.token_type == "cfws":
continue
- if (last_is_tl and tok.token_type == 'dot' and
- last[-1].token_type == 'cfws'):
+ if (last_is_tl and tok.token_type == "dot" and
+ last[-1].token_type == "cfws"):
res[-1] = TokenList(last[:-1])
is_tl = isinstance(tok, TokenList)
- if (is_tl and last.token_type == 'dot' and
- tok[0].token_type == 'cfws'):
+ if (is_tl and last.token_type == "dot" and
+ tok[0].token_type == "cfws"):
res.append(TokenList(tok[1:]))
else:
res.append(tok)
@@ -643,33 +643,33 @@ def local_part(self):
class DomainLiteral(TokenList):
- token_type = 'domain-literal'
+ token_type = "domain-literal"
as_ew_allowed = False
@property
def domain(self):
- return ''.join(super().value.split())
+ return "".join(super().value.split())
@property
def ip(self):
for x in self:
- if x.token_type == 'ptext':
+ if x.token_type == "ptext":
return x.value
class MIMEVersion(TokenList):
- token_type = 'mime-version'
+ token_type = "mime-version"
major = None
minor = None
class Parameter(TokenList):
- token_type = 'parameter'
+ token_type = "parameter"
sectioned = False
extended = False
- charset = 'us-ascii'
+ charset = "us-ascii"
@property
def section_number(self):
@@ -681,56 +681,56 @@ def section_number(self):
def param_value(self):
# This is part of the "handle quoted extended parameters" hack.
for token in self:
- if token.token_type == 'value':
+ if token.token_type == "value":
return token.stripped_value
- if token.token_type == 'quoted-string':
+ if token.token_type == "quoted-string":
for token in token:
- if token.token_type == 'bare-quoted-string':
+ if token.token_type == "bare-quoted-string":
for token in token:
- if token.token_type == 'value':
+ if token.token_type == "value":
return token.stripped_value
- return ''
+ return ""
class InvalidParameter(Parameter):
- token_type = 'invalid-parameter'
+ token_type = "invalid-parameter"
class Attribute(TokenList):
- token_type = 'attribute'
+ token_type = "attribute"
@property
def stripped_value(self):
for token in self:
- if token.token_type.endswith('attrtext'):
+ if token.token_type.endswith("attrtext"):
return token.value
class Section(TokenList):
- token_type = 'section'
+ token_type = "section"
number = None
class Value(TokenList):
- token_type = 'value'
+ token_type = "value"
@property
def stripped_value(self):
token = self[0]
- if token.token_type == 'cfws':
+ if token.token_type == "cfws":
token = self[1]
if token.token_type.endswith(
- ('quoted-string', 'attribute', 'extended-attribute')):
+ ("quoted-string", "attribute", "extended-attribute")):
return token.stripped_value
return self.value
class MimeParameters(TokenList):
- token_type = 'mime-parameters'
+ token_type = "mime-parameters"
syntactic_break = False
@property
@@ -742,9 +742,9 @@ def params(self):
# us a stable __str__.
params = {} # Using order preserving dict from Python 3.7+
for token in self:
- if not token.token_type.endswith('parameter'):
+ if not token.token_type.endswith("parameter"):
continue
- if token[0].token_type != 'attribute':
+ if token[0].token_type != "attribute":
continue
name = token[0].value.strip()
if name not in params:
@@ -760,7 +760,7 @@ def params(self):
if not first_param.extended and len(parts) > 1:
if parts[1][0] == 0:
parts[1][1].defects.append(errors.InvalidHeaderDefect(
- 'duplicate parameter name; duplicate(s) ignored'))
+ "duplicate parameter name; duplicate(s) ignored"))
parts = parts[:1]
# Else assume the *0* was missing...note that this is different
# from get_param, but we registered a defect for this earlier.
@@ -773,7 +773,7 @@ def params(self):
# seen. But we're not doing that. The old code didn't.
if not param.extended:
param.defects.append(errors.InvalidHeaderDefect(
- 'duplicate parameter name; duplicate ignored'))
+ "duplicate parameter name; duplicate ignored"))
continue
else:
param.defects.append(errors.InvalidHeaderDefect(
@@ -787,31 +787,31 @@ def params(self):
# source had surrogate escaped bytes. What we do now
# is a bit of an open question. I'm not sure this is
# the best choice, but it is what the old algorithm did
- value = urllib.parse.unquote(value, encoding='latin-1')
+ value = urllib.parse.unquote(value, encoding="latin-1")
else:
try:
- value = value.decode(charset, 'surrogateescape')
+ value = value.decode(charset, "surrogateescape")
except (LookupError, UnicodeEncodeError):
# XXX: there should really be a custom defect for
# unknown character set to make it easy to find,
# because otherwise unknown charset is a silent
# failure.
- value = value.decode('us-ascii', 'surrogateescape')
+ value = value.decode("us-ascii", "surrogateescape")
if utils._has_surrogates(value):
param.defects.append(errors.UndecodableBytesDefect())
value_parts.append(value)
- value = ''.join(value_parts)
+ value = "".join(value_parts)
yield name, value
def __str__(self):
params = []
for name, value in self.params:
if value:
- params.append('{}={}'.format(name, quote_string(value)))
+ params.append("{}={}".format(name, quote_string(value)))
else:
params.append(name)
- params = '; '.join(params)
- return ' ' + params if params else ''
+ params = "; ".join(params)
+ return " " + params if params else ""
class ParameterizedHeaderValue(TokenList):
@@ -823,37 +823,37 @@ class ParameterizedHeaderValue(TokenList):
@property
def params(self):
for token in reversed(self):
- if token.token_type == 'mime-parameters':
+ if token.token_type == "mime-parameters":
return token.params
return {}
class ContentType(ParameterizedHeaderValue):
- token_type = 'content-type'
+ token_type = "content-type"
as_ew_allowed = False
- maintype = 'text'
- subtype = 'plain'
+ maintype = "text"
+ subtype = "plain"
class ContentDisposition(ParameterizedHeaderValue):
- token_type = 'content-disposition'
+ token_type = "content-disposition"
as_ew_allowed = False
content_disposition = None
class ContentTransferEncoding(TokenList):
- token_type = 'content-transfer-encoding'
+ token_type = "content-transfer-encoding"
as_ew_allowed = False
- cte = '7bit'
+ cte = "7bit"
class HeaderLabel(TokenList):
- token_type = 'header-label'
+ token_type = "header-label"
as_ew_allowed = False
class MsgID(TokenList):
- token_type = 'msg-id'
+ token_type = "msg-id"
as_ew_allowed = False
def fold(self, policy):
@@ -862,15 +862,15 @@ def fold(self, policy):
class MessageID(MsgID):
- token_type = 'message-id'
+ token_type = "message-id"
class InvalidMessageID(MessageID):
- token_type = 'invalid-message-id'
+ token_type = "invalid-message-id"
class Header(TokenList):
- token_type = 'header'
+ token_type = "header"
#
@@ -893,19 +893,19 @@ def __repr__(self):
return "{}({})".format(self.__class__.__name__, super().__repr__())
def pprint(self):
- print(self.__class__.__name__ + '/' + self.token_type)
+ print(self.__class__.__name__ + "/" + self.token_type)
@property
def all_defects(self):
return list(self.defects)
- def _pp(self, indent=''):
+ def _pp(self, indent=""):
return ["{}{}/{}({}){}".format(
indent,
self.__class__.__name__,
self.token_type,
super().__repr__(),
- '' if not self.defects else ' {}'.format(self.defects),
+ "" if not self.defects else " {}".format(self.defects),
)]
def pop_trailing_ws(self):
@@ -924,7 +924,7 @@ class WhiteSpaceTerminal(Terminal):
@property
def value(self):
- return ' '
+ return " "
def startswith_fws(self):
return True
@@ -944,10 +944,10 @@ class EWWhiteSpaceTerminal(WhiteSpaceTerminal):
@property
def value(self):
- return ''
+ return ""
def __str__(self):
- return ''
+ return ""
class _InvalidEwError(errors.HeaderParseError):
@@ -957,9 +957,9 @@ class _InvalidEwError(errors.HeaderParseError):
# XXX these need to become classes and used as instances so
# that a program can't change them in a parse tree and screw
# up other parse trees. Maybe should have tests for that, too.
-DOT = ValueTerminal('.', 'dot')
-ListSeparator = ValueTerminal(',', 'list-separator')
-RouteComponentMarker = ValueTerminal('@', 'route-component-marker')
+DOT = ValueTerminal(".", "dot")
+ListSeparator = ValueTerminal(",", "list-separator")
+RouteComponentMarker = ValueTerminal("@", "route-component-marker")
#
# Parser
@@ -982,16 +982,16 @@ class _InvalidEwError(errors.HeaderParseError):
# returns the complete phrase from the start of the string value, plus any
# characters left in the string after the phrase is removed.
-_wsp_splitter = re.compile(r'([{}]+)'.format(''.join(WSP))).split
+_wsp_splitter = re.compile(r"([{}]+)".format("".join(WSP))).split
_non_atom_end_matcher = re.compile(r"[^{}]+".format(
- re.escape(''.join(ATOM_ENDS)))).match
+ re.escape("".join(ATOM_ENDS)))).match
_non_printable_finder = re.compile(r"[\x00-\x20\x7F]").findall
_non_token_end_matcher = re.compile(r"[^{}]+".format(
- re.escape(''.join(TOKEN_ENDS)))).match
+ re.escape("".join(TOKEN_ENDS)))).match
_non_attribute_end_matcher = re.compile(r"[^{}]+".format(
- re.escape(''.join(ATTRIBUTE_ENDS)))).match
+ re.escape("".join(ATTRIBUTE_ENDS)))).match
_non_extended_attribute_end_matcher = re.compile(r"[^{}]+".format(
- re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match
+ re.escape("".join(EXTENDED_ATTRIBUTE_ENDS)))).match
def _validate_xtext(xtext):
"""If input token contains ASCII non-printables, register a defect."""
@@ -1017,7 +1017,7 @@ def _get_ptext_to_endchars(value, endchars):
escape = False
had_qp = False
for pos in range(len(fragment)):
- if fragment[pos] == '\\':
+ if fragment[pos] == "\\":
if escape:
escape = False
had_qp = True
@@ -1031,7 +1031,7 @@ def _get_ptext_to_endchars(value, endchars):
vchars.append(fragment[pos])
else:
pos = pos + 1
- return ''.join(vchars), ''.join([fragment[pos:]] + remainder), had_qp
+ return "".join(vchars), "".join([fragment[pos:]] + remainder), had_qp
def get_fws(value):
"""FWS = 1*WSP
@@ -1042,36 +1042,36 @@ def get_fws(value):
"""
newvalue = value.lstrip()
- fws = WhiteSpaceTerminal(value[:len(value)-len(newvalue)], 'fws')
+ fws = WhiteSpaceTerminal(value[:len(value)-len(newvalue)], "fws")
return fws, newvalue
-def get_encoded_word(value, terminal_type='vtext'):
+def get_encoded_word(value, terminal_type="vtext"):
""" encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
"""
ew = EncodedWord()
- if not value.startswith('=?'):
+ if not value.startswith("=?"):
raise errors.HeaderParseError(
"expected encoded word but found {}".format(value))
- tok, *remainder = value[2:].split('?=', 1)
+ tok, *remainder = value[2:].split("?=", 1)
if tok == value[2:]:
raise errors.HeaderParseError(
"expected encoded word but found {}".format(value))
- remstr = ''.join(remainder)
+ remstr = "".join(remainder)
if (len(remstr) > 1 and
remstr[0] in hexdigits and
remstr[1] in hexdigits and
- tok.count('?') < 2):
+ tok.count("?") < 2):
# The ? after the CTE was followed by an encoded word escape (=XX).
- rest, *remainder = remstr.split('?=', 1)
- tok = tok + '?=' + rest
+ rest, *remainder = remstr.split("?=", 1)
+ tok = tok + "?=" + rest
if len(tok.split()) > 1:
ew.defects.append(errors.InvalidHeaderDefect(
"whitespace inside encoded word"))
ew.cte = value
- value = ''.join(remainder)
+ value = "".join(remainder)
try:
- text, charset, lang, defects = _ew.decode('=?' + tok + '?=')
+ text, charset, lang, defects = _ew.decode("=?" + tok + "?=")
except (ValueError, KeyError):
raise _InvalidEwError(
"encoded word format invalid: '{}'".format(ew.cte))
@@ -1087,7 +1087,7 @@ def get_encoded_word(value, terminal_type='vtext'):
vtext = ValueTerminal(chars, terminal_type)
_validate_xtext(vtext)
ew.append(vtext)
- text = ''.join(remainder)
+ text = "".join(remainder)
# Encoded words should be followed by a WS
if value and value[0] not in WSP:
ew.defects.append(errors.InvalidHeaderDefect(
@@ -1124,9 +1124,9 @@ def get_unstructured(value):
unstructured.append(token)
continue
valid_ew = True
- if value.startswith('=?'):
+ if value.startswith("=?"):
try:
- token, value = get_encoded_word(value, 'utext')
+ token, value = get_encoded_word(value, "utext")
except _InvalidEwError:
valid_ew = False
except errors.HeaderParseError:
@@ -1136,14 +1136,14 @@ def get_unstructured(value):
else:
have_ws = True
if len(unstructured) > 0:
- if unstructured[-1].token_type != 'fws':
+ if unstructured[-1].token_type != "fws":
unstructured.defects.append(errors.InvalidHeaderDefect(
"missing whitespace before encoded word"))
have_ws = False
if have_ws and len(unstructured) > 1:
- if unstructured[-2].token_type == 'encoded-word':
+ if unstructured[-2].token_type == "encoded-word":
unstructured[-1] = EWWhiteSpaceTerminal(
- unstructured[-1], 'fws')
+ unstructured[-1], "fws")
unstructured.append(token)
continue
tok, *remainder = _wsp_splitter(value, 1)
@@ -1154,11 +1154,11 @@ def get_unstructured(value):
# otherwise, performing it on an invalid encoded word can cause
# the parser to go in an infinite loop.
if valid_ew and rfc2047_matcher.search(tok):
- tok, *remainder = value.partition('=?')
- vtext = ValueTerminal(tok, 'utext')
+ tok, *remainder = value.partition("=?")
+ vtext = ValueTerminal(tok, "utext")
_validate_xtext(vtext)
unstructured.append(vtext)
- value = ''.join(remainder)
+ value = "".join(remainder)
return unstructured
def get_qp_ctext(value):
@@ -1173,8 +1173,8 @@ def get_qp_ctext(value):
is ' '.
"""
- ptext, value, _ = _get_ptext_to_endchars(value, '()')
- ptext = WhiteSpaceTerminal(ptext, 'ptext')
+ ptext, value, _ = _get_ptext_to_endchars(value, "()")
+ ptext = WhiteSpaceTerminal(ptext, "ptext")
_validate_xtext(ptext)
return ptext, value
@@ -1189,7 +1189,7 @@ def get_qcontent(value):
"""
ptext, value, _ = _get_ptext_to_endchars(value, '"')
- ptext = ValueTerminal(ptext, 'ptext')
+ ptext = ValueTerminal(ptext, "ptext")
_validate_xtext(ptext)
return ptext, value
@@ -1205,7 +1205,7 @@ def get_atext(value):
"expected atext but found '{}'".format(value))
atext = m.group()
value = value[len(atext):]
- atext = ValueTerminal(atext, 'atext')
+ atext = ValueTerminal(atext, "atext")
_validate_xtext(atext)
return atext, value
@@ -1227,7 +1227,7 @@ def get_bare_quoted_string(value):
while value and value[0] != '"':
if value[0] in WSP:
token, value = get_fws(value)
- elif value[:2] == '=?':
+ elif value[:2] == "=?":
valid_ew = False
try:
token, value = get_encoded_word(value)
@@ -1239,10 +1239,10 @@ def get_bare_quoted_string(value):
# Collapse the whitespace between two encoded words that occur in a
# bare-quoted-string.
if valid_ew and len(bare_quoted_string) > 1:
- if (bare_quoted_string[-1].token_type == 'fws' and
- bare_quoted_string[-2].token_type == 'encoded-word'):
+ if (bare_quoted_string[-1].token_type == "fws" and
+ bare_quoted_string[-2].token_type == "encoded-word"):
bare_quoted_string[-1] = EWWhiteSpaceTerminal(
- bare_quoted_string[-1], 'fws')
+ bare_quoted_string[-1], "fws")
else:
token, value = get_qcontent(value)
bare_quoted_string.append(token)
@@ -1258,7 +1258,7 @@ def get_comment(value):
We handle nested comments here, and quoted-pair in our qp-ctext routine.
"""
- if value and value[0] != '(':
+ if value and value[0] != "(":
raise errors.HeaderParseError(
"expected '(' but found '{}'".format(value))
comment = Comment()
@@ -1266,7 +1266,7 @@ def get_comment(value):
while value and value[0] != ")":
if value[0] in WSP:
token, value = get_fws(value)
- elif value[0] == '(':
+ elif value[0] == "(":
token, value = get_comment(value)
else:
token, value = get_qp_ctext(value)
@@ -1320,7 +1320,7 @@ def get_atom(value):
if value and value[0] in ATOM_ENDS:
raise errors.HeaderParseError(
"expected atom but found '{}'".format(value))
- if value.startswith('=?'):
+ if value.startswith("=?"):
try:
token, value = get_encoded_word(value)
except errors.HeaderParseError:
@@ -1346,12 +1346,12 @@ def get_dot_atom_text(value):
while value and value[0] not in ATOM_ENDS:
token, value = get_atext(value)
dot_atom_text.append(token)
- if value and value[0] == '.':
+ if value and value[0] == ".":
dot_atom_text.append(DOT)
value = value[1:]
if dot_atom_text[-1] is DOT:
raise errors.HeaderParseError("expected atom at end of dot-atom-text "
- "but found '{}'".format('.'+value))
+ "but found '{}'".format("."+value))
return dot_atom_text, value
def get_dot_atom(value):
@@ -1364,7 +1364,7 @@ def get_dot_atom(value):
if value[0] in CFWS_LEADER:
token, value = get_cfws(value)
dot_atom.append(token)
- if value.startswith('=?'):
+ if value.startswith("=?"):
try:
token, value = get_encoded_word(value)
except errors.HeaderParseError:
@@ -1433,7 +1433,7 @@ def get_phrase(value):
phrase.defects.append(errors.InvalidHeaderDefect(
"phrase does not start with word"))
while value and value[0] not in PHRASE_ENDS:
- if value[0]=='.':
+ if value[0]==".":
phrase.append(DOT)
phrase.defects.append(errors.ObsoleteHeaderDefect(
"period in 'phrase'"))
@@ -1468,15 +1468,15 @@ def get_local_part(value):
try:
token, value = get_word(value)
except errors.HeaderParseError:
- if value[0] != '\\' and value[0] in PHRASE_ENDS:
+ if value[0] != "\\" and value[0] in PHRASE_ENDS:
raise
token = TokenList()
if leader is not None:
token[:0] = [leader]
local_part.append(token)
- if value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
+ if value and (value[0]=="\\" or value[0] not in PHRASE_ENDS):
obs_local_part, value = get_obs_local_part(str(local_part) + value)
- if obs_local_part.token_type == 'invalid-obs-local-part':
+ if obs_local_part.token_type == "invalid-obs-local-part":
local_part.defects.append(errors.InvalidHeaderDefect(
"local-part is not dot-atom, quoted-string, or obs-local-part"))
else:
@@ -1484,7 +1484,7 @@ def get_local_part(value):
"local-part is not a dot-atom (contains CFWS)"))
local_part[0] = obs_local_part
try:
- local_part.value.encode('ascii')
+ local_part.value.encode("ascii")
except UnicodeEncodeError:
local_part.defects.append(errors.NonASCIILocalPartDefect(
"local-part contains non-ASCII characters)"))
@@ -1495,8 +1495,8 @@ def get_obs_local_part(value):
"""
obs_local_part = ObsLocalPart()
last_non_ws_was_dot = False
- while value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
- if value[0] == '.':
+ while value and (value[0]=="\\" or value[0] not in PHRASE_ENDS):
+ if value[0] == ".":
if last_non_ws_was_dot:
obs_local_part.defects.append(errors.InvalidHeaderDefect(
"invalid repeated '.'"))
@@ -1504,15 +1504,15 @@ def get_obs_local_part(value):
last_non_ws_was_dot = True
value = value[1:]
continue
- elif value[0]=='\\':
+ elif value[0]=="\\":
obs_local_part.append(ValueTerminal(value[0],
- 'misplaced-special'))
+ "misplaced-special"))
value = value[1:]
obs_local_part.defects.append(errors.InvalidHeaderDefect(
"'\\' character outside of quoted-string/ccontent"))
last_non_ws_was_dot = False
continue
- if obs_local_part and obs_local_part[-1].token_type != 'dot':
+ if obs_local_part and obs_local_part[-1].token_type != "dot":
obs_local_part.defects.append(errors.InvalidHeaderDefect(
"missing '.' between words"))
try:
@@ -1523,18 +1523,18 @@ def get_obs_local_part(value):
raise
token, value = get_cfws(value)
obs_local_part.append(token)
- if (obs_local_part[0].token_type == 'dot' or
- obs_local_part[0].token_type=='cfws' and
- obs_local_part[1].token_type=='dot'):
+ if (obs_local_part[0].token_type == "dot" or
+ obs_local_part[0].token_type=="cfws" and
+ obs_local_part[1].token_type=="dot"):
obs_local_part.defects.append(errors.InvalidHeaderDefect(
"Invalid leading '.' in local part"))
- if (obs_local_part[-1].token_type == 'dot' or
- obs_local_part[-1].token_type=='cfws' and
- obs_local_part[-2].token_type=='dot'):
+ if (obs_local_part[-1].token_type == "dot" or
+ obs_local_part[-1].token_type=="cfws" and
+ obs_local_part[-2].token_type=="dot"):
obs_local_part.defects.append(errors.InvalidHeaderDefect(
"Invalid trailing '.' in local part"))
if obs_local_part.defects:
- obs_local_part.token_type = 'invalid-obs-local-part'
+ obs_local_part.token_type = "invalid-obs-local-part"
return obs_local_part, value
def get_dtext(value):
@@ -1549,8 +1549,8 @@ def get_dtext(value):
added to the returned token's defect list.
"""
- ptext, value, had_qp = _get_ptext_to_endchars(value, '[]')
- ptext = ValueTerminal(ptext, 'ptext')
+ ptext, value, had_qp = _get_ptext_to_endchars(value, "[]")
+ ptext = ValueTerminal(ptext, "ptext")
if had_qp:
ptext.defects.append(errors.ObsoleteHeaderDefect(
"quoted printable found in domain-literal"))
@@ -1562,7 +1562,7 @@ def _check_for_early_dl_end(value, domain_literal):
return False
domain_literal.append(errors.InvalidHeaderDefect(
"end of input inside domain-literal"))
- domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
+ domain_literal.append(ValueTerminal("]", "domain-literal-end"))
return True
def get_domain_literal(value):
@@ -1575,13 +1575,13 @@ def get_domain_literal(value):
domain_literal.append(token)
if not value:
raise errors.HeaderParseError("expected domain-literal")
- if value[0] != '[':
+ if value[0] != "[":
raise errors.HeaderParseError("expected '[' at start of domain-literal "
"but found '{}'".format(value))
value = value[1:]
if _check_for_early_dl_end(value, domain_literal):
return domain_literal, value
- domain_literal.append(ValueTerminal('[', 'domain-literal-start'))
+ domain_literal.append(ValueTerminal("[", "domain-literal-start"))
if value[0] in WSP:
token, value = get_fws(value)
domain_literal.append(token)
@@ -1594,10 +1594,10 @@ def get_domain_literal(value):
domain_literal.append(token)
if _check_for_early_dl_end(value, domain_literal):
return domain_literal, value
- if value[0] != ']':
+ if value[0] != "]":
raise errors.HeaderParseError("expected ']' at end of domain-literal "
"but found '{}'".format(value))
- domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
+ domain_literal.append(ValueTerminal("]", "domain-literal-end"))
value = value[1:]
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
@@ -1616,7 +1616,7 @@ def get_domain(value):
if not value:
raise errors.HeaderParseError(
"expected domain but found '{}'".format(value))
- if value[0] == '[':
+ if value[0] == "[":
token, value = get_domain_literal(value)
if leader is not None:
token[:0] = [leader]
@@ -1626,17 +1626,17 @@ def get_domain(value):
token, value = get_dot_atom(value)
except errors.HeaderParseError:
token, value = get_atom(value)
- if value and value[0] == '@':
- raise errors.HeaderParseError('Invalid Domain')
+ if value and value[0] == "@":
+ raise errors.HeaderParseError("Invalid Domain")
if leader is not None:
token[:0] = [leader]
domain.append(token)
- if value and value[0] == '.':
+ if value and value[0] == ".":
domain.defects.append(errors.ObsoleteHeaderDefect(
"domain is not a dot-atom (contains CFWS)"))
- if domain[0].token_type == 'dot-atom':
+ if domain[0].token_type == "dot-atom":
domain[:] = domain[0]
- while value and value[0] == '.':
+ while value and value[0] == ".":
domain.append(DOT)
token, value = get_atom(value[1:])
domain.append(token)
@@ -1649,11 +1649,11 @@ def get_addr_spec(value):
addr_spec = AddrSpec()
token, value = get_local_part(value)
addr_spec.append(token)
- if not value or value[0] != '@':
+ if not value or value[0] != "@":
addr_spec.defects.append(errors.InvalidHeaderDefect(
"addr-spec local part with no domain"))
return addr_spec, value
- addr_spec.append(ValueTerminal('@', 'address-at-symbol'))
+ addr_spec.append(ValueTerminal("@", "address-at-symbol"))
token, value = get_domain(value[1:])
addr_spec.append(token)
return addr_spec, value
@@ -1666,20 +1666,20 @@ def get_obs_route(value):
there is no obs-domain-list in the parse tree).
"""
obs_route = ObsRoute()
- while value and (value[0]==',' or value[0] in CFWS_LEADER):
+ while value and (value[0]=="," or value[0] in CFWS_LEADER):
if value[0] in CFWS_LEADER:
token, value = get_cfws(value)
obs_route.append(token)
- elif value[0] == ',':
+ elif value[0] == ",":
obs_route.append(ListSeparator)
value = value[1:]
- if not value or value[0] != '@':
+ if not value or value[0] != "@":
raise errors.HeaderParseError(
"expected obs-route domain but found '{}'".format(value))
obs_route.append(RouteComponentMarker)
token, value = get_domain(value[1:])
obs_route.append(token)
- while value and value[0]==',':
+ while value and value[0]==",":
obs_route.append(ListSeparator)
value = value[1:]
if not value:
@@ -1687,16 +1687,16 @@ def get_obs_route(value):
if value[0] in CFWS_LEADER:
token, value = get_cfws(value)
obs_route.append(token)
- if value[0] == '@':
+ if value[0] == "@":
obs_route.append(RouteComponentMarker)
token, value = get_domain(value[1:])
obs_route.append(token)
if not value:
raise errors.HeaderParseError("end of header while parsing obs-route")
- if value[0] != ':':
+ if value[0] != ":":
raise errors.HeaderParseError( "expected ':' marking end of "
"obs-route but found '{}'".format(value))
- obs_route.append(ValueTerminal(':', 'end-of-obs-route-marker'))
+ obs_route.append(ValueTerminal(":", "end-of-obs-route-marker"))
return obs_route, value[1:]
def get_angle_addr(value):
@@ -1708,15 +1708,15 @@ def get_angle_addr(value):
if value[0] in CFWS_LEADER:
token, value = get_cfws(value)
angle_addr.append(token)
- if not value or value[0] != '<':
+ if not value or value[0] != "<":
raise errors.HeaderParseError(
"expected angle-addr but found '{}'".format(value))
- angle_addr.append(ValueTerminal('<', 'angle-addr-start'))
+ angle_addr.append(ValueTerminal("<", "angle-addr-start"))
value = value[1:]
# Although it is not legal per RFC5322, SMTP uses '<>' in certain
# circumstances.
- if value[0] == '>':
- angle_addr.append(ValueTerminal('>', 'angle-addr-end'))
+ if value[0] == ">":
+ angle_addr.append(ValueTerminal(">", "angle-addr-end"))
angle_addr.defects.append(errors.InvalidHeaderDefect(
"null addr-spec in angle-addr"))
value = value[1:]
@@ -1734,12 +1734,12 @@ def get_angle_addr(value):
angle_addr.append(token)
token, value = get_addr_spec(value)
angle_addr.append(token)
- if value and value[0] == '>':
+ if value and value[0] == ">":
value = value[1:]
else:
angle_addr.defects.append(errors.InvalidHeaderDefect(
"missing trailing '>' on angle-addr"))
- angle_addr.append(ValueTerminal('>', 'angle-addr-end'))
+ angle_addr.append(ValueTerminal(">", "angle-addr-end"))
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
angle_addr.append(token)
@@ -1772,7 +1772,7 @@ def get_name_addr(value):
if not value:
raise errors.HeaderParseError(
"expected name-addr but found '{}'".format(leader))
- if value[0] != '<':
+ if value[0] != "<":
if value[0] in PHRASE_ENDS:
raise errors.HeaderParseError(
"expected name-addr but found '{}'".format(value))
@@ -1807,7 +1807,7 @@ def get_mailbox(value):
"expected mailbox but found '{}'".format(value))
if any(isinstance(x, errors.InvalidHeaderDefect)
for x in token.all_defects):
- mailbox.token_type = 'invalid-mailbox'
+ mailbox.token_type = "invalid-mailbox"
mailbox.append(token)
return mailbox, value
@@ -1822,7 +1822,7 @@ def get_invalid_mailbox(value, endchars):
while value and value[0] not in endchars:
if value[0] in PHRASE_ENDS:
invalid_mailbox.append(ValueTerminal(value[0],
- 'misplaced-special'))
+ "misplaced-special"))
value = value[1:]
else:
token, value = get_phrase(value)
@@ -1842,7 +1842,7 @@ def get_mailbox_list(value):
"""
mailbox_list = MailboxList()
- while value and value[0] != ';':
+ while value and value[0] != ";":
try:
token, value = get_mailbox(value)
mailbox_list.append(token)
@@ -1850,37 +1850,37 @@ def get_mailbox_list(value):
leader = None
if value[0] in CFWS_LEADER:
leader, value = get_cfws(value)
- if not value or value[0] in ',;':
+ if not value or value[0] in ",;":
mailbox_list.append(leader)
mailbox_list.defects.append(errors.ObsoleteHeaderDefect(
"empty element in mailbox-list"))
else:
- token, value = get_invalid_mailbox(value, ',;')
+ token, value = get_invalid_mailbox(value, ",;")
if leader is not None:
token[:0] = [leader]
mailbox_list.append(token)
mailbox_list.defects.append(errors.InvalidHeaderDefect(
"invalid mailbox in mailbox-list"))
- elif value[0] == ',':
+ elif value[0] == ",":
mailbox_list.defects.append(errors.ObsoleteHeaderDefect(
"empty element in mailbox-list"))
else:
- token, value = get_invalid_mailbox(value, ',;')
+ token, value = get_invalid_mailbox(value, ",;")
if leader is not None:
token[:0] = [leader]
mailbox_list.append(token)
mailbox_list.defects.append(errors.InvalidHeaderDefect(
"invalid mailbox in mailbox-list"))
- if value and value[0] not in ',;':
+ if value and value[0] not in ",;":
# Crap after mailbox; treat it as an invalid mailbox.
# The mailbox info will still be available.
mailbox = mailbox_list[-1]
- mailbox.token_type = 'invalid-mailbox'
- token, value = get_invalid_mailbox(value, ',;')
+ mailbox.token_type = "invalid-mailbox"
+ token, value = get_invalid_mailbox(value, ",;")
mailbox.extend(token)
mailbox_list.defects.append(errors.InvalidHeaderDefect(
"invalid mailbox in mailbox-list"))
- if value and value[0] == ',':
+ if value and value[0] == ",":
mailbox_list.append(ListSeparator)
value = value[1:]
return mailbox_list, value
@@ -1907,7 +1907,7 @@ def get_group_list(value):
"end of header in group-list"))
group_list.append(leader)
return group_list, value
- if value[0] == ';':
+ if value[0] == ";":
group_list.append(leader)
return group_list, value
token, value = get_mailbox_list(value)
@@ -1929,24 +1929,24 @@ def get_group(value):
"""
group = Group()
token, value = get_display_name(value)
- if not value or value[0] != ':':
+ if not value or value[0] != ":":
raise errors.HeaderParseError("expected ':' at end of group "
"display name but found '{}'".format(value))
group.append(token)
- group.append(ValueTerminal(':', 'group-display-name-terminator'))
+ group.append(ValueTerminal(":", "group-display-name-terminator"))
value = value[1:]
- if value and value[0] == ';':
- group.append(ValueTerminal(';', 'group-terminator'))
+ if value and value[0] == ";":
+ group.append(ValueTerminal(";", "group-terminator"))
return group, value[1:]
token, value = get_group_list(value)
group.append(token)
if not value:
group.defects.append(errors.InvalidHeaderDefect(
"end of header in group"))
- elif value[0] != ';':
+ elif value[0] != ";":
raise errors.HeaderParseError(
"expected ';' at end of group but found {}".format(value))
- group.append(ValueTerminal(';', 'group-terminator'))
+ group.append(ValueTerminal(";", "group-terminator"))
value = value[1:]
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
@@ -1997,42 +1997,42 @@ def get_address_list(value):
try:
token, value = get_address(value)
address_list.append(token)
- except errors.HeaderParseError as err:
+ except errors.HeaderParseError:
leader = None
if value[0] in CFWS_LEADER:
leader, value = get_cfws(value)
- if not value or value[0] == ',':
+ if not value or value[0] == ",":
address_list.append(leader)
address_list.defects.append(errors.ObsoleteHeaderDefect(
"address-list entry with no content"))
else:
- token, value = get_invalid_mailbox(value, ',')
+ token, value = get_invalid_mailbox(value, ",")
if leader is not None:
token[:0] = [leader]
address_list.append(Address([token]))
address_list.defects.append(errors.InvalidHeaderDefect(
"invalid address in address-list"))
- elif value[0] == ',':
+ elif value[0] == ",":
address_list.defects.append(errors.ObsoleteHeaderDefect(
"empty element in address-list"))
else:
- token, value = get_invalid_mailbox(value, ',')
+ token, value = get_invalid_mailbox(value, ",")
if leader is not None:
token[:0] = [leader]
address_list.append(Address([token]))
address_list.defects.append(errors.InvalidHeaderDefect(
"invalid address in address-list"))
- if value and value[0] != ',':
+ if value and value[0] != ",":
# Crap after address; treat it as an invalid mailbox.
# The mailbox info will still be available.
mailbox = address_list[-1][0]
- mailbox.token_type = 'invalid-mailbox'
- token, value = get_invalid_mailbox(value, ',')
+ mailbox.token_type = "invalid-mailbox"
+ token, value = get_invalid_mailbox(value, ",")
mailbox.extend(token)
address_list.defects.append(errors.InvalidHeaderDefect(
"invalid address in address-list"))
if value: # Must be a , at this point.
- address_list.append(ValueTerminal(',', 'list-separator'))
+ address_list.append(ValueTerminal(",", "list-separator"))
value = value[1:]
return address_list, value
@@ -2044,19 +2044,19 @@ def get_no_fold_literal(value):
if not value:
raise errors.HeaderParseError(
"expected no-fold-literal but found '{}'".format(value))
- if value[0] != '[':
+ if value[0] != "[":
raise errors.HeaderParseError(
"expected '[' at the start of no-fold-literal "
"but found '{}'".format(value))
- no_fold_literal.append(ValueTerminal('[', 'no-fold-literal-start'))
+ no_fold_literal.append(ValueTerminal("[", "no-fold-literal-start"))
value = value[1:]
token, value = get_dtext(value)
no_fold_literal.append(token)
- if not value or value[0] != ']':
+ if not value or value[0] != "]":
raise errors.HeaderParseError(
"expected ']' at the end of no-fold-literal "
"but found '{}'".format(value))
- no_fold_literal.append(ValueTerminal(']', 'no-fold-literal-end'))
+ no_fold_literal.append(ValueTerminal("]", "no-fold-literal-end"))
return no_fold_literal, value[1:]
def get_msg_id(value):
@@ -2069,10 +2069,10 @@ def get_msg_id(value):
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
msg_id.append(token)
- if not value or value[0] != '<':
+ if not value or value[0] != "<":
raise errors.HeaderParseError(
"expected msg-id but found '{}'".format(value))
- msg_id.append(ValueTerminal('<', 'msg-id-start'))
+ msg_id.append(ValueTerminal("<", "msg-id-start"))
value = value[1:]
# Parse id-left.
try:
@@ -2088,17 +2088,17 @@ def get_msg_id(value):
"expected dot-atom-text or obs-id-left"
" but found '{}'".format(value))
msg_id.append(token)
- if not value or value[0] != '@':
+ if not value or value[0] != "@":
msg_id.defects.append(errors.InvalidHeaderDefect(
"msg-id with no id-right"))
# Even though there is no id-right, if the local part
# ends with `>` let's just parse it too and return
# along with the defect.
- if value and value[0] == '>':
- msg_id.append(ValueTerminal('>', 'msg-id-end'))
+ if value and value[0] == ">":
+ msg_id.append(ValueTerminal(">", "msg-id-end"))
value = value[1:]
return msg_id, value
- msg_id.append(ValueTerminal('@', 'address-at-symbol'))
+ msg_id.append(ValueTerminal("@", "address-at-symbol"))
value = value[1:]
# Parse id-right.
try:
@@ -2106,7 +2106,7 @@ def get_msg_id(value):
except errors.HeaderParseError:
try:
token, value = get_no_fold_literal(value)
- except errors.HeaderParseError as e:
+ except errors.HeaderParseError:
try:
token, value = get_domain(value)
msg_id.defects.append(errors.ObsoleteHeaderDefect(
@@ -2116,12 +2116,12 @@ def get_msg_id(value):
"expected dot-atom-text, no-fold-literal or obs-id-right"
" but found '{}'".format(value))
msg_id.append(token)
- if value and value[0] == '>':
+ if value and value[0] == ">":
value = value[1:]
else:
msg_id.defects.append(errors.InvalidHeaderDefect(
"missing trailing '>' on msg-id"))
- msg_id.append(ValueTerminal('>', 'msg-id-end'))
+ msg_id.append(ValueTerminal(">", "msg-id-end"))
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
msg_id.append(token)
@@ -2173,28 +2173,28 @@ def parse_mime_version(value):
if not value:
mime_version.defects.append(errors.HeaderMissingRequiredValue(
"Expected MIME version number but found only CFWS"))
- digits = ''
- while value and value[0] != '.' and value[0] not in CFWS_LEADER:
+ digits = ""
+ while value and value[0] != "." and value[0] not in CFWS_LEADER:
digits += value[0]
value = value[1:]
if not digits.isdigit():
mime_version.defects.append(errors.InvalidHeaderDefect(
"Expected MIME major version number but found {!r}".format(digits)))
- mime_version.append(ValueTerminal(digits, 'xtext'))
+ mime_version.append(ValueTerminal(digits, "xtext"))
else:
mime_version.major = int(digits)
- mime_version.append(ValueTerminal(digits, 'digits'))
+ mime_version.append(ValueTerminal(digits, "digits"))
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
mime_version.append(token)
- if not value or value[0] != '.':
+ if not value or value[0] != ".":
if mime_version.major is not None:
mime_version.defects.append(errors.InvalidHeaderDefect(
"Incomplete MIME version; found only major number"))
if value:
- mime_version.append(ValueTerminal(value, 'xtext'))
+ mime_version.append(ValueTerminal(value, "xtext"))
return mime_version
- mime_version.append(ValueTerminal('.', 'version-separator'))
+ mime_version.append(ValueTerminal(".", "version-separator"))
value = value[1:]
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
@@ -2204,24 +2204,24 @@ def parse_mime_version(value):
mime_version.defects.append(errors.InvalidHeaderDefect(
"Incomplete MIME version; found only major number"))
return mime_version
- digits = ''
+ digits = ""
while value and value[0] not in CFWS_LEADER:
digits += value[0]
value = value[1:]
if not digits.isdigit():
mime_version.defects.append(errors.InvalidHeaderDefect(
"Expected MIME minor version number but found {!r}".format(digits)))
- mime_version.append(ValueTerminal(digits, 'xtext'))
+ mime_version.append(ValueTerminal(digits, "xtext"))
else:
mime_version.minor = int(digits)
- mime_version.append(ValueTerminal(digits, 'digits'))
+ mime_version.append(ValueTerminal(digits, "digits"))
if value and value[0] in CFWS_LEADER:
token, value = get_cfws(value)
mime_version.append(token)
if value:
mime_version.defects.append(errors.InvalidHeaderDefect(
"Excess non-CFWS text after MIME version"))
- mime_version.append(ValueTerminal(value, 'xtext'))
+ mime_version.append(ValueTerminal(value, "xtext"))
return mime_version
def get_invalid_parameter(value):
@@ -2232,10 +2232,10 @@ def get_invalid_parameter(value):
"""
invalid_parameter = InvalidParameter()
- while value and value[0] != ';':
+ while value and value[0] != ";":
if value[0] in PHRASE_ENDS:
invalid_parameter.append(ValueTerminal(value[0],
- 'misplaced-special'))
+ "misplaced-special"))
value = value[1:]
else:
token, value = get_phrase(value)
@@ -2257,7 +2257,7 @@ def get_ttext(value):
"expected ttext but found '{}'".format(value))
ttext = m.group()
value = value[len(ttext):]
- ttext = ValueTerminal(ttext, 'ttext')
+ ttext = ValueTerminal(ttext, "ttext")
_validate_xtext(ttext)
return ttext, value
@@ -2299,7 +2299,7 @@ def get_attrtext(value):
"expected attrtext but found {!r}".format(value))
attrtext = m.group()
value = value[len(attrtext):]
- attrtext = ValueTerminal(attrtext, 'attrtext')
+ attrtext = ValueTerminal(attrtext, "attrtext")
_validate_xtext(attrtext)
return attrtext, value
@@ -2340,7 +2340,7 @@ def get_extended_attrtext(value):
"expected extended attrtext but found {!r}".format(value))
attrtext = m.group()
value = value[len(attrtext):]
- attrtext = ValueTerminal(attrtext, 'extended-attrtext')
+ attrtext = ValueTerminal(attrtext, "extended-attrtext")
_validate_xtext(attrtext)
return attrtext, value
@@ -2376,23 +2376,23 @@ def get_section(value):
"""
section = Section()
- if not value or value[0] != '*':
+ if not value or value[0] != "*":
raise errors.HeaderParseError("Expected section but found {}".format(
value))
- section.append(ValueTerminal('*', 'section-marker'))
+ section.append(ValueTerminal("*", "section-marker"))
value = value[1:]
if not value or not value[0].isdigit():
raise errors.HeaderParseError("Expected section number but "
"found {}".format(value))
- digits = ''
+ digits = ""
while value and value[0].isdigit():
digits += value[0]
value = value[1:]
- if digits[0] == '0' and digits != '0':
+ if digits[0] == "0" and digits != "0":
section.defects.append(errors.InvalidHeaderDefect(
"section number has an invalid leading 0"))
section.number = int(digits)
- section.append(ValueTerminal(digits, 'digits'))
+ section.append(ValueTerminal(digits, "digits"))
return section, value
@@ -2432,11 +2432,11 @@ def get_parameter(value):
param = Parameter()
token, value = get_attribute(value)
param.append(token)
- if not value or value[0] == ';':
+ if not value or value[0] == ";":
param.defects.append(errors.InvalidHeaderDefect("Parameter contains "
"name ({}) but no value".format(token)))
return param, value
- if value[0] == '*':
+ if value[0] == "*":
try:
token, value = get_section(value)
param.sectioned = True
@@ -2445,13 +2445,13 @@ def get_parameter(value):
pass
if not value:
raise errors.HeaderParseError("Incomplete parameter")
- if value[0] == '*':
- param.append(ValueTerminal('*', 'extended-parameter-marker'))
+ if value[0] == "*":
+ param.append(ValueTerminal("*", "extended-parameter-marker"))
value = value[1:]
param.extended = True
- if value[0] != '=':
+ if value[0] != "=":
raise errors.HeaderParseError("Parameter not followed by '='")
- param.append(ValueTerminal('=', 'parameter-separator'))
+ param.append(ValueTerminal("=", "parameter-separator"))
value = value[1:]
leader = None
if value and value[0] in CFWS_LEADER:
@@ -2486,7 +2486,7 @@ def get_parameter(value):
"Quoted string value for extended parameter is invalid"))
param.append(qstring)
for t in qstring:
- if t.token_type == 'bare-quoted-string':
+ if t.token_type == "bare-quoted-string":
t[:] = []
appendto = t
break
@@ -2520,15 +2520,15 @@ def get_parameter(value):
else:
if token is not None:
for t in token:
- if t.token_type == 'extended-attrtext':
+ if t.token_type == "extended-attrtext":
break
- t.token_type == 'attrtext'
+ t.token_type == "attrtext"
appendto.append(t)
param.charset = t.value
if value[0] != "'":
raise errors.HeaderParseError("Expected RFC2231 char/lang encoding "
"delimiter, but found {!r}".format(value))
- appendto.append(ValueTerminal("'", 'RFC2231-delimiter'))
+ appendto.append(ValueTerminal("'", "RFC2231-delimiter"))
value = value[1:]
if value and value[0] != "'":
token, value = get_attrtext(value)
@@ -2537,7 +2537,7 @@ def get_parameter(value):
if not value or value[0] != "'":
raise errors.HeaderParseError("Expected RFC2231 char/lang encoding "
"delimiter, but found {}".format(value))
- appendto.append(ValueTerminal("'", 'RFC2231-delimiter'))
+ appendto.append(ValueTerminal("'", "RFC2231-delimiter"))
value = value[1:]
if remainder is not None:
# Treat the rest of value as bare quoted string content.
@@ -2546,7 +2546,7 @@ def get_parameter(value):
if value[0] in WSP:
token, value = get_fws(value)
elif value[0] == '"':
- token = ValueTerminal('"', 'DQUOTE')
+ token = ValueTerminal('"', "DQUOTE")
value = value[1:]
else:
token, value = get_qcontent(value)
@@ -2578,14 +2578,14 @@ def parse_mime_parameters(value):
try:
token, value = get_parameter(value)
mime_parameters.append(token)
- except errors.HeaderParseError as err:
+ except errors.HeaderParseError:
leader = None
if value[0] in CFWS_LEADER:
leader, value = get_cfws(value)
if not value:
mime_parameters.append(leader)
return mime_parameters
- if value[0] == ';':
+ if value[0] == ";":
if leader is not None:
mime_parameters.append(leader)
mime_parameters.defects.append(errors.InvalidHeaderDefect(
@@ -2597,18 +2597,18 @@ def parse_mime_parameters(value):
mime_parameters.append(token)
mime_parameters.defects.append(errors.InvalidHeaderDefect(
"invalid parameter {!r}".format(token)))
- if value and value[0] != ';':
+ if value and value[0] != ";":
# Junk after the otherwise valid parameter. Mark it as
# invalid, but it will have a value.
param = mime_parameters[-1]
- param.token_type = 'invalid-parameter'
+ param.token_type = "invalid-parameter"
token, value = get_invalid_parameter(value)
param.extend(token)
mime_parameters.defects.append(errors.InvalidHeaderDefect(
"parameter with invalid trailing text {!r}".format(token)))
if value:
# Must be a ';' at this point.
- mime_parameters.append(ValueTerminal(';', 'parameter-separator'))
+ mime_parameters.append(ValueTerminal(";", "parameter-separator"))
value = value[1:]
return mime_parameters
@@ -2616,16 +2616,16 @@ def _find_mime_parameters(tokenlist, value):
"""Do our best to find the parameters in an invalid MIME header
"""
- while value and value[0] != ';':
+ while value and value[0] != ";":
if value[0] in PHRASE_ENDS:
- tokenlist.append(ValueTerminal(value[0], 'misplaced-special'))
+ tokenlist.append(ValueTerminal(value[0], "misplaced-special"))
value = value[1:]
else:
token, value = get_phrase(value)
tokenlist.append(token)
if not value:
return
- tokenlist.append(ValueTerminal(';', 'parameter-separator'))
+ tokenlist.append(ValueTerminal(";", "parameter-separator"))
tokenlist.append(parse_mime_parameters(value[1:]))
def parse_content_type_header(value):
@@ -2651,14 +2651,14 @@ def parse_content_type_header(value):
ctype.append(token)
# XXX: If we really want to follow the formal grammar we should make
# mantype and subtype specialized TokenLists here. Probably not worth it.
- if not value or value[0] != '/':
+ if not value or value[0] != "/":
ctype.defects.append(errors.InvalidHeaderDefect(
"Invalid content type"))
if value:
_find_mime_parameters(ctype, value)
return ctype
ctype.maintype = token.value.strip().lower()
- ctype.append(ValueTerminal('/', 'content-type-separator'))
+ ctype.append(ValueTerminal("/", "content-type-separator"))
value = value[1:]
try:
token, value = get_token(value)
@@ -2671,7 +2671,7 @@ def parse_content_type_header(value):
ctype.subtype = token.value.strip().lower()
if not value:
return ctype
- if value[0] != ';':
+ if value[0] != ";":
ctype.defects.append(errors.InvalidHeaderDefect(
"Only parameters are valid after content type, but "
"found {!r}".format(value)))
@@ -2681,7 +2681,7 @@ def parse_content_type_header(value):
del ctype.maintype, ctype.subtype
_find_mime_parameters(ctype, value)
return ctype
- ctype.append(ValueTerminal(';', 'parameter-separator'))
+ ctype.append(ValueTerminal(";", "parameter-separator"))
ctype.append(parse_mime_parameters(value[1:]))
return ctype
@@ -2705,13 +2705,13 @@ def parse_content_disposition_header(value):
disp_header.content_disposition = token.value.strip().lower()
if not value:
return disp_header
- if value[0] != ';':
+ if value[0] != ";":
disp_header.defects.append(errors.InvalidHeaderDefect(
"Only parameters are valid after content disposition, but "
"found {!r}".format(value)))
_find_mime_parameters(disp_header, value)
return disp_header
- disp_header.append(ValueTerminal(';', 'parameter-separator'))
+ disp_header.append(ValueTerminal(";", "parameter-separator"))
disp_header.append(parse_mime_parameters(value[1:]))
return disp_header
@@ -2739,7 +2739,7 @@ def parse_content_transfer_encoding_header(value):
cte_header.defects.append(errors.InvalidHeaderDefect(
"Extra text after content transfer encoding"))
if value[0] in PHRASE_ENDS:
- cte_header.append(ValueTerminal(value[0], 'misplaced-special'))
+ cte_header.append(ValueTerminal(value[0], "misplaced-special"))
value = value[1:]
else:
token, value = get_phrase(value)
@@ -2763,7 +2763,7 @@ def parse_content_transfer_encoding_header(value):
#
def _steal_trailing_WSP_if_exists(lines):
- wsp = ''
+ wsp = ""
if lines and lines[-1] and lines[-1][-1] in WSP:
wsp = lines[-1][-1]
lines[-1] = lines[-1][:-1]
@@ -2775,12 +2775,12 @@ def _refold_parse_tree(parse_tree, *, policy):
"""
# max_line_length 0/None means no limit, ie: infinitely long.
maxlen = policy.max_line_length or sys.maxsize
- encoding = 'utf-8' if policy.utf8 else 'us-ascii'
- lines = ['']
+ encoding = "utf-8" if policy.utf8 else "us-ascii"
+ lines = [""]
last_ew = None
wrap_as_ew_blocked = 0
want_encoding = False
- end_ew_not_allowed = Terminal('', 'wrap_as_ew_blocked')
+ end_ew_not_allowed = Terminal("", "wrap_as_ew_blocked")
parts = list(parse_tree)
while parts:
part = parts.pop(0)
@@ -2789,7 +2789,7 @@ def _refold_parse_tree(parse_tree, *, policy):
continue
tstr = str(part)
if not want_encoding:
- if part.token_type in ('ptext', 'vtext'):
+ if part.token_type in ("ptext", "vtext"):
# Encode if tstr contains special characters.
want_encoding = not SPECIALSNL.isdisjoint(tstr)
else:
@@ -2801,13 +2801,13 @@ def _refold_parse_tree(parse_tree, *, policy):
except UnicodeEncodeError:
if any(isinstance(x, errors.UndecodableBytesDefect)
for x in part.all_defects):
- charset = 'unknown-8bit'
+ charset = "unknown-8bit"
else:
# If policy.utf8 is false this should really be taken from a
# 'charset' property on the policy.
- charset = 'utf-8'
+ charset = "utf-8"
want_encoding = True
- if part.token_type == 'mime-parameters':
+ if part.token_type == "mime-parameters":
# Mime parameter folding (using RFC2231) is extra special.
_fold_mime_parameters(part, lines, maxlen, encoding)
continue
@@ -2830,7 +2830,7 @@ def _refold_parse_tree(parse_tree, *, policy):
# want it on a line by itself even if it fits, or it
# doesn't fit on a line by itself. Either way, fall through
# to unpacking the subparts and wrapping them.
- if not hasattr(part, 'encode'):
+ if not hasattr(part, "encode"):
# It's not a Terminal, do each piece individually.
parts = list(part) + parts
else:
@@ -2853,18 +2853,18 @@ def _refold_parse_tree(parse_tree, *, policy):
lines.append(newline + tstr)
last_ew = None
continue
- if not hasattr(part, 'encode'):
+ if not hasattr(part, "encode"):
# It's not a terminal, try folding the subparts.
newparts = list(part)
- if part.token_type == 'bare-quoted-string':
+ if part.token_type == "bare-quoted-string":
# To fold a quoted string we need to create a list of terminal
# tokens that will render the leading and trailing quotes
# and use quoted pairs in the value as appropriate.
newparts = (
- [ValueTerminal('"', 'ptext')] +
- [ValueTerminal(make_quoted_pairs(p), 'ptext')
+ [ValueTerminal('"', "ptext")] +
+ [ValueTerminal(make_quoted_pairs(p), "ptext")
for p in newparts] +
- [ValueTerminal('"', 'ptext')])
+ [ValueTerminal('"', "ptext")])
if not part.as_ew_allowed:
wrap_as_ew_blocked += 1
newparts.append(end_ew_not_allowed)
@@ -2908,14 +2908,14 @@ def _fold_as_ew(to_encode, lines, maxlen, last_ew, ew_combine_allowed, charset):
if (len(lines[-1]) == maxlen):
lines.append(_steal_trailing_WSP_if_exists(lines))
lines[-1] += leading_wsp
- trailing_wsp = ''
+ trailing_wsp = ""
if to_encode[-1] in WSP:
# Likewise for the trailing space.
trailing_wsp = to_encode[-1]
to_encode = to_encode[:-1]
new_last_ew = len(lines[-1]) if last_ew is None else last_ew
- encode_as = 'utf-8' if charset == 'us-ascii' else charset
+ encode_as = "utf-8" if charset == "us-ascii" else charset
# The RFC2047 chrome takes up 7 characters plus the length
# of the charset name.
@@ -2929,7 +2929,7 @@ def _fold_as_ew(to_encode, lines, maxlen, last_ew, ew_combine_allowed, charset):
remaining_space = maxlen - len(lines[-1])
text_space = remaining_space - chrome_len
if text_space <= 0:
- lines.append(' ')
+ lines.append(" ")
continue
to_encode_word = to_encode[:text_space]
@@ -2945,7 +2945,7 @@ def _fold_as_ew(to_encode, lines, maxlen, last_ew, ew_combine_allowed, charset):
to_encode = to_encode[len(to_encode_word):]
if to_encode:
- lines.append(' ')
+ lines.append(" ")
new_last_ew = len(lines[-1])
lines[-1] += trailing_wsp
return new_last_ew if ew_combine_allowed else None
@@ -2971,31 +2971,31 @@ def _fold_mime_parameters(part, lines, maxlen, encoding):
# but to do that we need to recognize the need earlier or reparse the
# header, so I'm going to ignore that bug for now. It'll only put us
# one character over.
- if not lines[-1].rstrip().endswith(';'):
- lines[-1] += ';'
+ if not lines[-1].rstrip().endswith(";"):
+ lines[-1] += ";"
charset = encoding
- error_handler = 'strict'
+ error_handler = "strict"
try:
value.encode(encoding)
encoding_required = False
except UnicodeEncodeError:
encoding_required = True
if utils._has_surrogates(value):
- charset = 'unknown-8bit'
- error_handler = 'surrogateescape'
+ charset = "unknown-8bit"
+ error_handler = "surrogateescape"
else:
- charset = 'utf-8'
+ charset = "utf-8"
if encoding_required:
encoded_value = urllib.parse.quote(
- value, safe='', errors=error_handler)
+ value, safe="", errors=error_handler)
tstr = "{}*={}''{}".format(name, charset, encoded_value)
else:
- tstr = '{}={}'.format(name, quote_string(value))
+ tstr = "{}={}".format(name, quote_string(value))
if len(lines[-1]) + len(tstr) + 1 < maxlen:
- lines[-1] = lines[-1] + ' ' + tstr
+ lines[-1] = lines[-1] + " " + tstr
continue
elif len(tstr) + 2 <= maxlen:
- lines.append(' ' + tstr)
+ lines.append(" " + tstr)
continue
# We need multiple sections. We are allowed to mix encoded and
# non-encoded sections, but we aren't going to. We'll encode them all.
@@ -3013,14 +3013,14 @@ def _fold_mime_parameters(part, lines, maxlen, encoding):
while True:
partial = value[:splitpoint]
encoded_value = urllib.parse.quote(
- partial, safe='', errors=error_handler)
+ partial, safe="", errors=error_handler)
if len(encoded_value) <= maxchars:
break
splitpoint -= 1
lines.append(" {}*{}*={}{}".format(
name, section, extra_chrome, encoded_value))
- extra_chrome = ''
+ extra_chrome = ""
section += 1
value = value[splitpoint:]
if value:
- lines[-1] += ';'
+ lines[-1] += ";"
diff --git a/.venv3.10/Lib/email/_parseaddr.py b/.venv3.10/Lib/email/_parseaddr.py
index febe4113..8ed0c16b 100644
--- a/.venv3.10/Lib/email/_parseaddr.py
+++ b/.venv3.10/Lib/email/_parseaddr.py
@@ -7,25 +7,26 @@
"""
__all__ = [
- 'mktime_tz',
- 'parsedate',
- 'parsedate_tz',
- 'quote',
+ "mktime_tz",
+ "parsedate",
+ "parsedate_tz",
+ "quote",
]
-import time, calendar
+import time
+import calendar
-SPACE = ' '
-EMPTYSTRING = ''
-COMMASPACE = ', '
+SPACE = " "
+EMPTYSTRING = ""
+COMMASPACE = ", "
# Parse a date field
-_monthnames = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
- 'aug', 'sep', 'oct', 'nov', 'dec',
- 'january', 'february', 'march', 'april', 'may', 'june', 'july',
- 'august', 'september', 'october', 'november', 'december']
+_monthnames = ["jan", "feb", "mar", "apr", "may", "jun", "jul",
+ "aug", "sep", "oct", "nov", "dec",
+ "january", "february", "march", "april", "may", "june", "july",
+ "august", "september", "october", "november", "december"]
-_daynames = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']
+_daynames = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
# The timezone table does not include the military time zones defined
# in RFC822, other than Z. According to RFC1123, the description in
@@ -33,12 +34,12 @@
# zones. RFC1123 recommends that numeric timezone indicators be used
# instead of timezone names.
-_timezones = {'UT':0, 'UTC':0, 'GMT':0, 'Z':0,
- 'AST': -400, 'ADT': -300, # Atlantic (used in Canada)
- 'EST': -500, 'EDT': -400, # Eastern
- 'CST': -600, 'CDT': -500, # Central
- 'MST': -700, 'MDT': -600, # Mountain
- 'PST': -800, 'PDT': -700 # Pacific
+_timezones = {"UT":0, "UTC":0, "GMT":0, "Z":0,
+ "AST": -400, "ADT": -300, # Atlantic (used in Canada)
+ "EST": -500, "EDT": -400, # Eastern
+ "CST": -600, "CDT": -500, # Central
+ "MST": -700, "MDT": -600, # Mountain
+ "PST": -800, "PDT": -700 # Pacific
}
@@ -71,26 +72,26 @@ def _parsedate_tz(data):
return None
# The FWS after the comma after the day-of-week is optional, so search and
# adjust for this.
- if data[0].endswith(',') or data[0].lower() in _daynames:
+ if data[0].endswith(",") or data[0].lower() in _daynames:
# There's a dayname here. Skip it
del data[0]
else:
- i = data[0].rfind(',')
+ i = data[0].rfind(",")
if i >= 0:
data[0] = data[0][i+1:]
if len(data) == 3: # RFC 850 date, deprecated
- stuff = data[0].split('-')
+ stuff = data[0].split("-")
if len(stuff) == 3:
data = stuff + data[1:]
if len(data) == 4:
s = data[3]
- i = s.find('+')
+ i = s.find("+")
if i == -1:
- i = s.find('-')
+ i = s.find("-")
if i > 0:
data[3:] = [s[:i], s[i:]]
else:
- data.append('') # Dummy tz
+ data.append("") # Dummy tz
if len(data) < 5:
return None
data = data[:5]
@@ -105,28 +106,28 @@ def _parsedate_tz(data):
mm = _monthnames.index(mm) + 1
if mm > 12:
mm -= 12
- if dd[-1] == ',':
+ if dd[-1] == ",":
dd = dd[:-1]
- i = yy.find(':')
+ i = yy.find(":")
if i > 0:
yy, tm = tm, yy
- if yy[-1] == ',':
+ if yy[-1] == ",":
yy = yy[:-1]
if not yy:
return None
if not yy[0].isdigit():
yy, tz = tz, yy
- if tm[-1] == ',':
+ if tm[-1] == ",":
tm = tm[:-1]
- tm = tm.split(':')
+ tm = tm.split(":")
if len(tm) == 2:
[thh, tmm] = tm
- tss = '0'
+ tss = "0"
elif len(tm) == 3:
[thh, tmm, tss] = tm
- elif len(tm) == 1 and '.' in tm[0]:
+ elif len(tm) == 1 and "." in tm[0]:
# Some non-compliant MUAs use '.' to separate time elements.
- tm = tm[0].split('.')
+ tm = tm[0].split(".")
if len(tm) == 2:
[thh, tmm] = tm
tss = 0
@@ -165,7 +166,7 @@ def _parsedate_tz(data):
tzoffset = int(tz)
except ValueError:
pass
- if tzoffset==0 and tz.startswith('-'):
+ if tzoffset==0 and tz.startswith("-"):
tzoffset = None
# Convert a timezone offset into seconds ; -0500 -> -18000
if tzoffset:
@@ -205,7 +206,7 @@ def quote(str):
are the only characters that need to be quoted inside a quoted string.
Does not add the surrounding double quotes.
"""
- return str.replace('\\', '\\\\').replace('"', '\\"')
+ return str.replace("\\", "\\\\").replace('"', '\\"')
class AddrlistClass:
@@ -224,16 +225,16 @@ def __init__(self, field):
`field' is an unparsed address header field, containing
one or more addresses.
"""
- self.specials = '()<>@,:;.\"[]'
+ self.specials = '()<>@,:;."[]'
self.pos = 0
- self.LWS = ' \t'
- self.CR = '\r\n'
+ self.LWS = " \t"
+ self.CR = "\r\n"
self.FWS = self.LWS + self.CR
self.atomends = self.specials + self.LWS + self.CR
# Note that RFC 2822 now specifies `.' as obs-phrase, meaning that it
# is obsolete syntax. RFC 2822 requires that we recognize obsolete
# syntax, so allow dots in phrases.
- self.phraseends = self.atomends.replace('.', '')
+ self.phraseends = self.atomends.replace(".", "")
self.field = field
self.commentlist = []
@@ -241,11 +242,11 @@ def gotonext(self):
"""Skip white space and extract comments."""
wslist = []
while self.pos < len(self.field):
- if self.field[self.pos] in self.LWS + '\n\r':
- if self.field[self.pos] not in '\n\r':
+ if self.field[self.pos] in self.LWS + "\n\r":
+ if self.field[self.pos] not in "\n\r":
wslist.append(self.field[self.pos])
self.pos += 1
- elif self.field[self.pos] == '(':
+ elif self.field[self.pos] == "(":
self.commentlist.append(self.getcomment())
else:
break
@@ -262,7 +263,7 @@ def getaddrlist(self):
if ad:
result += ad
else:
- result.append(('', ''))
+ result.append(("", ""))
return result
def getaddress(self):
@@ -282,7 +283,7 @@ def getaddress(self):
if plist:
returnlist = [(SPACE.join(self.commentlist), plist[0])]
- elif self.field[self.pos] in '.@':
+ elif self.field[self.pos] in ".@":
# email address is just an addrspec
# this isn't very efficient since we start over
self.pos = oldpos
@@ -290,7 +291,7 @@ def getaddress(self):
addrspec = self.getaddrspec()
returnlist = [(SPACE.join(self.commentlist), addrspec)]
- elif self.field[self.pos] == ':':
+ elif self.field[self.pos] == ":":
# address is a group
returnlist = []
@@ -298,18 +299,18 @@ def getaddress(self):
self.pos += 1
while self.pos < len(self.field):
self.gotonext()
- if self.pos < fieldlen and self.field[self.pos] == ';':
+ if self.pos < fieldlen and self.field[self.pos] == ";":
self.pos += 1
break
returnlist = returnlist + self.getaddress()
- elif self.field[self.pos] == '<':
+ elif self.field[self.pos] == "<":
# Address is a phrase then a route addr
routeaddr = self.getrouteaddr()
if self.commentlist:
- returnlist = [(SPACE.join(plist) + ' (' +
- ' '.join(self.commentlist) + ')', routeaddr)]
+ returnlist = [(SPACE.join(plist) + " (" +
+ " ".join(self.commentlist) + ")", routeaddr)]
else:
returnlist = [(SPACE.join(plist), routeaddr)]
@@ -320,7 +321,7 @@ def getaddress(self):
self.pos += 1
self.gotonext()
- if self.pos < len(self.field) and self.field[self.pos] == ',':
+ if self.pos < len(self.field) and self.field[self.pos] == ",":
self.pos += 1
return returnlist
@@ -329,24 +330,24 @@ def getrouteaddr(self):
This method just skips all the route stuff and returns the addrspec.
"""
- if self.field[self.pos] != '<':
+ if self.field[self.pos] != "<":
return
expectroute = False
self.pos += 1
self.gotonext()
- adlist = ''
+ adlist = ""
while self.pos < len(self.field):
if expectroute:
self.getdomain()
expectroute = False
- elif self.field[self.pos] == '>':
+ elif self.field[self.pos] == ">":
self.pos += 1
break
- elif self.field[self.pos] == '@':
+ elif self.field[self.pos] == "@":
self.pos += 1
expectroute = True
- elif self.field[self.pos] == ':':
+ elif self.field[self.pos] == ":":
self.pos += 1
else:
adlist = self.getaddrspec()
@@ -363,10 +364,10 @@ def getaddrspec(self):
self.gotonext()
while self.pos < len(self.field):
preserve_ws = True
- if self.field[self.pos] == '.':
+ if self.field[self.pos] == ".":
if aslist and not aslist[-1].strip():
aslist.pop()
- aslist.append('.')
+ aslist.append(".")
self.pos += 1
preserve_ws = False
elif self.field[self.pos] == '"':
@@ -381,10 +382,10 @@ def getaddrspec(self):
if preserve_ws and ws:
aslist.append(ws)
- if self.pos >= len(self.field) or self.field[self.pos] != '@':
+ if self.pos >= len(self.field) or self.field[self.pos] != "@":
return EMPTYSTRING.join(aslist)
- aslist.append('@')
+ aslist.append("@")
self.pos += 1
self.gotonext()
domain = self.getdomain()
@@ -400,14 +401,14 @@ def getdomain(self):
while self.pos < len(self.field):
if self.field[self.pos] in self.LWS:
self.pos += 1
- elif self.field[self.pos] == '(':
+ elif self.field[self.pos] == "(":
self.commentlist.append(self.getcomment())
- elif self.field[self.pos] == '[':
+ elif self.field[self.pos] == "[":
sdlist.append(self.getdomainliteral())
- elif self.field[self.pos] == '.':
+ elif self.field[self.pos] == ".":
self.pos += 1
- sdlist.append('.')
- elif self.field[self.pos] == '@':
+ sdlist.append(".")
+ elif self.field[self.pos] == "@":
# bpo-34155: Don't parse domains with two `@` like
# `a@malicious.org@important.com`.
return EMPTYSTRING
@@ -431,9 +432,9 @@ def getdelimited(self, beginchar, endchars, allowcomments=True):
within the parsed fragment.
"""
if self.field[self.pos] != beginchar:
- return ''
+ return ""
- slist = ['']
+ slist = [""]
quote = False
self.pos += 1
while self.pos < len(self.field):
@@ -443,10 +444,10 @@ def getdelimited(self, beginchar, endchars, allowcomments=True):
elif self.field[self.pos] in endchars:
self.pos += 1
break
- elif allowcomments and self.field[self.pos] == '(':
+ elif allowcomments and self.field[self.pos] == "(":
slist.append(self.getcomment())
continue # have already advanced pos from getcomment
- elif self.field[self.pos] == '\\':
+ elif self.field[self.pos] == "\\":
quote = True
else:
slist.append(self.field[self.pos])
@@ -460,11 +461,11 @@ def getquote(self):
def getcomment(self):
"""Get a parenthesis-delimited fragment from self's field."""
- return self.getdelimited('(', ')\r', True)
+ return self.getdelimited("(", ")\r", True)
def getdomainliteral(self):
"""Parse an RFC 2822 domain-literal."""
- return '[%s]' % self.getdelimited('[', ']\r', False)
+ return "[%s]" % self.getdelimited("[", "]\r", False)
def getatom(self, atomends=None):
"""Parse an RFC 2822 atom.
@@ -473,7 +474,7 @@ def getatom(self, atomends=None):
(the default is to use self.atomends). This is used e.g. in
getphraselist() since phrase endings must not include the `.' (which
is legal in phrases)."""
- atomlist = ['']
+ atomlist = [""]
if atomends is None:
atomends = self.atomends
@@ -500,7 +501,7 @@ def getphraselist(self):
self.pos += 1
elif self.field[self.pos] == '"':
plist.append(self.getquote())
- elif self.field[self.pos] == '(':
+ elif self.field[self.pos] == "(":
self.commentlist.append(self.getcomment())
elif self.field[self.pos] in self.phraseends:
break
@@ -526,14 +527,14 @@ def __add__(self, other):
newaddr = AddressList(None)
newaddr.addresslist = self.addresslist[:]
for x in other.addresslist:
- if not x in self.addresslist:
+ if x not in self.addresslist:
newaddr.addresslist.append(x)
return newaddr
def __iadd__(self, other):
# Set union, in-place
for x in other.addresslist:
- if not x in self.addresslist:
+ if x not in self.addresslist:
self.addresslist.append(x)
return self
@@ -541,7 +542,7 @@ def __sub__(self, other):
# Set difference
newaddr = AddressList(None)
for x in self.addresslist:
- if not x in other.addresslist:
+ if x not in other.addresslist:
newaddr.addresslist.append(x)
return newaddr
diff --git a/.venv3.10/Lib/email/_policybase.py b/.venv3.10/Lib/email/_policybase.py
index d1f48211..330e3a98 100644
--- a/.venv3.10/Lib/email/_policybase.py
+++ b/.venv3.10/Lib/email/_policybase.py
@@ -9,9 +9,9 @@
from email.utils import _has_surrogates
__all__ = [
- 'Policy',
- 'Compat32',
- 'compat32',
+ "Policy",
+ "Compat32",
+ "compat32",
]
@@ -55,7 +55,7 @@ def __init__(self, **kw):
def __repr__(self):
args = [ "{}={!r}".format(name, value)
for name, value in self.__dict__.items() ]
- return "{}({})".format(self.__class__.__name__, ', '.join(args))
+ return "{}({})".format(self.__class__.__name__, ", ".join(args))
def clone(self, **kw):
"""Return a new instance with specified attributes changed.
@@ -92,17 +92,17 @@ def __add__(self, other):
def _append_doc(doc, added_doc):
- doc = doc.rsplit('\n', 1)[0]
- added_doc = added_doc.split('\n', 1)[1]
- return doc + '\n' + added_doc
+ doc = doc.rsplit("\n", 1)[0]
+ added_doc = added_doc.split("\n", 1)[1]
+ return doc + "\n" + added_doc
def _extend_docstrings(cls):
- if cls.__doc__ and cls.__doc__.startswith('+'):
+ if cls.__doc__ and cls.__doc__.startswith("+"):
cls.__doc__ = _append_doc(cls.__bases__[0].__doc__, cls.__doc__)
for name, attr in cls.__dict__.items():
- if attr.__doc__ and attr.__doc__.startswith('+'):
+ if attr.__doc__ and attr.__doc__.startswith("+"):
for c in (c for base in cls.__bases__ for c in base.mro()):
- doc = getattr(getattr(c, name), '__doc__')
+ doc = getattr(c, name).__doc__
if doc:
attr.__doc__ = _append_doc(doc, attr.__doc__)
break
@@ -167,8 +167,8 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta):
"""
raise_on_defect = False
- linesep = '\n'
- cte_type = '8bit'
+ linesep = "\n"
+ cte_type = "8bit"
max_line_length = 78
mangle_from_ = False
message_factory = None
@@ -306,9 +306,9 @@ def header_source_parse(self, sourcelines):
stripping any trailing carriage return or linefeed characters.
"""
- name, value = sourcelines[0].split(':', 1)
- value = value.lstrip(' \t') + ''.join(sourcelines[1:])
- return (name, value.rstrip('\r\n'))
+ name, value = sourcelines[0].split(":", 1)
+ value = value.lstrip(" \t") + "".join(sourcelines[1:])
+ return (name, value.rstrip("\r\n"))
def header_store_parse(self, name, value):
"""+
@@ -342,12 +342,12 @@ def fold_binary(self, name, value):
header is used, with its existing line breaks and/or binary data.
"""
- folded = self._fold(name, value, sanitize=self.cte_type=='7bit')
- return folded.encode('ascii', 'surrogateescape')
+ folded = self._fold(name, value, sanitize=self.cte_type=="7bit")
+ return folded.encode("ascii", "surrogateescape")
def _fold(self, name, value, sanitize):
parts = []
- parts.append('%s: ' % name)
+ parts.append("%s: " % name)
if isinstance(value, str):
if _has_surrogates(value):
if sanitize:
@@ -376,7 +376,7 @@ def _fold(self, name, value, sanitize):
maxlinelen = self.max_line_length
parts.append(h.encode(linesep=self.linesep, maxlinelen=maxlinelen))
parts.append(self.linesep)
- return ''.join(parts)
+ return "".join(parts)
compat32 = Compat32()
diff --git a/.venv3.10/Lib/email/base64mime.py b/.venv3.10/Lib/email/base64mime.py
index a7cc3736..e0383deb 100644
--- a/.venv3.10/Lib/email/base64mime.py
+++ b/.venv3.10/Lib/email/base64mime.py
@@ -25,27 +25,27 @@
"""
__all__ = [
- 'body_decode',
- 'body_encode',
- 'decode',
- 'decodestring',
- 'header_encode',
- 'header_length',
+ "body_decode",
+ "body_encode",
+ "decode",
+ "decodestring",
+ "header_encode",
+ "header_length",
]
from base64 import b64encode
from binascii import b2a_base64, a2b_base64
-CRLF = '\r\n'
-NL = '\n'
-EMPTYSTRING = ''
+CRLF = "\r\n"
+NL = "\n"
+EMPTYSTRING = ""
# See also Charset.py
MISC_LEN = 7
-
+
# Helpers
def header_length(bytearray):
"""Return the length of s when it is encoded with base64."""
@@ -57,8 +57,8 @@ def header_length(bytearray):
return n
-
-def header_encode(header_bytes, charset='iso-8859-1'):
+
+def header_encode(header_bytes, charset="iso-8859-1"):
"""Encode a single header line with Base64 encoding in a given charset.
charset names the character set to use to encode the header. It defaults
@@ -69,10 +69,10 @@ def header_encode(header_bytes, charset='iso-8859-1'):
if isinstance(header_bytes, str):
header_bytes = header_bytes.encode(charset)
encoded = b64encode(header_bytes).decode("ascii")
- return '=?%s?b?%s?=' % (charset, encoded)
+ return "=?%s?b?%s?=" % (charset, encoded)
+
-
def body_encode(s, maxlinelen=76, eol=NL):
r"""Encode a string with base64.
@@ -98,7 +98,7 @@ def body_encode(s, maxlinelen=76, eol=NL):
return EMPTYSTRING.join(encvec)
-
+
def decode(string):
"""Decode a raw base64 string, returning a bytes object.
@@ -109,7 +109,7 @@ def decode(string):
if not string:
return bytes()
elif isinstance(string, str):
- return a2b_base64(string.encode('raw-unicode-escape'))
+ return a2b_base64(string.encode("raw-unicode-escape"))
else:
return a2b_base64(string)
diff --git a/.venv3.10/Lib/email/charset.py b/.venv3.10/Lib/email/charset.py
index 791b6584..bdb5596b 100644
--- a/.venv3.10/Lib/email/charset.py
+++ b/.venv3.10/Lib/email/charset.py
@@ -3,10 +3,10 @@
# Contact: email-sig@python.org
__all__ = [
- 'Charset',
- 'add_alias',
- 'add_charset',
- 'add_codec',
+ "Charset",
+ "add_alias",
+ "add_charset",
+ "add_codec",
]
from functools import partial
@@ -18,7 +18,7 @@
from email.encoders import encode_7or8bit
-
+
# Flags for types of header encodings
QP = 1 # Quoted-Printable
BASE64 = 2 # Base64
@@ -27,84 +27,84 @@
# In "=?charset?q?hello_world?=", the =?, ?q?, and ?= add up to 7
RFC2047_CHROME_LEN = 7
-DEFAULT_CHARSET = 'us-ascii'
-UNKNOWN8BIT = 'unknown-8bit'
-EMPTYSTRING = ''
+DEFAULT_CHARSET = "us-ascii"
+UNKNOWN8BIT = "unknown-8bit"
+EMPTYSTRING = ""
+
-
# Defaults
CHARSETS = {
# input header enc body enc output conv
- 'iso-8859-1': (QP, QP, None),
- 'iso-8859-2': (QP, QP, None),
- 'iso-8859-3': (QP, QP, None),
- 'iso-8859-4': (QP, QP, None),
+ "iso-8859-1": (QP, QP, None),
+ "iso-8859-2": (QP, QP, None),
+ "iso-8859-3": (QP, QP, None),
+ "iso-8859-4": (QP, QP, None),
# iso-8859-5 is Cyrillic, and not especially used
# iso-8859-6 is Arabic, also not particularly used
# iso-8859-7 is Greek, QP will not make it readable
# iso-8859-8 is Hebrew, QP will not make it readable
- 'iso-8859-9': (QP, QP, None),
- 'iso-8859-10': (QP, QP, None),
+ "iso-8859-9": (QP, QP, None),
+ "iso-8859-10": (QP, QP, None),
# iso-8859-11 is Thai, QP will not make it readable
- 'iso-8859-13': (QP, QP, None),
- 'iso-8859-14': (QP, QP, None),
- 'iso-8859-15': (QP, QP, None),
- 'iso-8859-16': (QP, QP, None),
- 'windows-1252':(QP, QP, None),
- 'viscii': (QP, QP, None),
- 'us-ascii': (None, None, None),
- 'big5': (BASE64, BASE64, None),
- 'gb2312': (BASE64, BASE64, None),
- 'euc-jp': (BASE64, None, 'iso-2022-jp'),
- 'shift_jis': (BASE64, None, 'iso-2022-jp'),
- 'iso-2022-jp': (BASE64, None, None),
- 'koi8-r': (BASE64, BASE64, None),
- 'utf-8': (SHORTEST, BASE64, 'utf-8'),
+ "iso-8859-13": (QP, QP, None),
+ "iso-8859-14": (QP, QP, None),
+ "iso-8859-15": (QP, QP, None),
+ "iso-8859-16": (QP, QP, None),
+ "windows-1252":(QP, QP, None),
+ "viscii": (QP, QP, None),
+ "us-ascii": (None, None, None),
+ "big5": (BASE64, BASE64, None),
+ "gb2312": (BASE64, BASE64, None),
+ "euc-jp": (BASE64, None, "iso-2022-jp"),
+ "shift_jis": (BASE64, None, "iso-2022-jp"),
+ "iso-2022-jp": (BASE64, None, None),
+ "koi8-r": (BASE64, BASE64, None),
+ "utf-8": (SHORTEST, BASE64, "utf-8"),
}
# Aliases for other commonly-used names for character sets. Map
# them to the real ones used in email.
ALIASES = {
- 'latin_1': 'iso-8859-1',
- 'latin-1': 'iso-8859-1',
- 'latin_2': 'iso-8859-2',
- 'latin-2': 'iso-8859-2',
- 'latin_3': 'iso-8859-3',
- 'latin-3': 'iso-8859-3',
- 'latin_4': 'iso-8859-4',
- 'latin-4': 'iso-8859-4',
- 'latin_5': 'iso-8859-9',
- 'latin-5': 'iso-8859-9',
- 'latin_6': 'iso-8859-10',
- 'latin-6': 'iso-8859-10',
- 'latin_7': 'iso-8859-13',
- 'latin-7': 'iso-8859-13',
- 'latin_8': 'iso-8859-14',
- 'latin-8': 'iso-8859-14',
- 'latin_9': 'iso-8859-15',
- 'latin-9': 'iso-8859-15',
- 'latin_10':'iso-8859-16',
- 'latin-10':'iso-8859-16',
- 'cp949': 'ks_c_5601-1987',
- 'euc_jp': 'euc-jp',
- 'euc_kr': 'euc-kr',
- 'ascii': 'us-ascii',
+ "latin_1": "iso-8859-1",
+ "latin-1": "iso-8859-1",
+ "latin_2": "iso-8859-2",
+ "latin-2": "iso-8859-2",
+ "latin_3": "iso-8859-3",
+ "latin-3": "iso-8859-3",
+ "latin_4": "iso-8859-4",
+ "latin-4": "iso-8859-4",
+ "latin_5": "iso-8859-9",
+ "latin-5": "iso-8859-9",
+ "latin_6": "iso-8859-10",
+ "latin-6": "iso-8859-10",
+ "latin_7": "iso-8859-13",
+ "latin-7": "iso-8859-13",
+ "latin_8": "iso-8859-14",
+ "latin-8": "iso-8859-14",
+ "latin_9": "iso-8859-15",
+ "latin-9": "iso-8859-15",
+ "latin_10":"iso-8859-16",
+ "latin-10":"iso-8859-16",
+ "cp949": "ks_c_5601-1987",
+ "euc_jp": "euc-jp",
+ "euc_kr": "euc-kr",
+ "ascii": "us-ascii",
}
# Map charsets to their Unicode codec strings.
CODEC_MAP = {
- 'gb2312': 'eucgb2312_cn',
- 'big5': 'big5_tw',
+ "gb2312": "eucgb2312_cn",
+ "big5": "big5_tw",
# Hack: We don't want *any* conversion for stuff marked us-ascii, as all
# sorts of garbage might be sent to us in the guise of 7-bit us-ascii.
# Let that stuff pass through without conversion to/from Unicode.
- 'us-ascii': None,
+ "us-ascii": None,
}
-
+
# Convenience functions for extending the above mappings
def add_charset(charset, header_enc=None, body_enc=None, output_charset=None):
"""Add character set properties to the global registry.
@@ -130,7 +130,7 @@ def add_charset(charset, header_enc=None, body_enc=None, output_charset=None):
documentation for more information.
"""
if body_enc == SHORTEST:
- raise ValueError('SHORTEST not allowed for body_enc')
+ raise ValueError("SHORTEST not allowed for body_enc")
CHARSETS[charset] = (header_enc, body_enc, output_charset)
@@ -153,17 +153,17 @@ def add_codec(charset, codecname):
CODEC_MAP[charset] = codecname
-
+
# Convenience function for encoding strings, taking into account
# that they might be unknown-8bit (ie: have surrogate-escaped bytes)
def _encode(string, codec):
if codec == UNKNOWN8BIT:
- return string.encode('ascii', 'surrogateescape')
+ return string.encode("ascii", "surrogateescape")
else:
return string.encode(codec)
-
+
class Charset:
"""Map character sets to their email properties.
@@ -215,9 +215,9 @@ def __init__(self, input_charset=DEFAULT_CHARSET):
# charset is ASCII, as the standard (RFC XXX) requires.
try:
if isinstance(input_charset, str):
- input_charset.encode('ascii')
+ input_charset.encode("ascii")
else:
- input_charset = str(input_charset, 'ascii')
+ input_charset = str(input_charset, "ascii")
except UnicodeError:
raise errors.CharsetError(input_charset)
input_charset = input_charset.lower()
@@ -262,9 +262,9 @@ def get_body_encoding(self):
"""
assert self.body_encoding != SHORTEST
if self.body_encoding == QP:
- return 'quoted-printable'
+ return "quoted-printable"
elif self.body_encoding == BASE64:
- return 'base64'
+ return "base64"
else:
return encode_7or8bit
@@ -287,7 +287,7 @@ def header_encode(self, string):
output codec.
:return: The encoded string, with RFC 2047 chrome.
"""
- codec = self.output_codec or 'us-ascii'
+ codec = self.output_codec or "us-ascii"
header_bytes = _encode(string, codec)
# 7bit/8bit encodings return the string unchanged (modulo conversions)
encoder_module = self._get_encoder(header_bytes)
@@ -313,7 +313,7 @@ def header_encode_lines(self, string, maxlengths):
:return: Lines of encoded strings, each with RFC 2047 chrome.
"""
# See which encoding we should use.
- codec = self.output_codec or 'us-ascii'
+ codec = self.output_codec or "us-ascii"
header_bytes = _encode(string, codec)
encoder_module = self._get_encoder(header_bytes)
encoder = partial(encoder_module.header_encode, charset=codec)
@@ -346,7 +346,7 @@ def header_encode_lines(self, string, maxlengths):
if not lines and not current_line:
lines.append(None)
else:
- separator = (' ' if lines else '')
+ separator = (" " if lines else "")
joined_line = EMPTYSTRING.join(current_line)
header_bytes = _encode(joined_line, codec)
lines.append(encoder(header_bytes))
@@ -396,9 +396,9 @@ def body_encode(self, string):
# between 0 and 255, which is what body_encode is expecting.
if isinstance(string, str):
string = string.encode(self.output_charset)
- string = string.decode('latin1')
+ string = string.decode("latin1")
return email.quoprimime.body_encode(string)
else:
if isinstance(string, str):
- string = string.encode(self.output_charset).decode('ascii')
+ string = string.encode(self.output_charset).decode("ascii")
return string
diff --git a/.venv3.10/Lib/email/contentmanager.py b/.venv3.10/Lib/email/contentmanager.py
index fcf278db..a3292729 100644
--- a/.venv3.10/Lib/email/contentmanager.py
+++ b/.venv3.10/Lib/email/contentmanager.py
@@ -20,15 +20,15 @@ def get_content(self, msg, *args, **kw):
maintype = msg.get_content_maintype()
if maintype in self.get_handlers:
return self.get_handlers[maintype](msg, *args, **kw)
- if '' in self.get_handlers:
- return self.get_handlers[''](msg, *args, **kw)
+ if "" in self.get_handlers:
+ return self.get_handlers[""](msg, *args, **kw)
raise KeyError(content_type)
def add_set_handler(self, typekey, handler):
self.set_handlers[typekey] = handler
def set_content(self, msg, obj, *args, **kw):
- if msg.get_content_maintype() == 'multipart':
+ if msg.get_content_maintype() == "multipart":
# XXX: is this error a good idea or not? We can remove it later,
# but we can't add it later, so do it for now.
raise TypeError("set_content not valid on multipart")
@@ -42,8 +42,8 @@ def _find_set_handler(self, msg, obj):
if typ in self.set_handlers:
return self.set_handlers[typ]
qname = typ.__qualname__
- modname = getattr(typ, '__module__', '')
- full_path = '.'.join((modname, qname)) if modname else qname
+ modname = getattr(typ, "__module__", "")
+ full_path = ".".join((modname, qname)) if modname else qname
if full_path_for_error is None:
full_path_for_error = full_path
if full_path in self.set_handlers:
@@ -61,23 +61,23 @@ def _find_set_handler(self, msg, obj):
raw_data_manager = ContentManager()
-def get_text_content(msg, errors='replace'):
+def get_text_content(msg, errors="replace"):
content = msg.get_payload(decode=True)
- charset = msg.get_param('charset', 'ASCII')
+ charset = msg.get_param("charset", "ASCII")
return content.decode(charset, errors=errors)
-raw_data_manager.add_get_handler('text', get_text_content)
+raw_data_manager.add_get_handler("text", get_text_content)
def get_non_text_content(msg):
return msg.get_payload(decode=True)
-for maintype in 'audio image video application'.split():
+for maintype in "audio image video application".split():
raw_data_manager.add_get_handler(maintype, get_non_text_content)
def get_message_content(msg):
return msg.get_payload(0)
-for subtype in 'rfc822 external-body'.split():
- raw_data_manager.add_get_handler('message/'+subtype, get_message_content)
+for subtype in "rfc822 external-body".split():
+ raw_data_manager.add_get_handler("message/"+subtype, get_message_content)
def get_and_fixup_unknown_message_content(msg):
@@ -88,14 +88,14 @@ def get_and_fixup_unknown_message_content(msg):
# model message/partial content as Message objects, so they are handled
# here as well. (How to reassemble them is out of scope for this comment :)
return bytes(msg.get_payload(0))
-raw_data_manager.add_get_handler('message',
+raw_data_manager.add_get_handler("message",
get_and_fixup_unknown_message_content)
def _prepare_set(msg, maintype, subtype, headers):
- msg['Content-Type'] = '/'.join((maintype, subtype))
+ msg["Content-Type"] = "/".join((maintype, subtype))
if headers:
- if not hasattr(headers[0], 'name'):
+ if not hasattr(headers[0], "name"):
mp = msg.policy
headers = [mp.header_factory(*mp.header_source_parse([header]))
for header in headers]
@@ -111,16 +111,16 @@ def _prepare_set(msg, maintype, subtype, headers):
def _finalize_set(msg, disposition, filename, cid, params):
if disposition is None and filename is not None:
- disposition = 'attachment'
+ disposition = "attachment"
if disposition is not None:
- msg['Content-Disposition'] = disposition
+ msg["Content-Disposition"] = disposition
if filename is not None:
- msg.set_param('filename',
+ msg.set_param("filename",
filename,
- header='Content-Disposition',
+ header="Content-Disposition",
replace=True)
if cid is not None:
- msg['Content-ID'] = cid
+ msg["Content-ID"] = cid
if params is not None:
for key, value in params.items():
msg.set_param(key, value)
@@ -135,59 +135,59 @@ def _encode_base64(data, max_line_length):
unencoded_bytes_per_line = max_line_length // 4 * 3
for i in range(0, len(data), unencoded_bytes_per_line):
thisline = data[i:i+unencoded_bytes_per_line]
- encoded_lines.append(binascii.b2a_base64(thisline).decode('ascii'))
- return ''.join(encoded_lines)
+ encoded_lines.append(binascii.b2a_base64(thisline).decode("ascii"))
+ return "".join(encoded_lines)
def _encode_text(string, charset, cte, policy):
lines = string.encode(charset).splitlines()
- linesep = policy.linesep.encode('ascii')
+ linesep = policy.linesep.encode("ascii")
def embedded_body(lines): return linesep.join(lines) + linesep
- def normal_body(lines): return b'\n'.join(lines) + b'\n'
+ def normal_body(lines): return b"\n".join(lines) + b"\n"
if cte is None:
# Use heuristics to decide on the "best" encoding.
if max((len(x) for x in lines), default=0) <= policy.max_line_length:
try:
- return '7bit', normal_body(lines).decode('ascii')
+ return "7bit", normal_body(lines).decode("ascii")
except UnicodeDecodeError:
pass
- if policy.cte_type == '8bit':
- return '8bit', normal_body(lines).decode('ascii', 'surrogateescape')
+ if policy.cte_type == "8bit":
+ return "8bit", normal_body(lines).decode("ascii", "surrogateescape")
sniff = embedded_body(lines[:10])
- sniff_qp = quoprimime.body_encode(sniff.decode('latin-1'),
+ sniff_qp = quoprimime.body_encode(sniff.decode("latin-1"),
policy.max_line_length)
sniff_base64 = binascii.b2a_base64(sniff)
# This is a little unfair to qp; it includes lineseps, base64 doesn't.
if len(sniff_qp) > len(sniff_base64):
- cte = 'base64'
+ cte = "base64"
else:
- cte = 'quoted-printable'
+ cte = "quoted-printable"
if len(lines) <= 10:
return cte, sniff_qp
- if cte == '7bit':
- data = normal_body(lines).decode('ascii')
- elif cte == '8bit':
- data = normal_body(lines).decode('ascii', 'surrogateescape')
- elif cte == 'quoted-printable':
- data = quoprimime.body_encode(normal_body(lines).decode('latin-1'),
+ if cte == "7bit":
+ data = normal_body(lines).decode("ascii")
+ elif cte == "8bit":
+ data = normal_body(lines).decode("ascii", "surrogateescape")
+ elif cte == "quoted-printable":
+ data = quoprimime.body_encode(normal_body(lines).decode("latin-1"),
policy.max_line_length)
- elif cte == 'base64':
+ elif cte == "base64":
data = _encode_base64(embedded_body(lines), policy.max_line_length)
else:
raise ValueError("Unknown content transfer encoding {}".format(cte))
return cte, data
-def set_text_content(msg, string, subtype="plain", charset='utf-8', cte=None,
+def set_text_content(msg, string, subtype="plain", charset="utf-8", cte=None,
disposition=None, filename=None, cid=None,
params=None, headers=None):
- _prepare_set(msg, 'text', subtype, headers)
+ _prepare_set(msg, "text", subtype, headers)
cte, payload = _encode_text(string, charset, cte, msg.policy)
msg.set_payload(payload)
- msg.set_param('charset',
+ msg.set_param("charset",
email.charset.ALIASES.get(charset, charset),
replace=True)
- msg['Content-Transfer-Encoding'] = cte
+ msg["Content-Transfer-Encoding"] = cte
_finalize_set(msg, disposition, filename, cid, params)
raw_data_manager.add_set_handler(str, set_text_content)
@@ -195,10 +195,10 @@ def set_text_content(msg, string, subtype="plain", charset='utf-8', cte=None,
def set_message_content(msg, message, subtype="rfc822", cte=None,
disposition=None, filename=None, cid=None,
params=None, headers=None):
- if subtype == 'partial':
+ if subtype == "partial":
raise ValueError("message/partial is not supported for Message objects")
- if subtype == 'rfc822':
- if cte not in (None, '7bit', '8bit', 'binary'):
+ if subtype == "rfc822":
+ if cte not in (None, "7bit", "8bit", "binary"):
# http://tools.ietf.org/html/rfc2046#section-5.2.1 mandate.
raise ValueError(
"message/rfc822 parts do not support cte={}".format(cte))
@@ -207,42 +207,42 @@ def set_message_content(msg, message, subtype="rfc822", cte=None,
# result of that should be a gateway that needs to coerce to 7bit
# having to look through the whole embedded message to discover whether
# or not it actually has to do anything.
- cte = '8bit' if cte is None else cte
- elif subtype == 'external-body':
- if cte not in (None, '7bit'):
+ cte = "8bit" if cte is None else cte
+ elif subtype == "external-body":
+ if cte not in (None, "7bit"):
# http://tools.ietf.org/html/rfc2046#section-5.2.3 mandate.
raise ValueError(
"message/external-body parts do not support cte={}".format(cte))
- cte = '7bit'
+ cte = "7bit"
elif cte is None:
# http://tools.ietf.org/html/rfc2046#section-5.2.4 says all future
# subtypes should be restricted to 7bit, so assume that.
- cte = '7bit'
- _prepare_set(msg, 'message', subtype, headers)
+ cte = "7bit"
+ _prepare_set(msg, "message", subtype, headers)
msg.set_payload([message])
- msg['Content-Transfer-Encoding'] = cte
+ msg["Content-Transfer-Encoding"] = cte
_finalize_set(msg, disposition, filename, cid, params)
raw_data_manager.add_set_handler(email.message.Message, set_message_content)
-def set_bytes_content(msg, data, maintype, subtype, cte='base64',
+def set_bytes_content(msg, data, maintype, subtype, cte="base64",
disposition=None, filename=None, cid=None,
params=None, headers=None):
_prepare_set(msg, maintype, subtype, headers)
- if cte == 'base64':
+ if cte == "base64":
data = _encode_base64(data, max_line_length=msg.policy.max_line_length)
- elif cte == 'quoted-printable':
+ elif cte == "quoted-printable":
# XXX: quoprimime.body_encode won't encode newline characters in data,
# so we can't use it. This means max_line_length is ignored. Another
# bug to fix later. (Note: encoders.quopri is broken on line ends.)
data = binascii.b2a_qp(data, istext=False, header=False, quotetabs=True)
- data = data.decode('ascii')
- elif cte == '7bit':
- data = data.decode('ascii')
- elif cte in ('8bit', 'binary'):
- data = data.decode('ascii', 'surrogateescape')
+ data = data.decode("ascii")
+ elif cte == "7bit":
+ data = data.decode("ascii")
+ elif cte in ("8bit", "binary"):
+ data = data.decode("ascii", "surrogateescape")
msg.set_payload(data)
- msg['Content-Transfer-Encoding'] = cte
+ msg["Content-Transfer-Encoding"] = cte
_finalize_set(msg, disposition, filename, cid, params)
for typ in (bytes, bytearray, memoryview):
raw_data_manager.add_set_handler(typ, set_bytes_content)
diff --git a/.venv3.10/Lib/email/encoders.py b/.venv3.10/Lib/email/encoders.py
index 0a66acb6..dff7fe34 100644
--- a/.venv3.10/Lib/email/encoders.py
+++ b/.venv3.10/Lib/email/encoders.py
@@ -5,10 +5,10 @@
"""Encodings and related functions."""
__all__ = [
- 'encode_7or8bit',
- 'encode_base64',
- 'encode_noop',
- 'encode_quopri',
+ "encode_7or8bit",
+ "encode_base64",
+ "encode_noop",
+ "encode_quopri",
]
@@ -16,11 +16,11 @@
from quopri import encodestring as _encodestring
-
+
def _qencode(s):
enc = _encodestring(s, quotetabs=True)
# Must encode spaces, which quopri.encodestring() doesn't do
- return enc.replace(b' ', b'=20')
+ return enc.replace(b" ", b"=20")
def encode_base64(msg):
@@ -29,12 +29,12 @@ def encode_base64(msg):
Also, add an appropriate Content-Transfer-Encoding header.
"""
orig = msg.get_payload(decode=True)
- encdata = str(_bencode(orig), 'ascii')
+ encdata = str(_bencode(orig), "ascii")
msg.set_payload(encdata)
- msg['Content-Transfer-Encoding'] = 'base64'
+ msg["Content-Transfer-Encoding"] = "base64"
+
-
def encode_quopri(msg):
"""Encode the message's payload in quoted-printable.
@@ -43,27 +43,27 @@ def encode_quopri(msg):
orig = msg.get_payload(decode=True)
encdata = _qencode(orig)
msg.set_payload(encdata)
- msg['Content-Transfer-Encoding'] = 'quoted-printable'
+ msg["Content-Transfer-Encoding"] = "quoted-printable"
+
-
def encode_7or8bit(msg):
"""Set the Content-Transfer-Encoding header to 7bit or 8bit."""
orig = msg.get_payload(decode=True)
if orig is None:
# There's no payload. For backwards compatibility we use 7bit
- msg['Content-Transfer-Encoding'] = '7bit'
+ msg["Content-Transfer-Encoding"] = "7bit"
return
# We play a trick to make this go fast. If decoding from ASCII succeeds,
# we know the data must be 7bit, otherwise treat it as 8bit.
try:
- orig.decode('ascii')
+ orig.decode("ascii")
except UnicodeError:
- msg['Content-Transfer-Encoding'] = '8bit'
+ msg["Content-Transfer-Encoding"] = "8bit"
else:
- msg['Content-Transfer-Encoding'] = '7bit'
+ msg["Content-Transfer-Encoding"] = "7bit"
+
-
def encode_noop(msg):
"""Do nothing."""
diff --git a/.venv3.10/Lib/email/feedparser.py b/.venv3.10/Lib/email/feedparser.py
index 97d3f514..20c9a917 100644
--- a/.venv3.10/Lib/email/feedparser.py
+++ b/.venv3.10/Lib/email/feedparser.py
@@ -19,7 +19,7 @@
object's .defects attribute.
"""
-__all__ = ['FeedParser', 'BytesFeedParser']
+__all__ = ["FeedParser", "BytesFeedParser"]
import re
@@ -28,20 +28,20 @@
from collections import deque
from io import StringIO
-NLCRE = re.compile(r'\r\n|\r|\n')
-NLCRE_bol = re.compile(r'(\r\n|\r|\n)')
-NLCRE_eol = re.compile(r'(\r\n|\r|\n)\Z')
-NLCRE_crack = re.compile(r'(\r\n|\r|\n)')
+NLCRE = re.compile(r"\r\n|\r|\n")
+NLCRE_bol = re.compile(r"(\r\n|\r|\n)")
+NLCRE_eol = re.compile(r"(\r\n|\r|\n)\Z")
+NLCRE_crack = re.compile(r"(\r\n|\r|\n)")
# RFC 2822 $3.6.8 Optional fields. ftext is %d33-57 / %d59-126, Any character
# except controls, SP, and ":".
-headerRE = re.compile(r'^(From |[\041-\071\073-\176]*:|[\t ])')
-EMPTYSTRING = ''
-NL = '\n'
+headerRE = re.compile(r"^(From |[\041-\071\073-\176]*:|[\t ])")
+EMPTYSTRING = ""
+NL = "\n"
NeedMoreData = object()
-
+
class BufferedSubFile(object):
"""A file-ish object that can have new data loaded into it.
@@ -53,7 +53,7 @@ class BufferedSubFile(object):
def __init__(self):
# Text stream of the last partial line pushed into this object.
# See issue 22233 for why this is a text stream and not a list.
- self._partial = StringIO(newline='')
+ self._partial = StringIO(newline="")
# A deque of full, pushed lines
self._lines = deque()
# The stack of false-EOF checking predicates.
@@ -78,7 +78,7 @@ def close(self):
def readline(self):
if not self._lines:
if self._closed:
- return ''
+ return ""
return NeedMoreData
# Pop the line off the stack and see if it matches the current
# false-EOF predicate.
@@ -90,7 +90,7 @@ def readline(self):
if ateof(line):
# We're at the false EOF. But push the last line back first.
self._lines.appendleft(line)
- return ''
+ return ""
return line
def unreadline(self, line):
@@ -101,7 +101,7 @@ def unreadline(self, line):
def push(self, data):
"""Push some new data into this object."""
self._partial.write(data)
- if '\n' not in data and '\r' not in data:
+ if "\n" not in data and "\r" not in data:
# No new complete lines, wait for more.
return
@@ -115,7 +115,7 @@ def push(self, data):
# it as a partial line. We only check for '\n' here because a line
# ending with '\r' might be a line that was split in the middle of a
# '\r\n' sequence (see bugs 1555570 and 1721862).
- if not parts[-1].endswith('\n'):
+ if not parts[-1].endswith("\n"):
self._partial.write(parts.pop())
self.pushlines(parts)
@@ -127,12 +127,12 @@ def __iter__(self):
def __next__(self):
line = self.readline()
- if line == '':
+ if line == "":
raise StopIteration
return line
-
+
class FeedParser:
"""A feed-style parser of email."""
@@ -188,7 +188,7 @@ def close(self):
root = self._pop_message()
assert not self._msgstack
# Look for final set of defects
- if root.get_content_maintype() == 'multipart' \
+ if root.get_content_maintype() == "multipart" \
and not root.is_multipart():
defect = errors.MultipartInvariantViolationDefect()
self.policy.handle_defect(root, defect)
@@ -199,8 +199,8 @@ def _new_message(self):
msg = self._factory()
else:
msg = self._factory(policy=self.policy)
- if self._cur and self._cur.get_content_type() == 'multipart/digest':
- msg.set_default_type('message/rfc822')
+ if self._cur and self._cur.get_content_type() == "multipart/digest":
+ msg.set_default_type("message/rfc822")
if self._msgstack:
self._msgstack[-1].attach(msg)
self._msgstack.append(msg)
@@ -248,12 +248,12 @@ def _parsegen(self):
if line is NeedMoreData:
yield NeedMoreData
continue
- if line == '':
+ if line == "":
break
lines.append(line)
self._cur.set_payload(EMPTYSTRING.join(lines))
return
- if self._cur.get_content_type() == 'message/delivery-status':
+ if self._cur.get_content_type() == "message/delivery-status":
# message/delivery-status contains blocks of headers separated by
# a blank line. We'll represent each header block as a separate
# nested message object, but the processing is a bit different
@@ -287,12 +287,12 @@ def _parsegen(self):
yield NeedMoreData
continue
break
- if line == '':
+ if line == "":
break
# Not at EOF so this is a line we're going to need.
self._input.unreadline(line)
return
- if self._cur.get_content_maintype() == 'message':
+ if self._cur.get_content_maintype() == "message":
# The message claims to be a message/* type, then what follows is
# another RFC 2822 message.
for retval in self._parsegen():
@@ -302,7 +302,7 @@ def _parsegen(self):
break
self._pop_message()
return
- if self._cur.get_content_maintype() == 'multipart':
+ if self._cur.get_content_maintype() == "multipart":
boundary = self._cur.get_boundary()
if boundary is None:
# The message /claims/ to be a multipart but it has not
@@ -320,18 +320,18 @@ def _parsegen(self):
self._cur.set_payload(EMPTYSTRING.join(lines))
return
# Make sure a valid content type was specified per RFC 2045:6.4.
- if (str(self._cur.get('content-transfer-encoding', '8bit')).lower()
- not in ('7bit', '8bit', 'binary')):
+ if (str(self._cur.get("content-transfer-encoding", "8bit")).lower()
+ not in ("7bit", "8bit", "binary")):
defect = errors.InvalidMultipartContentTransferEncodingDefect()
self.policy.handle_defect(self._cur, defect)
# Create a line match predicate which matches the inter-part
# boundary as well as the end-of-multipart boundary. Don't push
# this onto the input stream until we've scanned past the
# preamble.
- separator = '--' + boundary
+ separator = "--" + boundary
boundaryre = re.compile(
- '(?P' + re.escape(separator) +
- r')(?P--)?(?P[ \t]*)(?P\r\n|\r|\n)?$')
+ "(?P" + re.escape(separator) +
+ r")(?P--)?(?P[ \t]*)(?P\r\n|\r|\n)?$")
capturing_preamble = True
preamble = []
linesep = False
@@ -341,7 +341,7 @@ def _parsegen(self):
if line is NeedMoreData:
yield NeedMoreData
continue
- if line == '':
+ if line == "":
break
mo = boundaryre.match(line)
if mo:
@@ -349,9 +349,9 @@ def _parsegen(self):
# this multipart. If there was a newline at the end of
# the closing boundary, then we need to initialize the
# epilogue with the empty string (see below).
- if mo.group('end'):
+ if mo.group("end"):
close_boundary_seen = True
- linesep = mo.group('linesep')
+ linesep = mo.group("linesep")
break
# We saw an inter-part boundary. Were we in the preamble?
if capturing_preamble:
@@ -391,9 +391,9 @@ def _parsegen(self):
# separator actually belongs to the boundary, not the
# previous subpart's payload (or epilogue if the previous
# part is a multipart).
- if self._last.get_content_maintype() == 'multipart':
+ if self._last.get_content_maintype() == "multipart":
epilogue = self._last.epilogue
- if epilogue == '':
+ if epilogue == "":
self._last.epilogue = None
elif epilogue is not None:
mo = NLCRE_eol.search(epilogue)
@@ -440,7 +440,7 @@ def _parsegen(self):
# ended in a newline, we'll need to make sure the epilogue isn't
# None
if linesep:
- epilogue = ['']
+ epilogue = [""]
else:
epilogue = []
for line in self._input:
@@ -470,11 +470,11 @@ def _parsegen(self):
def _parse_headers(self, lines):
# Passed a list of lines that make up the headers for the current msg
- lastheader = ''
+ lastheader = ""
lastvalue = []
for lineno, line in enumerate(lines):
# Check for continuation
- if line[0] in ' \t':
+ if line[0] in " \t":
if not lastheader:
# The first line of the headers was a continuation. This
# is illegal, so let's note the defect, store the illegal
@@ -486,9 +486,9 @@ def _parse_headers(self, lines):
continue
if lastheader:
self._cur.set_raw(*self.policy.header_source_parse(lastvalue))
- lastheader, lastvalue = '', []
+ lastheader, lastvalue = "", []
# Check for envelope header, i.e. unix-from
- if line.startswith('From '):
+ if line.startswith("From "):
if lineno == 0:
# Strip off the trailing newline
mo = NLCRE_eol.search(line)
@@ -511,7 +511,7 @@ def _parse_headers(self, lines):
# Split the line on the colon separating field name from value.
# There will always be a colon, because if there wasn't the part of
# the parser that calls us would have started parsing the body.
- i = line.find(':')
+ i = line.find(":")
# If the colon is on the start of the line the header is clearly
# malformed, but we might be able to salvage the rest of the
@@ -533,4 +533,4 @@ class BytesFeedParser(FeedParser):
"""Like FeedParser, but feed accepts bytes."""
def feed(self, data):
- super().feed(data.decode('ascii', 'surrogateescape'))
+ super().feed(data.decode("ascii", "surrogateescape"))
diff --git a/.venv3.10/Lib/email/generator.py b/.venv3.10/Lib/email/generator.py
index 89224ae4..6381c2cb 100644
--- a/.venv3.10/Lib/email/generator.py
+++ b/.venv3.10/Lib/email/generator.py
@@ -4,7 +4,7 @@
"""Classes to generate plain text from a message object tree."""
-__all__ = ['Generator', 'DecodedGenerator', 'BytesGenerator']
+__all__ = ["Generator", "DecodedGenerator", "BytesGenerator"]
import re
import sys
@@ -16,15 +16,15 @@
from email.utils import _has_surrogates
from email.errors import HeaderWriteError
-UNDERSCORE = '_'
-NL = '\n' # XXX: no longer used by the code below.
+UNDERSCORE = "_"
+NL = "\n" # XXX: no longer used by the code below.
+
+NLCRE = re.compile(r"\r\n|\r|\n")
+fcre = re.compile(r"^From ", re.MULTILINE)
+NEWLINE_WITHOUT_FWSP = re.compile(r"\r\n[^ \t]|\r[^ \n\t]|\n[^ \t]")
-NLCRE = re.compile(r'\r\n|\r|\n')
-fcre = re.compile(r'^From ', re.MULTILINE)
-NEWLINE_WITHOUT_FWSP = re.compile(r'\r\n[^ \t]|\r[^ \n\t]|\n[^ \t]')
-
class Generator:
"""Generates output from a Message object tree.
@@ -99,7 +99,7 @@ def flatten(self, msg, unixfrom=False, linesep=None):
policy = policy.clone(max_line_length=self.maxheaderlen)
self._NL = policy.linesep
self._encoded_NL = self._encode(self._NL)
- self._EMPTY = ''
+ self._EMPTY = ""
self._encoded_EMPTY = self._encode(self._EMPTY)
# Because we use clone (below) when we recursively process message
# subparts, and because clone uses the computed policy (not None),
@@ -113,7 +113,7 @@ def flatten(self, msg, unixfrom=False, linesep=None):
if unixfrom:
ufrom = msg.get_unixfrom()
if not ufrom:
- ufrom = 'From nobody ' + time.ctime(time.time())
+ ufrom = "From nobody " + time.ctime(time.time())
self.write(ufrom + self._NL)
self._write(msg)
finally:
@@ -189,14 +189,14 @@ def _write(self, msg):
if munge_cte:
msg = deepcopy(msg)
# Preserve the header order if the CTE header already exists.
- if msg.get('content-transfer-encoding') is None:
- msg['Content-Transfer-Encoding'] = munge_cte[0]
+ if msg.get("content-transfer-encoding") is None:
+ msg["Content-Transfer-Encoding"] = munge_cte[0]
else:
- msg.replace_header('content-transfer-encoding', munge_cte[0])
- msg.replace_header('content-type', munge_cte[1])
+ msg.replace_header("content-transfer-encoding", munge_cte[0])
+ msg.replace_header("content-type", munge_cte[1])
# Write the headers. First we see if the message object wants to
# handle that itself. If not, we'll do it generically.
- meth = getattr(msg, '_write_headers', None)
+ meth = getattr(msg, "_write_headers", None)
if meth is None:
self._write_headers(msg)
else:
@@ -210,11 +210,11 @@ def _dispatch(self, msg):
# that's missing too, then dispatch to self._writeBody().
main = msg.get_content_maintype()
sub = msg.get_content_subtype()
- specific = UNDERSCORE.join((main, sub)).replace('-', '_')
- meth = getattr(self, '_handle_' + specific, None)
+ specific = UNDERSCORE.join((main, sub)).replace("-", "_")
+ meth = getattr(self, "_handle_" + specific, None)
if meth is None:
- generic = main.replace('-', '_')
- meth = getattr(self, '_handle_' + generic, None)
+ generic = main.replace("-", "_")
+ meth = getattr(self, "_handle_" + generic, None)
if meth is None:
meth = self._writeBody
meth(msg)
@@ -230,10 +230,10 @@ def _write_headers(self, msg):
linesep = self.policy.linesep
if not folded.endswith(self.policy.linesep):
raise HeaderWriteError(
- f'folded header does not end with {linesep!r}: {folded!r}')
+ f"folded header does not end with {linesep!r}: {folded!r}")
if NEWLINE_WITHOUT_FWSP.search(folded.removesuffix(linesep)):
raise HeaderWriteError(
- f'folded header contains newline: {folded!r}')
+ f"folded header contains newline: {folded!r}")
self.write(folded)
# A blank line always separates headers from body
self.write(self._NL)
@@ -247,20 +247,20 @@ def _handle_text(self, msg):
if payload is None:
return
if not isinstance(payload, str):
- raise TypeError('string payload expected: %s' % type(payload))
+ raise TypeError("string payload expected: %s" % type(payload))
if _has_surrogates(msg._payload):
- charset = msg.get_param('charset')
+ charset = msg.get_param("charset")
if charset is not None:
# XXX: This copy stuff is an ugly hack to avoid modifying the
# existing message.
msg = deepcopy(msg)
- del msg['content-transfer-encoding']
+ del msg["content-transfer-encoding"]
msg.set_payload(payload, charset)
payload = msg.get_payload()
- self._munge_cte = (msg['content-transfer-encoding'],
- msg['content-type'])
+ self._munge_cte = (msg["content-transfer-encoding"],
+ msg["content-type"])
if self._mangle_from_:
- payload = fcre.sub('>From ', payload)
+ payload = fcre.sub(">From ", payload)
self._write_lines(payload)
# Default body handler
@@ -297,13 +297,13 @@ def _handle_multipart(self, msg):
# If there's a preamble, write it out, with a trailing CRLF
if msg.preamble is not None:
if self._mangle_from_:
- preamble = fcre.sub('>From ', msg.preamble)
+ preamble = fcre.sub(">From ", msg.preamble)
else:
preamble = msg.preamble
self._write_lines(preamble)
self.write(self._NL)
# dash-boundary transport-padding CRLF
- self.write('--' + boundary + self._NL)
+ self.write("--" + boundary + self._NL)
# body-part
if msgtexts:
self._fp.write(msgtexts.pop(0))
@@ -312,14 +312,14 @@ def _handle_multipart(self, msg):
# --> CRLF body-part
for body_part in msgtexts:
# delimiter transport-padding CRLF
- self.write(self._NL + '--' + boundary + self._NL)
+ self.write(self._NL + "--" + boundary + self._NL)
# body-part
self._fp.write(body_part)
# close-delimiter transport-padding
- self.write(self._NL + '--' + boundary + '--' + self._NL)
+ self.write(self._NL + "--" + boundary + "--" + self._NL)
if msg.epilogue is not None:
if self._mangle_from_:
- epilogue = fcre.sub('>From ', msg.epilogue)
+ epilogue = fcre.sub(">From ", msg.epilogue)
else:
epilogue = msg.epilogue
self._write_lines(epilogue)
@@ -386,16 +386,16 @@ def _make_boundary(cls, text=None):
# Craft a random boundary. If text is given, ensure that the chosen
# boundary doesn't appear in the text.
token = random.randrange(sys.maxsize)
- boundary = ('=' * 15) + (_fmt % token) + '=='
+ boundary = ("=" * 15) + (_fmt % token) + "=="
if text is None:
return boundary
b = boundary
counter = 0
while True:
- cre = cls._compile_re('^--' + re.escape(b) + '(--)?$', re.MULTILINE)
+ cre = cls._compile_re("^--" + re.escape(b) + "(--)?$", re.MULTILINE)
if not cre.search(text):
break
- b = boundary + '.' + str(counter)
+ b = boundary + "." + str(counter)
counter += 1
return b
@@ -403,7 +403,7 @@ def _make_boundary(cls, text=None):
def _compile_re(cls, s, flags):
return re.compile(s, flags)
-
+
class BytesGenerator(Generator):
"""Generates a bytes version of a Message object tree.
@@ -418,13 +418,13 @@ class BytesGenerator(Generator):
"""
def write(self, s):
- self._fp.write(s.encode('ascii', 'surrogateescape'))
+ self._fp.write(s.encode("ascii", "surrogateescape"))
def _new_buffer(self):
return BytesIO()
def _encode(self, s):
- return s.encode('ascii')
+ return s.encode("ascii")
def _write_headers(self, msg):
# This is almost the same as the string version, except for handling
@@ -439,7 +439,7 @@ def _handle_text(self, msg):
# just write it back out.
if msg._payload is None:
return
- if _has_surrogates(msg._payload) and not self.policy.cte_type=='7bit':
+ if _has_surrogates(msg._payload) and not self.policy.cte_type=="7bit":
if self._mangle_from_:
msg._payload = fcre.sub(">From ", msg._payload)
self._write_lines(msg._payload)
@@ -451,11 +451,11 @@ def _handle_text(self, msg):
@classmethod
def _compile_re(cls, s, flags):
- return re.compile(s.encode('ascii'), flags)
+ return re.compile(s.encode("ascii"), flags)
-
-_FMT = '[Non-text (%(type)s) part of message omitted, filename %(filename)s]'
+
+_FMT = "[Non-text (%(type)s) part of message omitted, filename %(filename)s]"
class DecodedGenerator(Generator):
"""Generates a text representation of a message.
@@ -496,28 +496,28 @@ def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, fmt=None, *,
def _dispatch(self, msg):
for part in msg.walk():
maintype = part.get_content_maintype()
- if maintype == 'text':
+ if maintype == "text":
print(part.get_payload(decode=False), file=self)
- elif maintype == 'multipart':
+ elif maintype == "multipart":
# Just skip this
pass
else:
print(self._fmt % {
- 'type' : part.get_content_type(),
- 'maintype' : part.get_content_maintype(),
- 'subtype' : part.get_content_subtype(),
- 'filename' : part.get_filename('[no filename]'),
- 'description': part.get('Content-Description',
- '[no description]'),
- 'encoding' : part.get('Content-Transfer-Encoding',
- '[no encoding]'),
+ "type" : part.get_content_type(),
+ "maintype" : part.get_content_maintype(),
+ "subtype" : part.get_content_subtype(),
+ "filename" : part.get_filename("[no filename]"),
+ "description": part.get("Content-Description",
+ "[no description]"),
+ "encoding" : part.get("Content-Transfer-Encoding",
+ "[no encoding]"),
}, file=self)
-
+
# Helper used by Generator._make_boundary
_width = len(repr(sys.maxsize-1))
-_fmt = '%%0%dd' % _width
+_fmt = "%%0%dd" % _width
# Backward compatibility
_make_boundary = Generator._make_boundary
diff --git a/.venv3.10/Lib/email/header.py b/.venv3.10/Lib/email/header.py
index 4ab0032b..6a7db87f 100644
--- a/.venv3.10/Lib/email/header.py
+++ b/.venv3.10/Lib/email/header.py
@@ -5,9 +5,9 @@
"""Header encoding and decoding functionality."""
__all__ = [
- 'Header',
- 'decode_header',
- 'make_header',
+ "Header",
+ "decode_header",
+ "make_header",
]
import re
@@ -20,19 +20,19 @@
from email import charset as _charset
Charset = _charset.Charset
-NL = '\n'
-SPACE = ' '
-BSPACE = b' '
-SPACE8 = ' ' * 8
-EMPTYSTRING = ''
+NL = "\n"
+SPACE = " "
+BSPACE = b" "
+SPACE8 = " " * 8
+EMPTYSTRING = ""
MAXLINELEN = 78
-FWS = ' \t'
+FWS = " \t"
-USASCII = Charset('us-ascii')
-UTF8 = Charset('utf-8')
+USASCII = Charset("us-ascii")
+UTF8 = Charset("utf-8")
# Match encoded-word strings in the form =?charset?q?Hello_World?=
-ecre = re.compile(r'''
+ecre = re.compile(r"""
=\? # literal =?
(?P[^?]*?) # non-greedy up to the next ? is the charset
\? # literal ?
@@ -40,24 +40,24 @@
\? # literal ?
(?P.*?) # non-greedy up to the next ?= is the encoded string
\?= # literal ?=
- ''', re.VERBOSE | re.MULTILINE)
+ """, re.VERBOSE | re.MULTILINE)
# Field name regexp, including trailing colon, but not separating whitespace,
# according to RFC 2822. Character range is from tilde to exclamation mark.
# For use with .match()
-fcre = re.compile(r'[\041-\176]+:$')
+fcre = re.compile(r"[\041-\176]+:$")
# Find a header embedded in a putative header value. Used to check for
# header injection attack.
-_embedded_header = re.compile(r'\n[^ \t]+:')
+_embedded_header = re.compile(r"\n[^ \t]+:")
+
-
# Helpers
_max_append = email.quoprimime._max_append
-
+
def decode_header(header):
"""Decode a message header value without converting charset.
@@ -73,7 +73,7 @@ def decode_header(header):
occurs (e.g. a base64 decoding exception).
"""
# If it is a Header object, we can just return the encoded chunks.
- if hasattr(header, '_chunks'):
+ if hasattr(header, "_chunks"):
return [(_charset._encode(string, str(charset)), str(charset))
for string, charset in header._chunks]
# If no encoding, just return the header with no charset.
@@ -115,28 +115,28 @@ def decode_header(header):
if encoding is None:
# This is an unencoded word.
decoded_words.append((encoded_string, charset))
- elif encoding == 'q':
+ elif encoding == "q":
word = email.quoprimime.header_decode(encoded_string)
decoded_words.append((word, charset))
- elif encoding == 'b':
+ elif encoding == "b":
paderr = len(encoded_string) % 4 # Postel's law: add missing padding
if paderr:
- encoded_string += '==='[:4 - paderr]
+ encoded_string += "==="[:4 - paderr]
try:
word = email.base64mime.decode(encoded_string)
except binascii.Error:
- raise HeaderParseError('Base64 decoding error')
+ raise HeaderParseError("Base64 decoding error")
else:
decoded_words.append((word, charset))
else:
- raise AssertionError('Unexpected encoding: ' + encoding)
+ raise AssertionError("Unexpected encoding: " + encoding)
# Now convert all words to bytes and collapse consecutive runs of
# similarly encoded words.
collapsed = []
last_word = last_charset = None
for word, charset in decoded_words:
if isinstance(word, str):
- word = bytes(word, 'raw-unicode-escape')
+ word = bytes(word, "raw-unicode-escape")
if last_word is None:
last_word = word
last_charset = charset
@@ -152,9 +152,9 @@ def decode_header(header):
return collapsed
-
+
def make_header(decoded_seq, maxlinelen=None, header_name=None,
- continuation_ws=' '):
+ continuation_ws=" "):
"""Create a Header from a sequence of pairs as returned by decode_header()
decode_header() takes a header value string and returns a sequence of
@@ -175,11 +175,11 @@ def make_header(decoded_seq, maxlinelen=None, header_name=None,
return h
-
+
class Header:
def __init__(self, s=None, charset=None,
maxlinelen=None, header_name=None,
- continuation_ws=' ', errors='strict'):
+ continuation_ws=" ", errors="strict"):
"""Create a MIME-compliant header that can contain many character sets.
Optional s is the initial header value. If None, the initial header
@@ -239,15 +239,15 @@ def __str__(self):
# a space (trailing or leading depending on transition)
nextcs = charset
if nextcs == _charset.UNKNOWN8BIT:
- original_bytes = string.encode('ascii', 'surrogateescape')
- string = original_bytes.decode('ascii', 'replace')
+ original_bytes = string.encode("ascii", "surrogateescape")
+ string = original_bytes.decode("ascii", "replace")
if uchunks:
hasspace = string and self._nonctext(string[0])
- if lastcs not in (None, 'us-ascii'):
- if nextcs in (None, 'us-ascii') and not hasspace:
+ if lastcs not in (None, "us-ascii"):
+ if nextcs in (None, "us-ascii") and not hasspace:
uchunks.append(SPACE)
nextcs = None
- elif nextcs not in (None, 'us-ascii') and not lastspace:
+ elif nextcs not in (None, "us-ascii") and not lastspace:
uchunks.append(SPACE)
lastspace = string and self._nonctext(string[-1])
lastcs = nextcs
@@ -262,7 +262,7 @@ def __eq__(self, other):
# args and do another comparison.
return other == str(self)
- def append(self, s, charset=None, errors='strict'):
+ def append(self, s, charset=None, errors="strict"):
"""Append a string to the MIME header.
Optional charset, if given, should be a Charset instance or the name
@@ -288,19 +288,19 @@ def append(self, s, charset=None, errors='strict'):
elif not isinstance(charset, Charset):
charset = Charset(charset)
if not isinstance(s, str):
- input_charset = charset.input_codec or 'us-ascii'
+ input_charset = charset.input_codec or "us-ascii"
if input_charset == _charset.UNKNOWN8BIT:
- s = s.decode('us-ascii', 'surrogateescape')
+ s = s.decode("us-ascii", "surrogateescape")
else:
s = s.decode(input_charset, errors)
# Ensure that the bytes we're storing can be decoded to the output
# character set, otherwise an early error is raised.
- output_charset = charset.output_codec or 'us-ascii'
+ output_charset = charset.output_codec or "us-ascii"
if output_charset != _charset.UNKNOWN8BIT:
try:
s.encode(output_charset, errors)
except UnicodeEncodeError:
- if output_charset!='us-ascii':
+ if output_charset!="us-ascii":
raise
charset = UTF8
self._chunks.append((s, charset))
@@ -308,9 +308,9 @@ def append(self, s, charset=None, errors='strict'):
def _nonctext(self, s):
"""True if string s is not a ctext character of RFC822.
"""
- return s.isspace() or s in ('(', ')', '\\')
+ return s.isspace() or s in ("(", ")", "\\")
- def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
+ def encode(self, splitchars=";, \t", maxlinelen=None, linesep="\n"):
r"""Encode a message header into an RFC-compliant format.
There are many issues involved in converting a given string for use in
@@ -358,23 +358,23 @@ def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
for string, charset in self._chunks:
if hasspace is not None:
hasspace = string and self._nonctext(string[0])
- if lastcs not in (None, 'us-ascii'):
- if not hasspace or charset not in (None, 'us-ascii'):
+ if lastcs not in (None, "us-ascii"):
+ if not hasspace or charset not in (None, "us-ascii"):
formatter.add_transition()
- elif charset not in (None, 'us-ascii') and not lastspace:
+ elif charset not in (None, "us-ascii") and not lastspace:
formatter.add_transition()
lastspace = string and self._nonctext(string[-1])
lastcs = charset
hasspace = False
lines = string.splitlines()
if lines:
- formatter.feed('', lines[0], charset)
+ formatter.feed("", lines[0], charset)
else:
- formatter.feed('', '', charset)
+ formatter.feed("", "", charset)
for line in lines[1:]:
formatter.newline()
if charset.header_encoding is not None:
- formatter.feed(self._continuation_ws, ' ' + line.lstrip(),
+ formatter.feed(self._continuation_ws, " " + line.lstrip(),
charset)
else:
sline = line.lstrip()
@@ -409,7 +409,7 @@ def _normalize(self):
self._chunks = chunks
-
+
class _ValueFormatter:
def __init__(self, headerlen, maxlen, continuation_ws, splitchars):
self._maxlen = maxlen
@@ -428,7 +428,7 @@ def __str__(self):
def newline(self):
end_of_line = self._current_line.pop()
- if end_of_line != (' ', ''):
+ if end_of_line != (" ", ""):
self._current_line.push(*end_of_line)
if len(self._current_line) > 0:
if self._current_line.is_onlyws() and self._lines:
@@ -438,7 +438,7 @@ def newline(self):
self._current_line.reset()
def add_transition(self):
- self._current_line.push(' ', '')
+ self._current_line.push(" ", "")
def feed(self, fws, string, charset):
# If the charset has no header encoding (i.e. it is an ASCII encoding)
@@ -499,7 +499,7 @@ def _ascii_split(self, fws, string, splitchars):
# single spaces or tabs.)
parts = re.split("(["+FWS+"]+)", fws+string)
if parts[0]:
- parts[:0] = ['']
+ parts[:0] = [""]
else:
parts.pop(0)
for fws, part in zip(*[iter(parts)]*2):
@@ -530,7 +530,7 @@ def _append_chunk(self, fws, string):
if not fws:
# We don't use continuation_ws here because the whitespace
# after a header should always be a space.
- fws = ' '
+ fws = " "
self._current_line.push(fws, part)
return
remainder = self._current_line.pop_from(i)
@@ -554,7 +554,7 @@ def pop_from(self, i=0):
def pop(self):
if self.part_count()==0:
- return ('', '')
+ return ("", "")
return super().pop()
def __len__(self):
diff --git a/.venv3.10/Lib/email/headerregistry.py b/.venv3.10/Lib/email/headerregistry.py
index b590d69e..6a7dd9f7 100644
--- a/.venv3.10/Lib/email/headerregistry.py
+++ b/.venv3.10/Lib/email/headerregistry.py
@@ -11,7 +11,7 @@
class Address:
- def __init__(self, display_name='', username='', domain='', addr_spec=None):
+ def __init__(self, display_name="", username="", domain="", addr_spec=None):
"""Create an object representing a full email address.
An address can have a 'display_name', a 'username', and a 'domain'. In
@@ -28,8 +28,8 @@ def __init__(self, display_name='', username='', domain='', addr_spec=None):
"""
- inputs = ''.join(filter(None, (display_name, username, domain, addr_spec)))
- if '\r' in inputs or '\n' in inputs:
+ inputs = "".join(filter(None, (display_name, username, domain, addr_spec)))
+ if "\r" in inputs or "\n" in inputs:
raise ValueError("invalid arguments; address parts cannot contain CR or LF")
# This clause with its potential 'raise' may only happen when an
@@ -74,9 +74,9 @@ def addr_spec(self):
if not parser.DOT_ATOM_ENDS.isdisjoint(lp):
lp = parser.quote_string(lp)
if self.domain:
- return lp + '@' + self.domain
+ return lp + "@" + self.domain
if not lp:
- return '<>'
+ return "<>"
return lp
def __repr__(self):
@@ -89,7 +89,7 @@ def __str__(self):
if not parser.SPECIALS.isdisjoint(disp):
disp = parser.quote_string(disp)
if disp:
- addr_spec = '' if self.addr_spec=='<>' else self.addr_spec
+ addr_spec = "" if self.addr_spec=="<>" else self.addr_spec
return "{} <{}>".format(disp, addr_spec)
return self.addr_spec
@@ -141,7 +141,7 @@ def __str__(self):
if disp is not None and not parser.SPECIALS.isdisjoint(disp):
disp = parser.quote_string(disp)
adrstr = ", ".join(str(x) for x in self.addresses)
- adrstr = ' ' + adrstr if adrstr else adrstr
+ adrstr = " " + adrstr if adrstr else adrstr
return "{}:{};".format(disp, adrstr)
def __eq__(self, other):
@@ -188,12 +188,12 @@ class with the remaining arguments and keywords.
"""
def __new__(cls, name, value):
- kwds = {'defects': []}
+ kwds = {"defects": []}
cls.parse(value, kwds)
- if utils._has_surrogates(kwds['decoded']):
- kwds['decoded'] = utils._sanitize(kwds['decoded'])
- self = str.__new__(cls, kwds['decoded'])
- del kwds['decoded']
+ if utils._has_surrogates(kwds["decoded"]):
+ kwds["decoded"] = utils._sanitize(kwds["decoded"])
+ self = str.__new__(cls, kwds["decoded"])
+ del kwds["decoded"]
self.init(name, **kwds)
return self
@@ -243,12 +243,12 @@ def fold(self, *, policy):
# At some point we need to put fws here if it was in the source.
header = parser.Header([
parser.HeaderLabel([
- parser.ValueTerminal(self.name, 'header-name'),
- parser.ValueTerminal(':', 'header-sep')]),
+ parser.ValueTerminal(self.name, "header-name"),
+ parser.ValueTerminal(":", "header-sep")]),
])
if self._parse_tree:
header.append(
- parser.CFWSList([parser.WhiteSpaceTerminal(' ', 'fws')]))
+ parser.CFWSList([parser.WhiteSpaceTerminal(" ", "fws")]))
header.append(self._parse_tree)
return header.fold(policy=policy)
@@ -264,8 +264,8 @@ class UnstructuredHeader:
@classmethod
def parse(cls, value, kwds):
- kwds['parse_tree'] = cls.value_parser(value)
- kwds['decoded'] = str(kwds['parse_tree'])
+ kwds["parse_tree"] = cls.value_parser(value)
+ kwds["decoded"] = str(kwds["parse_tree"])
class UniqueUnstructuredHeader(UnstructuredHeader):
@@ -292,26 +292,26 @@ class DateHeader:
@classmethod
def parse(cls, value, kwds):
if not value:
- kwds['defects'].append(errors.HeaderMissingRequiredValue())
- kwds['datetime'] = None
- kwds['decoded'] = ''
- kwds['parse_tree'] = parser.TokenList()
+ kwds["defects"].append(errors.HeaderMissingRequiredValue())
+ kwds["datetime"] = None
+ kwds["decoded"] = ""
+ kwds["parse_tree"] = parser.TokenList()
return
if isinstance(value, str):
- kwds['decoded'] = value
+ kwds["decoded"] = value
try:
value = utils.parsedate_to_datetime(value)
except ValueError:
- kwds['defects'].append(errors.InvalidDateDefect('Invalid date value or format'))
- kwds['datetime'] = None
- kwds['parse_tree'] = parser.TokenList()
+ kwds["defects"].append(errors.InvalidDateDefect("Invalid date value or format"))
+ kwds["datetime"] = None
+ kwds["parse_tree"] = parser.TokenList()
return
- kwds['datetime'] = value
- kwds['decoded'] = utils.format_datetime(kwds['datetime'])
- kwds['parse_tree'] = cls.value_parser(kwds['decoded'])
+ kwds["datetime"] = value
+ kwds["decoded"] = utils.format_datetime(kwds["datetime"])
+ kwds["parse_tree"] = cls.value_parser(kwds["decoded"])
def init(self, *args, **kw):
- self._datetime = kw.pop('datetime')
+ self._datetime = kw.pop("datetime")
super().init(*args, **kw)
@property
@@ -331,7 +331,7 @@ class AddressHeader:
@staticmethod
def value_parser(value):
address_list, value = parser.get_address_list(value)
- assert not value, 'this should not happen'
+ assert not value, "this should not happen"
return address_list
@classmethod
@@ -339,31 +339,31 @@ def parse(cls, value, kwds):
if isinstance(value, str):
# We are translating here from the RFC language (address/mailbox)
# to our API language (group/address).
- kwds['parse_tree'] = address_list = cls.value_parser(value)
+ kwds["parse_tree"] = address_list = cls.value_parser(value)
groups = []
for addr in address_list.addresses:
groups.append(Group(addr.display_name,
- [Address(mb.display_name or '',
- mb.local_part or '',
- mb.domain or '')
+ [Address(mb.display_name or "",
+ mb.local_part or "",
+ mb.domain or "")
for mb in addr.all_mailboxes]))
defects = list(address_list.all_defects)
else:
# Assume it is Address/Group stuff
- if not hasattr(value, '__iter__'):
+ if not hasattr(value, "__iter__"):
value = [value]
- groups = [Group(None, [item]) if not hasattr(item, 'addresses')
+ groups = [Group(None, [item]) if not hasattr(item, "addresses")
else item
for item in value]
defects = []
- kwds['groups'] = groups
- kwds['defects'] = defects
- kwds['decoded'] = ', '.join([str(item) for item in groups])
- if 'parse_tree' not in kwds:
- kwds['parse_tree'] = cls.value_parser(kwds['decoded'])
+ kwds["groups"] = groups
+ kwds["defects"] = defects
+ kwds["decoded"] = ", ".join([str(item) for item in groups])
+ if "parse_tree" not in kwds:
+ kwds["parse_tree"] = cls.value_parser(kwds["decoded"])
def init(self, *args, **kw):
- self._groups = tuple(kw.pop('groups'))
+ self._groups = tuple(kw.pop("groups"))
self._addresses = None
super().init(*args, **kw)
@@ -407,20 +407,20 @@ class MIMEVersionHeader:
@classmethod
def parse(cls, value, kwds):
- kwds['parse_tree'] = parse_tree = cls.value_parser(value)
- kwds['decoded'] = str(parse_tree)
- kwds['defects'].extend(parse_tree.all_defects)
- kwds['major'] = None if parse_tree.minor is None else parse_tree.major
- kwds['minor'] = parse_tree.minor
+ kwds["parse_tree"] = parse_tree = cls.value_parser(value)
+ kwds["decoded"] = str(parse_tree)
+ kwds["defects"].extend(parse_tree.all_defects)
+ kwds["major"] = None if parse_tree.minor is None else parse_tree.major
+ kwds["minor"] = parse_tree.minor
if parse_tree.minor is not None:
- kwds['version'] = '{}.{}'.format(kwds['major'], kwds['minor'])
+ kwds["version"] = "{}.{}".format(kwds["major"], kwds["minor"])
else:
- kwds['version'] = None
+ kwds["version"] = None
def init(self, *args, **kw):
- self._version = kw.pop('version')
- self._major = kw.pop('major')
- self._minor = kw.pop('minor')
+ self._version = kw.pop("version")
+ self._major = kw.pop("major")
+ self._minor = kw.pop("minor")
super().init(*args, **kw)
@property
@@ -445,19 +445,19 @@ class ParameterizedMIMEHeader:
@classmethod
def parse(cls, value, kwds):
- kwds['parse_tree'] = parse_tree = cls.value_parser(value)
- kwds['decoded'] = str(parse_tree)
- kwds['defects'].extend(parse_tree.all_defects)
+ kwds["parse_tree"] = parse_tree = cls.value_parser(value)
+ kwds["decoded"] = str(parse_tree)
+ kwds["defects"].extend(parse_tree.all_defects)
if parse_tree.params is None:
- kwds['params'] = {}
+ kwds["params"] = {}
else:
# The MIME RFCs specify that parameter ordering is arbitrary.
- kwds['params'] = {utils._sanitize(name).lower():
+ kwds["params"] = {utils._sanitize(name).lower():
utils._sanitize(value)
for name, value in parse_tree.params}
def init(self, *args, **kw):
- self._params = kw.pop('params')
+ self._params = kw.pop("params")
super().init(*args, **kw)
@property
@@ -484,7 +484,7 @@ def subtype(self):
@property
def content_type(self):
- return self.maintype + '/' + self.subtype
+ return self.maintype + "/" + self.subtype
class ContentDispositionHeader(ParameterizedMIMEHeader):
@@ -509,9 +509,9 @@ class ContentTransferEncodingHeader:
@classmethod
def parse(cls, value, kwds):
- kwds['parse_tree'] = parse_tree = cls.value_parser(value)
- kwds['decoded'] = str(parse_tree)
- kwds['defects'].extend(parse_tree.all_defects)
+ kwds["parse_tree"] = parse_tree = cls.value_parser(value)
+ kwds["decoded"] = str(parse_tree)
+ kwds["defects"].extend(parse_tree.all_defects)
def init(self, *args, **kw):
super().init(*args, **kw)
@@ -529,34 +529,34 @@ class MessageIDHeader:
@classmethod
def parse(cls, value, kwds):
- kwds['parse_tree'] = parse_tree = cls.value_parser(value)
- kwds['decoded'] = str(parse_tree)
- kwds['defects'].extend(parse_tree.all_defects)
+ kwds["parse_tree"] = parse_tree = cls.value_parser(value)
+ kwds["decoded"] = str(parse_tree)
+ kwds["defects"].extend(parse_tree.all_defects)
# The header factory #
_default_header_map = {
- 'subject': UniqueUnstructuredHeader,
- 'date': UniqueDateHeader,
- 'resent-date': DateHeader,
- 'orig-date': UniqueDateHeader,
- 'sender': UniqueSingleAddressHeader,
- 'resent-sender': SingleAddressHeader,
- 'to': UniqueAddressHeader,
- 'resent-to': AddressHeader,
- 'cc': UniqueAddressHeader,
- 'resent-cc': AddressHeader,
- 'bcc': UniqueAddressHeader,
- 'resent-bcc': AddressHeader,
- 'from': UniqueAddressHeader,
- 'resent-from': AddressHeader,
- 'reply-to': UniqueAddressHeader,
- 'mime-version': MIMEVersionHeader,
- 'content-type': ContentTypeHeader,
- 'content-disposition': ContentDispositionHeader,
- 'content-transfer-encoding': ContentTransferEncodingHeader,
- 'message-id': MessageIDHeader,
+ "subject": UniqueUnstructuredHeader,
+ "date": UniqueDateHeader,
+ "resent-date": DateHeader,
+ "orig-date": UniqueDateHeader,
+ "sender": UniqueSingleAddressHeader,
+ "resent-sender": SingleAddressHeader,
+ "to": UniqueAddressHeader,
+ "resent-to": AddressHeader,
+ "cc": UniqueAddressHeader,
+ "resent-cc": AddressHeader,
+ "bcc": UniqueAddressHeader,
+ "resent-bcc": AddressHeader,
+ "from": UniqueAddressHeader,
+ "resent-from": AddressHeader,
+ "reply-to": UniqueAddressHeader,
+ "mime-version": MIMEVersionHeader,
+ "content-type": ContentTypeHeader,
+ "content-disposition": ContentDispositionHeader,
+ "content-transfer-encoding": ContentTransferEncodingHeader,
+ "message-id": MessageIDHeader,
}
class HeaderRegistry:
@@ -589,7 +589,7 @@ def map_to_type(self, name, cls):
def __getitem__(self, name):
cls = self.registry.get(name.lower(), self.default_class)
- return type('_'+cls.__name__, (cls, self.base_class), {})
+ return type("_"+cls.__name__, (cls, self.base_class), {})
def __call__(self, name, value):
"""Create a header instance for header 'name' from 'value'.
diff --git a/.venv3.10/Lib/email/iterators.py b/.venv3.10/Lib/email/iterators.py
index b5502ee9..f1dd0410 100644
--- a/.venv3.10/Lib/email/iterators.py
+++ b/.venv3.10/Lib/email/iterators.py
@@ -5,9 +5,9 @@
"""Various types of useful iterators and generators."""
__all__ = [
- 'body_line_iterator',
- 'typed_subpart_iterator',
- 'walk',
+ "body_line_iterator",
+ "typed_subpart_iterator",
+ "walk",
# Do not include _structure() since it's part of the debugging API.
]
@@ -15,7 +15,7 @@
from io import StringIO
-
+
# This function will become a method of the Message class
def walk(self):
"""Walk over the message tree, yielding each subpart.
@@ -29,7 +29,7 @@ def walk(self):
yield from subpart.walk()
-
+
# These two functions are imported into the Iterators.py interface module.
def body_line_iterator(msg, decode=False):
"""Iterate over the parts, returning string payloads line-by-line.
@@ -42,7 +42,7 @@ def body_line_iterator(msg, decode=False):
yield from StringIO(payload)
-def typed_subpart_iterator(msg, maintype='text', subtype=None):
+def typed_subpart_iterator(msg, maintype="text", subtype=None):
"""Iterate over the subparts with a given MIME type.
Use `maintype' as the main MIME type to match against; this defaults to
@@ -55,15 +55,15 @@ def typed_subpart_iterator(msg, maintype='text', subtype=None):
yield subpart
-
+
def _structure(msg, fp=None, level=0, include_default=False):
"""A handy debugging aid"""
if fp is None:
fp = sys.stdout
- tab = ' ' * (level * 4)
- print(tab + msg.get_content_type(), end='', file=fp)
+ tab = " " * (level * 4)
+ print(tab + msg.get_content_type(), end="", file=fp)
if include_default:
- print(' [%s]' % msg.get_default_type(), file=fp)
+ print(" [%s]" % msg.get_default_type(), file=fp)
else:
print(file=fp)
if msg.is_multipart():
diff --git a/.venv3.10/Lib/email/message.py b/.venv3.10/Lib/email/message.py
index 6752ce0f..97fbb87a 100644
--- a/.venv3.10/Lib/email/message.py
+++ b/.venv3.10/Lib/email/message.py
@@ -4,7 +4,7 @@
"""Basic message object for the email package object model."""
-__all__ = ['Message', 'EmailMessage']
+__all__ = ["Message", "EmailMessage"]
import re
import uu
@@ -14,12 +14,12 @@
# Intrapackage imports
from email import utils
from email import errors
-from email._policybase import Policy, compat32
+from email._policybase import compat32
from email import charset as _charset
from email._encoded_words import decode_b
Charset = _charset.Charset
-SEMISPACE = '; '
+SEMISPACE = "; "
# Regular expression that matches `special' characters in parameters, the
# existence of which force quoting of the parameter value.
@@ -31,11 +31,11 @@ def _splitparam(param):
# strictly RFC 2045 (section 5.1) compliant, but it catches most headers
# found in the wild. We may eventually need a full fledged parser.
# RDM: we might have a Header here; for now just stringify it.
- a, sep, b = str(param).partition(';')
+ a, sep, b = str(param).partition(";")
if not sep:
return a.strip(), None
return a.strip(), b.strip()
-
+
def _formatparam(param, value=None, quote=True):
"""Convenience function to format and return a key=value pair.
@@ -51,40 +51,40 @@ def _formatparam(param, value=None, quote=True):
# instance. RFC 2231 encoded values are never quoted, per RFC.
if isinstance(value, tuple):
# Encode as per RFC 2231
- param += '*'
+ param += "*"
value = utils.encode_rfc2231(value[2], value[0], value[1])
- return '%s=%s' % (param, value)
+ return "%s=%s" % (param, value)
else:
try:
- value.encode('ascii')
+ value.encode("ascii")
except UnicodeEncodeError:
- param += '*'
- value = utils.encode_rfc2231(value, 'utf-8', '')
- return '%s=%s' % (param, value)
+ param += "*"
+ value = utils.encode_rfc2231(value, "utf-8", "")
+ return "%s=%s" % (param, value)
# BAW: Please check this. I think that if quote is set it should
# force quoting even if not necessary.
if quote or tspecials.search(value):
return '%s="%s"' % (param, utils.quote(value))
else:
- return '%s=%s' % (param, value)
+ return "%s=%s" % (param, value)
else:
return param
def _parseparam(s):
# RDM This might be a Header, so for now stringify it.
- s = ';' + str(s)
+ s = ";" + str(s)
plist = []
- while s[:1] == ';':
+ while s[:1] == ";":
s = s[1:]
- end = s.find(';')
+ end = s.find(";")
while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
- end = s.find(';', end + 1)
+ end = s.find(";", end + 1)
if end < 0:
end = len(s)
f = s[:end]
- if '=' in f:
- i = f.index('=')
- f = f[:i].strip().lower() + '=' + f[i+1:].strip()
+ if "=" in f:
+ i = f.index("=")
+ f = f[:i].strip().lower() + "=" + f[i+1:].strip()
plist.append(f.strip())
s = s[end:]
return plist
@@ -101,7 +101,7 @@ def _unquotevalue(value):
return utils.unquote(value)
-
+
class Message:
"""Basic message object.
@@ -127,7 +127,7 @@ def __init__(self, policy=compat32):
self.preamble = self.epilogue = None
self.defects = []
# Default content type
- self._default_type = 'text/plain'
+ self._default_type = "text/plain"
def __str__(self):
"""Return the entire formatted message as a string.
@@ -254,40 +254,40 @@ def get_payload(self, i=None, decode=False):
# For backward compatibility, Use isinstance and this error message
# instead of the more logical is_multipart test.
if i is not None and not isinstance(self._payload, list):
- raise TypeError('Expected list, got %s' % type(self._payload))
+ raise TypeError("Expected list, got %s" % type(self._payload))
payload = self._payload
# cte might be a Header, so for now stringify it.
- cte = str(self.get('content-transfer-encoding', '')).lower()
+ cte = str(self.get("content-transfer-encoding", "")).lower()
# payload may be bytes here.
if isinstance(payload, str):
if utils._has_surrogates(payload):
- bpayload = payload.encode('ascii', 'surrogateescape')
+ bpayload = payload.encode("ascii", "surrogateescape")
if not decode:
try:
- payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace')
+ payload = bpayload.decode(self.get_param("charset", "ascii"), "replace")
except LookupError:
- payload = bpayload.decode('ascii', 'replace')
+ payload = bpayload.decode("ascii", "replace")
elif decode:
try:
- bpayload = payload.encode('ascii')
+ bpayload = payload.encode("ascii")
except UnicodeError:
# This won't happen for RFC compliant messages (messages
# containing only ASCII code points in the unicode input).
# If it does happen, turn the string into bytes in a way
# guaranteed not to fail.
- bpayload = payload.encode('raw-unicode-escape')
+ bpayload = payload.encode("raw-unicode-escape")
if not decode:
return payload
- if cte == 'quoted-printable':
+ if cte == "quoted-printable":
return quopri.decodestring(bpayload)
- elif cte == 'base64':
+ elif cte == "base64":
# XXX: this is a bit of a hack; decode_b should probably be factored
# out somewhere, but I haven't figured out where yet.
- value, defects = decode_b(b''.join(bpayload.splitlines()))
+ value, defects = decode_b(b"".join(bpayload.splitlines()))
for defect in defects:
self.policy.handle_defect(self, defect)
return value
- elif cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'):
+ elif cte in ("x-uuencode", "uuencode", "uue", "x-uue"):
in_file = BytesIO(bpayload)
out_file = BytesIO()
try:
@@ -306,15 +306,15 @@ def set_payload(self, payload, charset=None):
Optional charset sets the message's default character set. See
set_charset() for details.
"""
- if hasattr(payload, 'encode'):
+ if hasattr(payload, "encode"):
if charset is None:
self._payload = payload
return
if not isinstance(charset, Charset):
charset = Charset(charset)
payload = payload.encode(charset.output_charset)
- if hasattr(payload, 'decode'):
- self._payload = payload.decode('ascii', 'surrogateescape')
+ if hasattr(payload, "decode"):
+ self._payload = payload.decode("ascii", "surrogateescape")
else:
self._payload = payload
if charset is not None:
@@ -335,22 +335,22 @@ def set_charset(self, charset):
Content-Type, Content-Transfer-Encoding) will be added as needed.
"""
if charset is None:
- self.del_param('charset')
+ self.del_param("charset")
self._charset = None
return
if not isinstance(charset, Charset):
charset = Charset(charset)
self._charset = charset
- if 'MIME-Version' not in self:
- self.add_header('MIME-Version', '1.0')
- if 'Content-Type' not in self:
- self.add_header('Content-Type', 'text/plain',
+ if "MIME-Version" not in self:
+ self.add_header("MIME-Version", "1.0")
+ if "Content-Type" not in self:
+ self.add_header("Content-Type", "text/plain",
charset=charset.get_output_charset())
else:
- self.set_param('charset', charset.get_output_charset())
+ self.set_param("charset", charset.get_output_charset())
if charset != charset.get_output_charset():
self._payload = charset.body_encode(self._payload)
- if 'Content-Transfer-Encoding' not in self:
+ if "Content-Transfer-Encoding" not in self:
cte = charset.get_body_encoding()
try:
cte(self)
@@ -361,11 +361,11 @@ def set_charset(self, charset):
payload = self._payload
if payload:
try:
- payload = payload.encode('ascii', 'surrogateescape')
+ payload = payload.encode("ascii", "surrogateescape")
except UnicodeError:
payload = payload.encode(charset.output_charset)
self._payload = charset.body_encode(payload)
- self.add_header('Content-Transfer-Encoding', cte)
+ self.add_header("Content-Transfer-Encoding", cte)
def get_charset(self):
"""Return the Charset instance associated with the message's payload.
@@ -535,9 +535,9 @@ def add_header(self, _name, _value, **_params):
parts = []
for k, v in _params.items():
if v is None:
- parts.append(k.replace('_', '-'))
+ parts.append(k.replace("_", "-"))
else:
- parts.append(_formatparam(k.replace('_', '-'), v))
+ parts.append(_formatparam(k.replace("_", "-"), v))
if _value is not None:
parts.insert(0, _value)
self[_name] = SEMISPACE.join(parts)
@@ -575,14 +575,14 @@ def get_content_type(self):
message/rfc822.
"""
missing = object()
- value = self.get('content-type', missing)
+ value = self.get("content-type", missing)
if value is missing:
# This should have no parameters
return self.get_default_type()
ctype = _splitparam(value)[0].lower()
# RFC 2045, section 5.2 says if its invalid, use text/plain
- if ctype.count('/') != 1:
- return 'text/plain'
+ if ctype.count("/") != 1:
+ return "text/plain"
return ctype
def get_content_maintype(self):
@@ -592,7 +592,7 @@ def get_content_maintype(self):
get_content_type().
"""
ctype = self.get_content_type()
- return ctype.split('/')[0]
+ return ctype.split("/")[0]
def get_content_subtype(self):
"""Returns the message's sub-content type.
@@ -601,7 +601,7 @@ def get_content_subtype(self):
get_content_type().
"""
ctype = self.get_content_type()
- return ctype.split('/')[1]
+ return ctype.split("/")[1]
def get_default_type(self):
"""Return the `default' content type.
@@ -631,18 +631,18 @@ def _get_params_preserve(self, failobj, header):
params = []
for p in _parseparam(value):
try:
- name, val = p.split('=', 1)
+ name, val = p.split("=", 1)
name = name.strip()
val = val.strip()
except ValueError:
# Must have been a bare attribute
name = p.strip()
- val = ''
+ val = ""
params.append((name, val))
params = utils.decode_params(params)
return params
- def get_params(self, failobj=None, header='content-type', unquote=True):
+ def get_params(self, failobj=None, header="content-type", unquote=True):
"""Return the message's Content-Type parameters, as a list.
The elements of the returned list are 2-tuples of key/value pairs, as
@@ -664,7 +664,7 @@ def get_params(self, failobj=None, header='content-type', unquote=True):
else:
return params
- def get_param(self, param, failobj=None, header='content-type',
+ def get_param(self, param, failobj=None, header="content-type",
unquote=True):
"""Return the parameter value if found in the Content-Type header.
@@ -698,8 +698,8 @@ def get_param(self, param, failobj=None, header='content-type',
return v
return failobj
- def set_param(self, param, value, header='Content-Type', requote=True,
- charset=None, language='', replace=False):
+ def set_param(self, param, value, header="Content-Type", requote=True,
+ charset=None, language="", replace=False):
"""Set a parameter in the Content-Type header.
If the parameter already exists in the header, its value will be
@@ -719,8 +719,8 @@ def set_param(self, param, value, header='Content-Type', requote=True,
if not isinstance(value, tuple) and charset:
value = (charset, language, value)
- if header not in self and header.lower() == 'content-type':
- ctype = 'text/plain'
+ if header not in self and header.lower() == "content-type":
+ ctype = "text/plain"
else:
ctype = self.get(header)
if not self.get_param(param, header=header):
@@ -730,10 +730,10 @@ def set_param(self, param, value, header='Content-Type', requote=True,
ctype = SEMISPACE.join(
[ctype, _formatparam(param, value, requote)])
else:
- ctype = ''
+ ctype = ""
for old_param, old_value in self.get_params(header=header,
unquote=requote):
- append_param = ''
+ append_param = ""
if old_param.lower() == param.lower():
append_param = _formatparam(param, value, requote)
else:
@@ -749,7 +749,7 @@ def set_param(self, param, value, header='Content-Type', requote=True,
del self[header]
self[header] = ctype
- def del_param(self, param, header='content-type', requote=True):
+ def del_param(self, param, header="content-type", requote=True):
"""Remove the given parameter completely from the Content-Type header.
The header will be re-written in place without the parameter or its
@@ -759,7 +759,7 @@ def del_param(self, param, header='content-type', requote=True):
"""
if header not in self:
return
- new_ctype = ''
+ new_ctype = ""
for p, v in self.get_params(header=header, unquote=requote):
if p.lower() != param.lower():
if not new_ctype:
@@ -771,7 +771,7 @@ def del_param(self, param, header='content-type', requote=True):
del self[header]
self[header] = new_ctype
- def set_type(self, type, header='Content-Type', requote=True):
+ def set_type(self, type, header="Content-Type", requote=True):
"""Set the main type and subtype for the Content-Type header.
type must be a string in the form "maintype/subtype", otherwise a
@@ -787,12 +787,12 @@ def set_type(self, type, header='Content-Type', requote=True):
header.
"""
# BAW: should we be strict?
- if not type.count('/') == 1:
+ if not type.count("/") == 1:
raise ValueError
# Set the Content-Type, you get a MIME-Version
- if header.lower() == 'content-type':
- del self['mime-version']
- self['MIME-Version'] = '1.0'
+ if header.lower() == "content-type":
+ del self["mime-version"]
+ self["MIME-Version"] = "1.0"
if header not in self:
self[header] = type
return
@@ -812,9 +812,9 @@ def get_filename(self, failobj=None):
`name' parameter.
"""
missing = object()
- filename = self.get_param('filename', missing, 'content-disposition')
+ filename = self.get_param("filename", missing, "content-disposition")
if filename is missing:
- filename = self.get_param('name', missing, 'content-type')
+ filename = self.get_param("name", missing, "content-type")
if filename is missing:
return failobj
return utils.collapse_rfc2231_value(filename).strip()
@@ -826,7 +826,7 @@ def get_boundary(self, failobj=None):
parameter, and it is unquoted.
"""
missing = object()
- boundary = self.get_param('boundary', missing)
+ boundary = self.get_param("boundary", missing)
if boundary is missing:
return failobj
# RFC 2046 says that boundaries may begin but not end in w/s
@@ -843,16 +843,16 @@ def set_boundary(self, boundary):
HeaderParseError is raised if the message has no Content-Type header.
"""
missing = object()
- params = self._get_params_preserve(missing, 'content-type')
+ params = self._get_params_preserve(missing, "content-type")
if params is missing:
# There was no Content-Type header, and we don't know what type
# to set it to, so raise an exception.
- raise errors.HeaderParseError('No Content-Type header found')
+ raise errors.HeaderParseError("No Content-Type header found")
newparams = []
foundp = False
for pk, pv in params:
- if pk.lower() == 'boundary':
- newparams.append(('boundary', '"%s"' % boundary))
+ if pk.lower() == "boundary":
+ newparams.append(("boundary", '"%s"' % boundary))
foundp = True
else:
newparams.append((pk, pv))
@@ -860,17 +860,17 @@ def set_boundary(self, boundary):
# The original Content-Type header had no boundary attribute.
# Tack one on the end. BAW: should we raise an exception
# instead???
- newparams.append(('boundary', '"%s"' % boundary))
+ newparams.append(("boundary", '"%s"' % boundary))
# Replace the existing Content-Type header with the new value
newheaders = []
for h, v in self._headers:
- if h.lower() == 'content-type':
+ if h.lower() == "content-type":
parts = []
for k, v in newparams:
- if v == '':
+ if v == "":
parts.append(k)
else:
- parts.append('%s=%s' % (k, v))
+ parts.append("%s=%s" % (k, v))
val = SEMISPACE.join(parts)
newheaders.append(self.policy.header_store_parse(h, val))
@@ -886,23 +886,23 @@ def get_content_charset(self, failobj=None):
failobj is returned.
"""
missing = object()
- charset = self.get_param('charset', missing)
+ charset = self.get_param("charset", missing)
if charset is missing:
return failobj
if isinstance(charset, tuple):
# RFC 2231 encoded, so decode it, and it better end up as ascii.
- pcharset = charset[0] or 'us-ascii'
+ pcharset = charset[0] or "us-ascii"
try:
# LookupError will be raised if the charset isn't known to
# Python. UnicodeError will be raised if the encoded text
# contains a character not in the charset.
- as_bytes = charset[2].encode('raw-unicode-escape')
+ as_bytes = charset[2].encode("raw-unicode-escape")
charset = str(as_bytes, pcharset)
except (LookupError, UnicodeError):
charset = charset[2]
# charset characters must be in us-ascii range
try:
- charset.encode('us-ascii')
+ charset.encode("us-ascii")
except UnicodeError:
return failobj
# RFC 2046, $4.1.2 says charsets are not case sensitive
@@ -932,7 +932,7 @@ def get_content_disposition(self):
The return values can be either 'inline', 'attachment' or None
according to the rfc2183.
"""
- value = self.get('content-disposition')
+ value = self.get("content-disposition")
if value is None:
return None
c_d = _splitparam(value)[0].lower()
@@ -971,30 +971,30 @@ def __str__(self):
return self.as_string(policy=self.policy.clone(utf8=True))
def is_attachment(self):
- c_d = self.get('content-disposition')
- return False if c_d is None else c_d.content_disposition == 'attachment'
+ c_d = self.get("content-disposition")
+ return False if c_d is None else c_d.content_disposition == "attachment"
def _find_body(self, part, preferencelist):
if part.is_attachment():
return
- maintype, subtype = part.get_content_type().split('/')
- if maintype == 'text':
+ maintype, subtype = part.get_content_type().split("/")
+ if maintype == "text":
if subtype in preferencelist:
yield (preferencelist.index(subtype), part)
return
- if maintype != 'multipart' or not self.is_multipart():
+ if maintype != "multipart" or not self.is_multipart():
return
- if subtype != 'related':
+ if subtype != "related":
for subpart in part.iter_parts():
yield from self._find_body(subpart, preferencelist)
return
- if 'related' in preferencelist:
- yield (preferencelist.index('related'), part)
+ if "related" in preferencelist:
+ yield (preferencelist.index("related"), part)
candidate = None
- start = part.get_param('start')
+ start = part.get_param("start")
if start:
for subpart in part.iter_parts():
- if subpart['content-id'] == start:
+ if subpart["content-id"] == start:
candidate = subpart
break
if candidate is None:
@@ -1003,7 +1003,7 @@ def _find_body(self, part, preferencelist):
if candidate is not None:
yield from self._find_body(candidate, preferencelist)
- def get_body(self, preferencelist=('related', 'html', 'plain')):
+ def get_body(self, preferencelist=("related", "html", "plain")):
"""Return best candidate mime part for display as 'body' of message.
Do a depth first search, starting with self, looking for the first part
@@ -1023,10 +1023,10 @@ def get_body(self, preferencelist=('related', 'html', 'plain')):
break
return body
- _body_types = {('text', 'plain'),
- ('text', 'html'),
- ('multipart', 'related'),
- ('multipart', 'alternative')}
+ _body_types = {("text", "plain"),
+ ("text", "html"),
+ ("multipart", "related"),
+ ("multipart", "alternative")}
def iter_attachments(self):
"""Return an iterator over the non-main parts of a multipart.
@@ -1038,8 +1038,8 @@ def iter_attachments(self):
empty iterator when applied to a multipart/alternative or a
non-multipart.
"""
- maintype, subtype = self.get_content_type().split('/')
- if maintype != 'multipart' or subtype == 'alternative':
+ maintype, subtype = self.get_content_type().split("/")
+ if maintype != "multipart" or subtype == "alternative":
return
payload = self.get_payload()
# Certain malformed messages can have content type set to `multipart/*`
@@ -1051,16 +1051,16 @@ def iter_attachments(self):
# payload is not a list, it is most probably a string.
return
- if maintype == 'multipart' and subtype == 'related':
+ if maintype == "multipart" and subtype == "related":
# For related, we treat everything but the root as an attachment.
# The root may be indicated by 'start'; if there's no start or we
# can't find the named start, treat the first subpart as the root.
- start = self.get_param('start')
+ start = self.get_param("start")
if start:
found = False
attachments = []
for part in parts:
- if part.get('content-id') == start:
+ if part.get("content-id") == start:
found = True
else:
attachments.append(part)
@@ -1075,7 +1075,7 @@ def iter_attachments(self):
# alternatives) if the sending agent sets content-disposition.
seen = [] # Only skip the first example of each candidate type.
for part in parts:
- maintype, subtype = part.get_content_type().split('/')
+ maintype, subtype = part.get_content_type().split("/")
if ((maintype, subtype) in self._body_types and
not part.is_attachment() and subtype not in seen):
seen.append(subtype)
@@ -1101,7 +1101,7 @@ def set_content(self, *args, content_manager=None, **kw):
content_manager.set_content(self, *args, **kw)
def _make_multipart(self, subtype, disallowed_subtypes, boundary):
- if self.get_content_maintype() == 'multipart':
+ if self.get_content_maintype() == "multipart":
existing_subtype = self.get_content_subtype()
disallowed_subtypes = disallowed_subtypes + (subtype,)
if existing_subtype in disallowed_subtypes:
@@ -1110,7 +1110,7 @@ def _make_multipart(self, subtype, disallowed_subtypes, boundary):
keep_headers = []
part_headers = []
for name, value in self._headers:
- if name.lower().startswith('content-'):
+ if name.lower().startswith("content-"):
part_headers.append((name, value))
else:
keep_headers.append((name, value))
@@ -1123,37 +1123,37 @@ def _make_multipart(self, subtype, disallowed_subtypes, boundary):
else:
self._payload = []
self._headers = keep_headers
- self['Content-Type'] = 'multipart/' + subtype
+ self["Content-Type"] = "multipart/" + subtype
if boundary is not None:
- self.set_param('boundary', boundary)
+ self.set_param("boundary", boundary)
def make_related(self, boundary=None):
- self._make_multipart('related', ('alternative', 'mixed'), boundary)
+ self._make_multipart("related", ("alternative", "mixed"), boundary)
def make_alternative(self, boundary=None):
- self._make_multipart('alternative', ('mixed',), boundary)
+ self._make_multipart("alternative", ("mixed",), boundary)
def make_mixed(self, boundary=None):
- self._make_multipart('mixed', (), boundary)
+ self._make_multipart("mixed", (), boundary)
def _add_multipart(self, _subtype, *args, _disp=None, **kw):
- if (self.get_content_maintype() != 'multipart' or
+ if (self.get_content_maintype() != "multipart" or
self.get_content_subtype() != _subtype):
- getattr(self, 'make_' + _subtype)()
+ getattr(self, "make_" + _subtype)()
part = type(self)(policy=self.policy)
part.set_content(*args, **kw)
- if _disp and 'content-disposition' not in part:
- part['Content-Disposition'] = _disp
+ if _disp and "content-disposition" not in part:
+ part["Content-Disposition"] = _disp
self.attach(part)
def add_related(self, *args, **kw):
- self._add_multipart('related', *args, _disp='inline', **kw)
+ self._add_multipart("related", *args, _disp="inline", **kw)
def add_alternative(self, *args, **kw):
- self._add_multipart('alternative', *args, **kw)
+ self._add_multipart("alternative", *args, **kw)
def add_attachment(self, *args, **kw):
- self._add_multipart('mixed', *args, _disp='attachment', **kw)
+ self._add_multipart("mixed", *args, _disp="attachment", **kw)
def clear(self):
self._headers = []
@@ -1161,7 +1161,7 @@ def clear(self):
def clear_content(self):
self._headers = [(n, v) for n, v in self._headers
- if not n.lower().startswith('content-')]
+ if not n.lower().startswith("content-")]
self._payload = None
@@ -1169,5 +1169,5 @@ class EmailMessage(MIMEPart):
def set_content(self, *args, **kw):
super().set_content(*args, **kw)
- if 'MIME-Version' not in self:
- self['MIME-Version'] = '1.0'
+ if "MIME-Version" not in self:
+ self["MIME-Version"] = "1.0"
diff --git a/.venv3.10/Lib/email/mime/application.py b/.venv3.10/Lib/email/mime/application.py
index f67cbad3..2ebf4acb 100644
--- a/.venv3.10/Lib/email/mime/application.py
+++ b/.venv3.10/Lib/email/mime/application.py
@@ -13,7 +13,7 @@
class MIMEApplication(MIMENonMultipart):
"""Class for generating application/* MIME documents."""
- def __init__(self, _data, _subtype='octet-stream',
+ def __init__(self, _data, _subtype="octet-stream",
_encoder=encoders.encode_base64, *, policy=None, **_params):
"""Create an application/* type MIME document.
@@ -30,8 +30,8 @@ def __init__(self, _data, _subtype='octet-stream',
header.
"""
if _subtype is None:
- raise TypeError('Invalid application MIME subtype')
- MIMENonMultipart.__init__(self, 'application', _subtype, policy=policy,
+ raise TypeError("Invalid application MIME subtype")
+ MIMENonMultipart.__init__(self, "application", _subtype, policy=policy,
**_params)
self.set_payload(_data)
_encoder(self)
diff --git a/.venv3.10/Lib/email/mime/audio.py b/.venv3.10/Lib/email/mime/audio.py
index 7cca3f99..fc22e943 100644
--- a/.venv3.10/Lib/email/mime/audio.py
+++ b/.venv3.10/Lib/email/mime/audio.py
@@ -4,7 +4,7 @@
"""Class representing audio/* type MIME documents."""
-__all__ = ['MIMEAudio']
+__all__ = ["MIMEAudio"]
import sndhdr
@@ -13,11 +13,11 @@
from email.mime.nonmultipart import MIMENonMultipart
-
-_sndhdr_MIMEmap = {'au' : 'basic',
- 'wav' :'x-wav',
- 'aiff':'x-aiff',
- 'aifc':'x-aiff',
+
+_sndhdr_MIMEmap = {"au" : "basic",
+ "wav" :"x-wav",
+ "aiff":"x-aiff",
+ "aifc":"x-aiff",
}
# There are others in sndhdr that don't have MIME types. :(
@@ -38,7 +38,7 @@ def _whatsnd(data):
return None
-
+
class MIMEAudio(MIMENonMultipart):
"""Class for generating audio/* MIME documents."""
@@ -67,8 +67,8 @@ def __init__(self, _audiodata, _subtype=None,
if _subtype is None:
_subtype = _whatsnd(_audiodata)
if _subtype is None:
- raise TypeError('Could not find audio MIME subtype')
- MIMENonMultipart.__init__(self, 'audio', _subtype, policy=policy,
+ raise TypeError("Could not find audio MIME subtype")
+ MIMENonMultipart.__init__(self, "audio", _subtype, policy=policy,
**_params)
self.set_payload(_audiodata)
_encoder(self)
diff --git a/.venv3.10/Lib/email/mime/base.py b/.venv3.10/Lib/email/mime/base.py
index 1a3f9b51..5c47cda7 100644
--- a/.venv3.10/Lib/email/mime/base.py
+++ b/.venv3.10/Lib/email/mime/base.py
@@ -4,14 +4,14 @@
"""Base class for MIME specializations."""
-__all__ = ['MIMEBase']
+__all__ = ["MIMEBase"]
import email.policy
from email import message
-
+
class MIMEBase(message.Message):
"""Base class for MIME specializations."""
@@ -25,6 +25,6 @@ def __init__(self, _maintype, _subtype, *, policy=None, **_params):
if policy is None:
policy = email.policy.compat32
message.Message.__init__(self, policy=policy)
- ctype = '%s/%s' % (_maintype, _subtype)
- self.add_header('Content-Type', ctype, **_params)
- self['MIME-Version'] = '1.0'
+ ctype = "%s/%s" % (_maintype, _subtype)
+ self.add_header("Content-Type", ctype, **_params)
+ self["MIME-Version"] = "1.0"
diff --git a/.venv3.10/Lib/email/mime/image.py b/.venv3.10/Lib/email/mime/image.py
index 6dc7ec4c..59551cae 100644
--- a/.venv3.10/Lib/email/mime/image.py
+++ b/.venv3.10/Lib/email/mime/image.py
@@ -4,7 +4,7 @@
"""Class representing image/* type MIME documents."""
-__all__ = ['MIMEImage']
+__all__ = ["MIMEImage"]
import imghdr
@@ -12,7 +12,7 @@
from email.mime.nonmultipart import MIMENonMultipart
-
+
class MIMEImage(MIMENonMultipart):
"""Class for generating image/* type MIME documents."""
@@ -40,8 +40,8 @@ def __init__(self, _imagedata, _subtype=None,
if _subtype is None:
_subtype = imghdr.what(None, _imagedata)
if _subtype is None:
- raise TypeError('Could not guess image MIME subtype')
- MIMENonMultipart.__init__(self, 'image', _subtype, policy=policy,
+ raise TypeError("Could not guess image MIME subtype")
+ MIMENonMultipart.__init__(self, "image", _subtype, policy=policy,
**_params)
self.set_payload(_imagedata)
_encoder(self)
diff --git a/.venv3.10/Lib/email/mime/message.py b/.venv3.10/Lib/email/mime/message.py
index 07e4f2d1..4f9921d0 100644
--- a/.venv3.10/Lib/email/mime/message.py
+++ b/.venv3.10/Lib/email/mime/message.py
@@ -4,17 +4,17 @@
"""Class representing message/* MIME documents."""
-__all__ = ['MIMEMessage']
+__all__ = ["MIMEMessage"]
from email import message
from email.mime.nonmultipart import MIMENonMultipart
-
+
class MIMEMessage(MIMENonMultipart):
"""Class representing message/* MIME documents."""
- def __init__(self, _msg, _subtype='rfc822', *, policy=None):
+ def __init__(self, _msg, _subtype="rfc822", *, policy=None):
"""Create a message/* type MIME document.
_msg is a message object and must be an instance of Message, or a
@@ -24,11 +24,11 @@ def __init__(self, _msg, _subtype='rfc822', *, policy=None):
default is "rfc822" (this is defined by the MIME standard, even though
the term "rfc822" is technically outdated by RFC 2822).
"""
- MIMENonMultipart.__init__(self, 'message', _subtype, policy=policy)
+ MIMENonMultipart.__init__(self, "message", _subtype, policy=policy)
if not isinstance(_msg, message.Message):
- raise TypeError('Argument is not an instance of Message')
+ raise TypeError("Argument is not an instance of Message")
# It's convenient to use this base class method. We need to do it
# this way or we'll get an exception
message.Message.attach(self, _msg)
# And be sure our default type is set correctly
- self.set_default_type('message/rfc822')
+ self.set_default_type("message/rfc822")
diff --git a/.venv3.10/Lib/email/mime/multipart.py b/.venv3.10/Lib/email/mime/multipart.py
index 2d3f2888..ecc6934d 100644
--- a/.venv3.10/Lib/email/mime/multipart.py
+++ b/.venv3.10/Lib/email/mime/multipart.py
@@ -4,16 +4,16 @@
"""Base class for MIME multipart/* type messages."""
-__all__ = ['MIMEMultipart']
+__all__ = ["MIMEMultipart"]
from email.mime.base import MIMEBase
-
+
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* type messages."""
- def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
+ def __init__(self, _subtype="mixed", boundary=None, _subparts=None,
*, policy=None,
**_params):
"""Creates a multipart/* type message.
@@ -34,7 +34,7 @@ def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
Additional parameters for the Content-Type header are taken from the
keyword arguments (or passed into the _params argument).
"""
- MIMEBase.__init__(self, 'multipart', _subtype, policy=policy, **_params)
+ MIMEBase.__init__(self, "multipart", _subtype, policy=policy, **_params)
# Initialise _payload to an empty list as the Message superclass's
# implementation of is_multipart assumes that _payload is a list for
diff --git a/.venv3.10/Lib/email/mime/nonmultipart.py b/.venv3.10/Lib/email/mime/nonmultipart.py
index e1f51968..82a6e1a9 100644
--- a/.venv3.10/Lib/email/mime/nonmultipart.py
+++ b/.venv3.10/Lib/email/mime/nonmultipart.py
@@ -4,13 +4,13 @@
"""Base class for MIME type messages that are not multipart."""
-__all__ = ['MIMENonMultipart']
+__all__ = ["MIMENonMultipart"]
from email import errors
from email.mime.base import MIMEBase
-
+
class MIMENonMultipart(MIMEBase):
"""Base class for MIME non-multipart type messages."""
@@ -19,4 +19,4 @@ def attach(self, payload):
# derived subtypes since none of them are, by definition, of content
# type multipart/*
raise errors.MultipartConversionError(
- 'Cannot attach additional subparts to non-multipart/*')
+ "Cannot attach additional subparts to non-multipart/*")
diff --git a/.venv3.10/Lib/email/mime/text.py b/.venv3.10/Lib/email/mime/text.py
index 35b44238..b2f3de32 100644
--- a/.venv3.10/Lib/email/mime/text.py
+++ b/.venv3.10/Lib/email/mime/text.py
@@ -4,17 +4,16 @@
"""Class representing text/* type MIME documents."""
-__all__ = ['MIMEText']
+__all__ = ["MIMEText"]
-from email.charset import Charset
from email.mime.nonmultipart import MIMENonMultipart
-
+
class MIMEText(MIMENonMultipart):
"""Class for generating text/* type MIME documents."""
- def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None):
+ def __init__(self, _text, _subtype="plain", _charset=None, *, policy=None):
"""Create a text/* type MIME document.
_text is the string for this message object.
@@ -31,12 +30,12 @@ def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None):
# XXX: This can be removed once #7304 is fixed.
if _charset is None:
try:
- _text.encode('us-ascii')
- _charset = 'us-ascii'
+ _text.encode("us-ascii")
+ _charset = "us-ascii"
except UnicodeEncodeError:
- _charset = 'utf-8'
+ _charset = "utf-8"
- MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy,
- **{'charset': str(_charset)})
+ MIMENonMultipart.__init__(self, "text", _subtype, policy=policy,
+ **{"charset": str(_charset)})
self.set_payload(_text, _charset)
diff --git a/.venv3.10/Lib/email/parser.py b/.venv3.10/Lib/email/parser.py
index 7db4da1f..6956ada9 100644
--- a/.venv3.10/Lib/email/parser.py
+++ b/.venv3.10/Lib/email/parser.py
@@ -4,8 +4,8 @@
"""A parser of RFC 2822 and MIME email messages."""
-__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser',
- 'FeedParser', 'BytesFeedParser']
+__all__ = ["Parser", "HeaderParser", "BytesParser", "BytesHeaderParser",
+ "FeedParser", "BytesFeedParser"]
from io import StringIO, TextIOWrapper
@@ -67,7 +67,7 @@ def parsestr(self, text, headersonly=False):
return self.parse(StringIO(text), headersonly=headersonly)
-
+
class HeaderParser(Parser):
def parse(self, fp, headersonly=True):
return Parser.parse(self, fp, True)
@@ -75,7 +75,7 @@ def parse(self, fp, headersonly=True):
def parsestr(self, text, headersonly=True):
return Parser.parsestr(self, text, True)
-
+
class BytesParser:
def __init__(self, *args, **kw):
@@ -104,7 +104,7 @@ def parse(self, fp, headersonly=False):
parsing after reading the headers or not. The default is False,
meaning it parses the entire contents of the file.
"""
- fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape')
+ fp = TextIOWrapper(fp, encoding="ascii", errors="surrogateescape")
try:
return self.parser.parse(fp, headersonly)
finally:
@@ -119,7 +119,7 @@ def parsebytes(self, text, headersonly=False):
not. The default is False, meaning it parses the entire contents of
the file.
"""
- text = text.decode('ASCII', errors='surrogateescape')
+ text = text.decode("ASCII", errors="surrogateescape")
return self.parser.parsestr(text, headersonly)
diff --git a/.venv3.10/Lib/email/policy.py b/.venv3.10/Lib/email/policy.py
index 611deb50..4d153210 100644
--- a/.venv3.10/Lib/email/policy.py
+++ b/.venv3.10/Lib/email/policy.py
@@ -11,17 +11,17 @@
from email.message import EmailMessage
__all__ = [
- 'Compat32',
- 'compat32',
- 'Policy',
- 'EmailPolicy',
- 'default',
- 'strict',
- 'SMTP',
- 'HTTP',
+ "Compat32",
+ "compat32",
+ "Policy",
+ "EmailPolicy",
+ "default",
+ "strict",
+ "SMTP",
+ "HTTP",
]
-linesep_splitter = re.compile(r'\n|\r')
+linesep_splitter = re.compile(r"\n|\r")
@_extend_docstrings
class EmailPolicy(Policy):
@@ -86,15 +86,15 @@ class EmailPolicy(Policy):
message_factory = EmailMessage
utf8 = False
- refold_source = 'long'
+ refold_source = "long"
header_factory = HeaderRegistry()
content_manager = raw_data_manager
def __init__(self, **kw):
# Ensure that each new instance gets a unique header factory
# (as opposed to clones, which share the factory).
- if 'header_factory' not in kw:
- object.__setattr__(self, 'header_factory', HeaderRegistry())
+ if "header_factory" not in kw:
+ object.__setattr__(self, "header_factory", HeaderRegistry())
super().__init__(**kw)
def header_max_count(self, name):
@@ -124,9 +124,9 @@ def header_source_parse(self, sourcelines):
is the same as Compat32).
"""
- name, value = sourcelines[0].split(':', 1)
- value = value.lstrip(' \t') + ''.join(sourcelines[1:])
- return (name, value.rstrip('\r\n'))
+ name, value = sourcelines[0].split(":", 1)
+ value = value.lstrip(" \t") + "".join(sourcelines[1:])
+ return (name, value.rstrip("\r\n"))
def header_store_parse(self, name, value):
"""+
@@ -138,7 +138,7 @@ def header_store_parse(self, name, value):
CR or LF characters.
"""
- if hasattr(value, 'name') and value.name.lower() == name.lower():
+ if hasattr(value, "name") and value.name.lower() == name.lower():
return (name, value)
if isinstance(value, str) and len(value.splitlines())>1:
# XXX this error message isn't quite right when we use splitlines
@@ -156,10 +156,10 @@ def header_fetch_parse(self, name, value):
into the unicode unknown-character glyph.
"""
- if hasattr(value, 'name'):
+ if hasattr(value, "name"):
return value
# We can't use splitlines here because it splits on more than \r and \n.
- value = ''.join(linesep_splitter.split(value))
+ value = "".join(linesep_splitter.split(value))
return self.header_factory(name, value)
def fold(self, name, value):
@@ -197,28 +197,28 @@ def fold_binary(self, name, value):
non-ASCII unicode rendered as encoded words.
"""
- folded = self._fold(name, value, refold_binary=self.cte_type=='7bit')
- charset = 'utf8' if self.utf8 else 'ascii'
- return folded.encode(charset, 'surrogateescape')
+ folded = self._fold(name, value, refold_binary=self.cte_type=="7bit")
+ charset = "utf8" if self.utf8 else "ascii"
+ return folded.encode(charset, "surrogateescape")
def _fold(self, name, value, refold_binary=False):
- if hasattr(value, 'name'):
+ if hasattr(value, "name"):
return value.fold(policy=self)
maxlen = self.max_line_length if self.max_line_length else sys.maxsize
lines = value.splitlines()
- refold = (self.refold_source == 'all' or
- self.refold_source == 'long' and
+ refold = (self.refold_source == "all" or
+ self.refold_source == "long" and
(lines and len(lines[0])+len(name)+2 > maxlen or
any(len(x) > maxlen for x in lines[1:])))
if refold or refold_binary and _has_surrogates(value):
- return self.header_factory(name, ''.join(lines)).fold(policy=self)
- return name + ': ' + self.linesep.join(lines) + self.linesep
+ return self.header_factory(name, "".join(lines)).fold(policy=self)
+ return name + ": " + self.linesep.join(lines) + self.linesep
default = EmailPolicy()
# Make the default policy use the class default header_factory
del default.header_factory
strict = default.clone(raise_on_defect=True)
-SMTP = default.clone(linesep='\r\n')
-HTTP = default.clone(linesep='\r\n', max_line_length=None)
+SMTP = default.clone(linesep="\r\n")
+HTTP = default.clone(linesep="\r\n", max_line_length=None)
SMTPUTF8 = SMTP.clone(utf8=True)
diff --git a/.venv3.10/Lib/email/quoprimime.py b/.venv3.10/Lib/email/quoprimime.py
index 94534f7e..b4d6c0e3 100644
--- a/.venv3.10/Lib/email/quoprimime.py
+++ b/.venv3.10/Lib/email/quoprimime.py
@@ -27,40 +27,40 @@
"""
__all__ = [
- 'body_decode',
- 'body_encode',
- 'body_length',
- 'decode',
- 'decodestring',
- 'header_decode',
- 'header_encode',
- 'header_length',
- 'quote',
- 'unquote',
+ "body_decode",
+ "body_encode",
+ "body_length",
+ "decode",
+ "decodestring",
+ "header_decode",
+ "header_encode",
+ "header_length",
+ "quote",
+ "unquote",
]
import re
from string import ascii_letters, digits, hexdigits
-CRLF = '\r\n'
-NL = '\n'
-EMPTYSTRING = ''
+CRLF = "\r\n"
+NL = "\n"
+EMPTYSTRING = ""
# Build a mapping of octets to the expansion of that octet. Since we're only
# going to have 256 of these things, this isn't terribly inefficient
# space-wise. Remember that headers and bodies have different sets of safe
# characters. Initialize both maps with the full expansion, and then override
# the safe bytes with the more compact form.
-_QUOPRI_MAP = ['=%02X' % c for c in range(256)]
+_QUOPRI_MAP = ["=%02X" % c for c in range(256)]
_QUOPRI_HEADER_MAP = _QUOPRI_MAP[:]
_QUOPRI_BODY_MAP = _QUOPRI_MAP[:]
# Safe header bytes which need no encoding.
-for c in b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii'):
+for c in b"-!*+/" + ascii_letters.encode("ascii") + digits.encode("ascii"):
_QUOPRI_HEADER_MAP[c] = chr(c)
# Headers have one other special encoding; spaces become underscores.
-_QUOPRI_HEADER_MAP[ord(' ')] = '_'
+_QUOPRI_HEADER_MAP[ord(" ")] = "_"
# Safe body bytes which need no encoding.
for c in (b' !"#$%&\'()*+,-./0123456789:;<>'
@@ -104,7 +104,7 @@ def body_length(bytearray):
return sum(len(_QUOPRI_BODY_MAP[octet]) for octet in bytearray)
-def _max_append(L, s, maxlen, extra=''):
+def _max_append(L, s, maxlen, extra=""):
if not isinstance(s, str):
s = chr(s)
if not L:
@@ -124,7 +124,7 @@ def quote(c):
return _QUOPRI_MAP[ord(c)]
-def header_encode(header_bytes, charset='iso-8859-1'):
+def header_encode(header_bytes, charset="iso-8859-1"):
"""Encode a single header line with quoted-printable (like) encoding.
Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but
@@ -137,16 +137,16 @@ def header_encode(header_bytes, charset='iso-8859-1'):
"""
# Return empty headers as an empty string.
if not header_bytes:
- return ''
+ return ""
# Iterate over every byte, encoding if necessary.
- encoded = header_bytes.decode('latin1').translate(_QUOPRI_HEADER_MAP)
+ encoded = header_bytes.decode("latin1").translate(_QUOPRI_HEADER_MAP)
# Now add the RFC chrome to each encoded chunk and glue the chunks
# together.
- return '=?%s?q?%s?=' % (charset, encoded)
+ return "=?%s?q?%s?=" % (charset, encoded)
_QUOPRI_BODY_ENCODE_MAP = _QUOPRI_BODY_MAP[:]
-for c in b'\r\n':
+for c in b"\r\n":
_QUOPRI_BODY_ENCODE_MAP[c] = chr(c)
def body_encode(body, maxlinelen=76, eol=NL):
@@ -176,7 +176,7 @@ def body_encode(body, maxlinelen=76, eol=NL):
# quote special characters
body = body.translate(_QUOPRI_BODY_ENCODE_MAP)
- soft_break = '=' + eol
+ soft_break = "=" + eol
# leave space for the '=' at the end of a line
maxlinelen1 = maxlinelen - 1
@@ -190,18 +190,18 @@ def body_encode(body, maxlinelen=76, eol=NL):
while start <= laststart:
stop = start + maxlinelen1
# make sure we don't break up an escape sequence
- if line[stop - 2] == '=':
+ if line[stop - 2] == "=":
append(line[start:stop - 1])
start = stop - 2
- elif line[stop - 1] == '=':
+ elif line[stop - 1] == "=":
append(line[start:stop])
start = stop - 1
else:
- append(line[start:stop] + '=')
+ append(line[start:stop] + "=")
start = stop
# handle rest of line, special case if line ends in whitespace
- if line and line[-1] in ' \t':
+ if line and line[-1] in " \t":
room = start - laststart
if room >= 3:
# It's a whitespace character at end-of-line, and we have room
@@ -220,7 +220,7 @@ def body_encode(body, maxlinelen=76, eol=NL):
# add back final newline if present
if body[-1] in CRLF:
- append('')
+ append("")
return eol.join(encoded_body)
@@ -238,7 +238,7 @@ def decode(encoded, eol=NL):
# BAW: see comment in encode() above. Again, we're building up the
# decoded string with string concatenation, which could be done much more
# efficiently.
- decoded = ''
+ decoded = ""
for line in encoded.splitlines():
line = line.rstrip()
@@ -250,7 +250,7 @@ def decode(encoded, eol=NL):
n = len(line)
while i < n:
c = line[i]
- if c != '=':
+ if c != "=":
decoded += c
i += 1
# Otherwise, c == "=". Are we at the end of the line? If so, add
@@ -270,7 +270,7 @@ def decode(encoded, eol=NL):
if i == n:
decoded += eol
# Special case if original string did not end with eol
- if encoded[-1] not in '\r\n' and decoded.endswith(eol):
+ if encoded[-1] not in "\r\n" and decoded.endswith(eol):
decoded = decoded[:-1]
return decoded
@@ -295,5 +295,5 @@ def header_decode(s):
quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
the high level email.header class for that functionality.
"""
- s = s.replace('_', ' ')
- return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)
+ s = s.replace("_", " ")
+ return re.sub(r"=[a-fA-F0-9]{2}", _unquote_match, s, flags=re.ASCII)
diff --git a/.venv3.10/Lib/email/utils.py b/.venv3.10/Lib/email/utils.py
index 9522341f..19a77226 100644
--- a/.venv3.10/Lib/email/utils.py
+++ b/.venv3.10/Lib/email/utils.py
@@ -5,21 +5,21 @@
"""Miscellaneous utilities."""
__all__ = [
- 'collapse_rfc2231_value',
- 'decode_params',
- 'decode_rfc2231',
- 'encode_rfc2231',
- 'formataddr',
- 'formatdate',
- 'format_datetime',
- 'getaddresses',
- 'make_msgid',
- 'mktime_tz',
- 'parseaddr',
- 'parsedate',
- 'parsedate_tz',
- 'parsedate_to_datetime',
- 'unquote',
+ "collapse_rfc2231_value",
+ "decode_params",
+ "decode_rfc2231",
+ "encode_rfc2231",
+ "formataddr",
+ "formatdate",
+ "format_datetime",
+ "getaddresses",
+ "make_msgid",
+ "mktime_tz",
+ "parseaddr",
+ "parsedate",
+ "parsedate_tz",
+ "parsedate_to_datetime",
+ "unquote",
]
import os
@@ -39,10 +39,10 @@
# Intrapackage imports
from email.charset import Charset
-COMMASPACE = ', '
-EMPTYSTRING = ''
-UEMPTYSTRING = ''
-CRLF = '\r\n'
+COMMASPACE = ", "
+EMPTYSTRING = ""
+UEMPTYSTRING = ""
+CRLF = "\r\n"
TICK = "'"
specialsre = re.compile(r'[][\\()<>@,:;".]')
@@ -67,14 +67,14 @@ def _sanitize(string):
# bytes happen to be utf-8 they will instead get decoded, even if they
# were invalid in the charset the source was supposed to be in. This
# seems like it is not a bad thing; a defect was still registered.
- original_bytes = string.encode('utf-8', 'surrogateescape')
- return original_bytes.decode('utf-8', 'replace')
+ original_bytes = string.encode("utf-8", "surrogateescape")
+ return original_bytes.decode("utf-8", "replace")
# Helpers
-def formataddr(pair, charset='utf-8'):
+def formataddr(pair, charset="utf-8"):
"""The inverse of parseaddr(), this takes a 2-tuple of the form
(realname, email_address) and returns the string value suitable
for an RFC 2822 From, To or Cc header.
@@ -89,21 +89,21 @@ def formataddr(pair, charset='utf-8'):
"""
name, address = pair
# The address MUST (per RFC) be ascii, so raise a UnicodeError if it isn't.
- address.encode('ascii')
+ address.encode("ascii")
if name:
try:
- name.encode('ascii')
+ name.encode("ascii")
except UnicodeEncodeError:
if isinstance(charset, str):
charset = Charset(charset)
encoded_name = charset.header_encode(name)
return "%s <%s>" % (encoded_name, address)
else:
- quotes = ''
+ quotes = ""
if specialsre.search(name):
quotes = '"'
- name = escapesre.sub(r'\\\g<0>', name)
- return '%s%s%s <%s>' % (quotes, name, quotes, address)
+ name = escapesre.sub(r"\\\g<0>", name)
+ return "%s%s%s <%s>" % (quotes, name, quotes, address)
return address
@@ -112,14 +112,14 @@ def _iter_escaped_chars(addr):
escape = False
for pos, ch in enumerate(addr):
if escape:
- yield (pos, '\\' + ch)
+ yield (pos, "\\" + ch)
escape = False
- elif ch == '\\':
+ elif ch == "\\":
escape = True
else:
yield (pos, ch)
if escape:
- yield (pos, '\\')
+ yield (pos, "\\")
def _strip_quoted_realnames(addr):
@@ -144,7 +144,7 @@ def _strip_quoted_realnames(addr):
if start < len(addr):
result.append(addr[start:])
- return ''.join(result)
+ return "".join(result)
supports_strict_parsing = True
@@ -186,9 +186,9 @@ def getaddresses(fieldvalues, *, strict=True):
# So strip those out before counting the commas.
v = _strip_quoted_realnames(v)
# Expected number of addresses: 1 + number of commas
- n += 1 + v.count(',')
+ n += 1 + v.count(",")
if len(result) != n:
- return [('', '')]
+ return [("", "")]
return result
@@ -199,9 +199,9 @@ def _check_parenthesis(addr):
opens = 0
for pos, ch in _iter_escaped_chars(addr):
- if ch == '(':
+ if ch == "(":
opens += 1
- elif ch == ')':
+ elif ch == ")":
opens -= 1
if opens < 0:
return False
@@ -223,19 +223,19 @@ def _post_parse_validation(parsed_email_header_tuples):
# The parser would have parsed a correctly formatted domain-literal
# The existence of an [ after parsing indicates a parsing failure
for v in parsed_email_header_tuples:
- if '[' in v[1]:
- v = ('', '')
+ if "[" in v[1]:
+ v = ("", "")
accepted_values.append(v)
return accepted_values
def _format_timetuple_and_zone(timetuple, zone):
- return '%s, %02d %s %04d %02d:%02d:%02d %s' % (
- ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][timetuple[6]],
+ return "%s, %02d %s %04d %02d:%02d:%02d %s" % (
+ ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][timetuple[6]],
timetuple[2],
- ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][timetuple[1] - 1],
+ ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][timetuple[1] - 1],
timetuple[0], timetuple[3], timetuple[4], timetuple[5],
zone)
@@ -279,9 +279,9 @@ def format_datetime(dt, usegmt=False):
if usegmt:
if dt.tzinfo is None or dt.tzinfo != datetime.timezone.utc:
raise ValueError("usegmt option requires a UTC datetime")
- zone = 'GMT'
+ zone = "GMT"
elif dt.tzinfo is None:
- zone = '-0000'
+ zone = "-0000"
else:
zone = dt.strftime("%z")
return _format_timetuple_and_zone(now, zone)
@@ -301,12 +301,12 @@ def make_msgid(idstring=None, domain=None):
pid = os.getpid()
randint = random.getrandbits(64)
if idstring is None:
- idstring = ''
+ idstring = ""
else:
- idstring = '.' + idstring
+ idstring = "." + idstring
if domain is None:
domain = socket.getfqdn()
- msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, domain)
+ msgid = "<%d.%d.%d%s@%s>" % (timeval, pid, randint, idstring, domain)
return msgid
@@ -333,20 +333,20 @@ def parseaddr(addr, *, strict=True):
if not strict:
addrs = _AddressList(addr).addresslist
if not addrs:
- return ('', '')
+ return ("", "")
return addrs[0]
if isinstance(addr, list):
addr = addr[0]
if not isinstance(addr, str):
- return ('', '')
+ return ("", "")
addr = _pre_parse_validation([addr])[0]
addrs = _post_parse_validation(_AddressList(addr).addresslist)
if not addrs or len(addrs) > 1:
- return ('', '')
+ return ("", "")
return addrs[0]
@@ -356,8 +356,8 @@ def unquote(str):
"""Remove quotes from a string."""
if len(str) > 1:
if str.startswith('"') and str.endswith('"'):
- return str[1:-1].replace('\\\\', '\\').replace('\\"', '"')
- if str.startswith('<') and str.endswith('>'):
+ return str[1:-1].replace("\\\\", "\\").replace('\\"', '"')
+ if str.startswith("<") and str.endswith(">"):
return str[1:-1]
return str
@@ -379,15 +379,15 @@ def encode_rfc2231(s, charset=None, language=None):
charset is given but not language, the string is encoded using the empty
string for language.
"""
- s = urllib.parse.quote(s, safe='', encoding=charset or 'ascii')
+ s = urllib.parse.quote(s, safe="", encoding=charset or "ascii")
if charset is None and language is None:
return s
if language is None:
- language = ''
+ language = ""
return "%s'%s'%s" % (charset, language, s)
-rfc2231_continuation = re.compile(r'^(?P\w+)\*((?P[0-9]+)\*?)?$',
+rfc2231_continuation = re.compile(r"^(?P\w+)\*((?P[0-9]+)\*?)?$",
re.ASCII)
def decode_params(params):
@@ -401,11 +401,11 @@ def decode_params(params):
# specifying whether a particular segment is %-encoded.
rfc2231_params = {}
for name, value in params[1:]:
- encoded = name.endswith('*')
+ encoded = name.endswith("*")
value = unquote(value)
mo = rfc2231_continuation.match(name)
if mo:
- name, num = mo.group('name', 'num')
+ name, num = mo.group("name", "num")
if num is not None:
num = int(num)
rfc2231_params.setdefault(name, []).append((num, value, encoded))
@@ -438,8 +438,8 @@ def decode_params(params):
new_params.append((name, '"%s"' % value))
return new_params
-def collapse_rfc2231_value(value, errors='replace',
- fallback_charset='us-ascii'):
+def collapse_rfc2231_value(value, errors="replace",
+ fallback_charset="us-ascii"):
if not isinstance(value, tuple) or len(value) != 3:
return unquote(value)
# While value comes to us as a unicode string, we need it to be a bytes
@@ -450,7 +450,7 @@ def collapse_rfc2231_value(value, errors='replace',
# Issue 17369: if charset/lang is None, decode_rfc2231 couldn't parse
# the value, so use the fallback_charset.
charset = fallback_charset
- rawbytes = bytes(text, 'raw-unicode-escape')
+ rawbytes = bytes(text, "raw-unicode-escape")
try:
return str(rawbytes, charset, errors)
except LookupError:
diff --git a/.venv3.10/Lib/encodings/__init__.py b/.venv3.10/Lib/encodings/__init__.py
index 4b37d332..9df7fdf9 100644
--- a/.venv3.10/Lib/encodings/__init__.py
+++ b/.venv3.10/Lib/encodings/__init__.py
@@ -33,8 +33,8 @@
from . import aliases
_cache = {}
-_unknown = '--unknown--'
-_import_tail = ['*']
+_unknown = "--unknown--"
+_import_tail = ["*"]
_aliases = aliases.aliases
class CodecRegistryError(LookupError, SystemError):
@@ -58,15 +58,15 @@ def normalize_encoding(encoding):
chars = []
punct = False
for c in encoding:
- if c.isalnum() or c == '.':
+ if c.isalnum() or c == ".":
if punct and chars:
- chars.append('_')
+ chars.append("_")
if c.isascii():
chars.append(c)
punct = False
else:
punct = True
- return ''.join(chars)
+ return "".join(chars)
def search_function(encoding):
@@ -84,19 +84,19 @@ def search_function(encoding):
#
norm_encoding = normalize_encoding(encoding)
aliased_encoding = _aliases.get(norm_encoding) or \
- _aliases.get(norm_encoding.replace('.', '_'))
+ _aliases.get(norm_encoding.replace(".", "_"))
if aliased_encoding is not None:
modnames = [aliased_encoding,
norm_encoding]
else:
modnames = [norm_encoding]
for modname in modnames:
- if not modname or '.' in modname:
+ if not modname or "." in modname:
continue
try:
# Import is absolute to prevent the possibly malicious import of a
# module with side-effects that is not in the 'encodings' package.
- mod = __import__('encodings.' + modname, fromlist=_import_tail,
+ mod = __import__("encodings." + modname, fromlist=_import_tail,
level=0)
except ImportError:
# ImportError may occur because 'encodings.(modname)' does not exist,
@@ -155,7 +155,7 @@ def search_function(encoding):
# Register the search_function in the Python codec registry
codecs.register(search_function)
-if sys.platform == 'win32':
+if sys.platform == "win32":
def _alias_mbcs(encoding):
try:
import _winapi
diff --git a/.venv3.10/Lib/encodings/aliases.py b/.venv3.10/Lib/encodings/aliases.py
index d85afd6d..718e8b99 100644
--- a/.venv3.10/Lib/encodings/aliases.py
+++ b/.venv3.10/Lib/encodings/aliases.py
@@ -20,404 +20,404 @@
# Please keep this list sorted alphabetically by value !
# ascii codec
- '646' : 'ascii',
- 'ansi_x3.4_1968' : 'ascii',
- 'ansi_x3_4_1968' : 'ascii', # some email headers use this non-standard name
- 'ansi_x3.4_1986' : 'ascii',
- 'cp367' : 'ascii',
- 'csascii' : 'ascii',
- 'ibm367' : 'ascii',
- 'iso646_us' : 'ascii',
- 'iso_646.irv_1991' : 'ascii',
- 'iso_ir_6' : 'ascii',
- 'us' : 'ascii',
- 'us_ascii' : 'ascii',
+ "646" : "ascii",
+ "ansi_x3.4_1968" : "ascii",
+ "ansi_x3_4_1968" : "ascii", # some email headers use this non-standard name
+ "ansi_x3.4_1986" : "ascii",
+ "cp367" : "ascii",
+ "csascii" : "ascii",
+ "ibm367" : "ascii",
+ "iso646_us" : "ascii",
+ "iso_646.irv_1991" : "ascii",
+ "iso_ir_6" : "ascii",
+ "us" : "ascii",
+ "us_ascii" : "ascii",
# base64_codec codec
- 'base64' : 'base64_codec',
- 'base_64' : 'base64_codec',
+ "base64" : "base64_codec",
+ "base_64" : "base64_codec",
# big5 codec
- 'big5_tw' : 'big5',
- 'csbig5' : 'big5',
+ "big5_tw" : "big5",
+ "csbig5" : "big5",
# big5hkscs codec
- 'big5_hkscs' : 'big5hkscs',
- 'hkscs' : 'big5hkscs',
+ "big5_hkscs" : "big5hkscs",
+ "hkscs" : "big5hkscs",
# bz2_codec codec
- 'bz2' : 'bz2_codec',
+ "bz2" : "bz2_codec",
# cp037 codec
- '037' : 'cp037',
- 'csibm037' : 'cp037',
- 'ebcdic_cp_ca' : 'cp037',
- 'ebcdic_cp_nl' : 'cp037',
- 'ebcdic_cp_us' : 'cp037',
- 'ebcdic_cp_wt' : 'cp037',
- 'ibm037' : 'cp037',
- 'ibm039' : 'cp037',
+ "037" : "cp037",
+ "csibm037" : "cp037",
+ "ebcdic_cp_ca" : "cp037",
+ "ebcdic_cp_nl" : "cp037",
+ "ebcdic_cp_us" : "cp037",
+ "ebcdic_cp_wt" : "cp037",
+ "ibm037" : "cp037",
+ "ibm039" : "cp037",
# cp1026 codec
- '1026' : 'cp1026',
- 'csibm1026' : 'cp1026',
- 'ibm1026' : 'cp1026',
+ "1026" : "cp1026",
+ "csibm1026" : "cp1026",
+ "ibm1026" : "cp1026",
# cp1125 codec
- '1125' : 'cp1125',
- 'ibm1125' : 'cp1125',
- 'cp866u' : 'cp1125',
- 'ruscii' : 'cp1125',
+ "1125" : "cp1125",
+ "ibm1125" : "cp1125",
+ "cp866u" : "cp1125",
+ "ruscii" : "cp1125",
# cp1140 codec
- '1140' : 'cp1140',
- 'ibm1140' : 'cp1140',
+ "1140" : "cp1140",
+ "ibm1140" : "cp1140",
# cp1250 codec
- '1250' : 'cp1250',
- 'windows_1250' : 'cp1250',
+ "1250" : "cp1250",
+ "windows_1250" : "cp1250",
# cp1251 codec
- '1251' : 'cp1251',
- 'windows_1251' : 'cp1251',
+ "1251" : "cp1251",
+ "windows_1251" : "cp1251",
# cp1252 codec
- '1252' : 'cp1252',
- 'windows_1252' : 'cp1252',
+ "1252" : "cp1252",
+ "windows_1252" : "cp1252",
# cp1253 codec
- '1253' : 'cp1253',
- 'windows_1253' : 'cp1253',
+ "1253" : "cp1253",
+ "windows_1253" : "cp1253",
# cp1254 codec
- '1254' : 'cp1254',
- 'windows_1254' : 'cp1254',
+ "1254" : "cp1254",
+ "windows_1254" : "cp1254",
# cp1255 codec
- '1255' : 'cp1255',
- 'windows_1255' : 'cp1255',
+ "1255" : "cp1255",
+ "windows_1255" : "cp1255",
# cp1256 codec
- '1256' : 'cp1256',
- 'windows_1256' : 'cp1256',
+ "1256" : "cp1256",
+ "windows_1256" : "cp1256",
# cp1257 codec
- '1257' : 'cp1257',
- 'windows_1257' : 'cp1257',
+ "1257" : "cp1257",
+ "windows_1257" : "cp1257",
# cp1258 codec
- '1258' : 'cp1258',
- 'windows_1258' : 'cp1258',
+ "1258" : "cp1258",
+ "windows_1258" : "cp1258",
# cp273 codec
- '273' : 'cp273',
- 'ibm273' : 'cp273',
- 'csibm273' : 'cp273',
+ "273" : "cp273",
+ "ibm273" : "cp273",
+ "csibm273" : "cp273",
# cp424 codec
- '424' : 'cp424',
- 'csibm424' : 'cp424',
- 'ebcdic_cp_he' : 'cp424',
- 'ibm424' : 'cp424',
+ "424" : "cp424",
+ "csibm424" : "cp424",
+ "ebcdic_cp_he" : "cp424",
+ "ibm424" : "cp424",
# cp437 codec
- '437' : 'cp437',
- 'cspc8codepage437' : 'cp437',
- 'ibm437' : 'cp437',
+ "437" : "cp437",
+ "cspc8codepage437" : "cp437",
+ "ibm437" : "cp437",
# cp500 codec
- '500' : 'cp500',
- 'csibm500' : 'cp500',
- 'ebcdic_cp_be' : 'cp500',
- 'ebcdic_cp_ch' : 'cp500',
- 'ibm500' : 'cp500',
+ "500" : "cp500",
+ "csibm500" : "cp500",
+ "ebcdic_cp_be" : "cp500",
+ "ebcdic_cp_ch" : "cp500",
+ "ibm500" : "cp500",
# cp775 codec
- '775' : 'cp775',
- 'cspc775baltic' : 'cp775',
- 'ibm775' : 'cp775',
+ "775" : "cp775",
+ "cspc775baltic" : "cp775",
+ "ibm775" : "cp775",
# cp850 codec
- '850' : 'cp850',
- 'cspc850multilingual' : 'cp850',
- 'ibm850' : 'cp850',
+ "850" : "cp850",
+ "cspc850multilingual" : "cp850",
+ "ibm850" : "cp850",
# cp852 codec
- '852' : 'cp852',
- 'cspcp852' : 'cp852',
- 'ibm852' : 'cp852',
+ "852" : "cp852",
+ "cspcp852" : "cp852",
+ "ibm852" : "cp852",
# cp855 codec
- '855' : 'cp855',
- 'csibm855' : 'cp855',
- 'ibm855' : 'cp855',
+ "855" : "cp855",
+ "csibm855" : "cp855",
+ "ibm855" : "cp855",
# cp857 codec
- '857' : 'cp857',
- 'csibm857' : 'cp857',
- 'ibm857' : 'cp857',
+ "857" : "cp857",
+ "csibm857" : "cp857",
+ "ibm857" : "cp857",
# cp858 codec
- '858' : 'cp858',
- 'csibm858' : 'cp858',
- 'ibm858' : 'cp858',
+ "858" : "cp858",
+ "csibm858" : "cp858",
+ "ibm858" : "cp858",
# cp860 codec
- '860' : 'cp860',
- 'csibm860' : 'cp860',
- 'ibm860' : 'cp860',
+ "860" : "cp860",
+ "csibm860" : "cp860",
+ "ibm860" : "cp860",
# cp861 codec
- '861' : 'cp861',
- 'cp_is' : 'cp861',
- 'csibm861' : 'cp861',
- 'ibm861' : 'cp861',
+ "861" : "cp861",
+ "cp_is" : "cp861",
+ "csibm861" : "cp861",
+ "ibm861" : "cp861",
# cp862 codec
- '862' : 'cp862',
- 'cspc862latinhebrew' : 'cp862',
- 'ibm862' : 'cp862',
+ "862" : "cp862",
+ "cspc862latinhebrew" : "cp862",
+ "ibm862" : "cp862",
# cp863 codec
- '863' : 'cp863',
- 'csibm863' : 'cp863',
- 'ibm863' : 'cp863',
+ "863" : "cp863",
+ "csibm863" : "cp863",
+ "ibm863" : "cp863",
# cp864 codec
- '864' : 'cp864',
- 'csibm864' : 'cp864',
- 'ibm864' : 'cp864',
+ "864" : "cp864",
+ "csibm864" : "cp864",
+ "ibm864" : "cp864",
# cp865 codec
- '865' : 'cp865',
- 'csibm865' : 'cp865',
- 'ibm865' : 'cp865',
+ "865" : "cp865",
+ "csibm865" : "cp865",
+ "ibm865" : "cp865",
# cp866 codec
- '866' : 'cp866',
- 'csibm866' : 'cp866',
- 'ibm866' : 'cp866',
+ "866" : "cp866",
+ "csibm866" : "cp866",
+ "ibm866" : "cp866",
# cp869 codec
- '869' : 'cp869',
- 'cp_gr' : 'cp869',
- 'csibm869' : 'cp869',
- 'ibm869' : 'cp869',
+ "869" : "cp869",
+ "cp_gr" : "cp869",
+ "csibm869" : "cp869",
+ "ibm869" : "cp869",
# cp932 codec
- '932' : 'cp932',
- 'ms932' : 'cp932',
- 'mskanji' : 'cp932',
- 'ms_kanji' : 'cp932',
+ "932" : "cp932",
+ "ms932" : "cp932",
+ "mskanji" : "cp932",
+ "ms_kanji" : "cp932",
# cp949 codec
- '949' : 'cp949',
- 'ms949' : 'cp949',
- 'uhc' : 'cp949',
+ "949" : "cp949",
+ "ms949" : "cp949",
+ "uhc" : "cp949",
# cp950 codec
- '950' : 'cp950',
- 'ms950' : 'cp950',
+ "950" : "cp950",
+ "ms950" : "cp950",
# euc_jis_2004 codec
- 'jisx0213' : 'euc_jis_2004',
- 'eucjis2004' : 'euc_jis_2004',
- 'euc_jis2004' : 'euc_jis_2004',
+ "jisx0213" : "euc_jis_2004",
+ "eucjis2004" : "euc_jis_2004",
+ "euc_jis2004" : "euc_jis_2004",
# euc_jisx0213 codec
- 'eucjisx0213' : 'euc_jisx0213',
+ "eucjisx0213" : "euc_jisx0213",
# euc_jp codec
- 'eucjp' : 'euc_jp',
- 'ujis' : 'euc_jp',
- 'u_jis' : 'euc_jp',
+ "eucjp" : "euc_jp",
+ "ujis" : "euc_jp",
+ "u_jis" : "euc_jp",
# euc_kr codec
- 'euckr' : 'euc_kr',
- 'korean' : 'euc_kr',
- 'ksc5601' : 'euc_kr',
- 'ks_c_5601' : 'euc_kr',
- 'ks_c_5601_1987' : 'euc_kr',
- 'ksx1001' : 'euc_kr',
- 'ks_x_1001' : 'euc_kr',
+ "euckr" : "euc_kr",
+ "korean" : "euc_kr",
+ "ksc5601" : "euc_kr",
+ "ks_c_5601" : "euc_kr",
+ "ks_c_5601_1987" : "euc_kr",
+ "ksx1001" : "euc_kr",
+ "ks_x_1001" : "euc_kr",
# gb18030 codec
- 'gb18030_2000' : 'gb18030',
+ "gb18030_2000" : "gb18030",
# gb2312 codec
- 'chinese' : 'gb2312',
- 'csiso58gb231280' : 'gb2312',
- 'euc_cn' : 'gb2312',
- 'euccn' : 'gb2312',
- 'eucgb2312_cn' : 'gb2312',
- 'gb2312_1980' : 'gb2312',
- 'gb2312_80' : 'gb2312',
- 'iso_ir_58' : 'gb2312',
+ "chinese" : "gb2312",
+ "csiso58gb231280" : "gb2312",
+ "euc_cn" : "gb2312",
+ "euccn" : "gb2312",
+ "eucgb2312_cn" : "gb2312",
+ "gb2312_1980" : "gb2312",
+ "gb2312_80" : "gb2312",
+ "iso_ir_58" : "gb2312",
# gbk codec
- '936' : 'gbk',
- 'cp936' : 'gbk',
- 'ms936' : 'gbk',
+ "936" : "gbk",
+ "cp936" : "gbk",
+ "ms936" : "gbk",
# hex_codec codec
- 'hex' : 'hex_codec',
+ "hex" : "hex_codec",
# hp_roman8 codec
- 'roman8' : 'hp_roman8',
- 'r8' : 'hp_roman8',
- 'csHPRoman8' : 'hp_roman8',
- 'cp1051' : 'hp_roman8',
- 'ibm1051' : 'hp_roman8',
+ "roman8" : "hp_roman8",
+ "r8" : "hp_roman8",
+ "csHPRoman8" : "hp_roman8",
+ "cp1051" : "hp_roman8",
+ "ibm1051" : "hp_roman8",
# hz codec
- 'hzgb' : 'hz',
- 'hz_gb' : 'hz',
- 'hz_gb_2312' : 'hz',
+ "hzgb" : "hz",
+ "hz_gb" : "hz",
+ "hz_gb_2312" : "hz",
# iso2022_jp codec
- 'csiso2022jp' : 'iso2022_jp',
- 'iso2022jp' : 'iso2022_jp',
- 'iso_2022_jp' : 'iso2022_jp',
+ "csiso2022jp" : "iso2022_jp",
+ "iso2022jp" : "iso2022_jp",
+ "iso_2022_jp" : "iso2022_jp",
# iso2022_jp_1 codec
- 'iso2022jp_1' : 'iso2022_jp_1',
- 'iso_2022_jp_1' : 'iso2022_jp_1',
+ "iso2022jp_1" : "iso2022_jp_1",
+ "iso_2022_jp_1" : "iso2022_jp_1",
# iso2022_jp_2 codec
- 'iso2022jp_2' : 'iso2022_jp_2',
- 'iso_2022_jp_2' : 'iso2022_jp_2',
+ "iso2022jp_2" : "iso2022_jp_2",
+ "iso_2022_jp_2" : "iso2022_jp_2",
# iso2022_jp_2004 codec
- 'iso_2022_jp_2004' : 'iso2022_jp_2004',
- 'iso2022jp_2004' : 'iso2022_jp_2004',
+ "iso_2022_jp_2004" : "iso2022_jp_2004",
+ "iso2022jp_2004" : "iso2022_jp_2004",
# iso2022_jp_3 codec
- 'iso2022jp_3' : 'iso2022_jp_3',
- 'iso_2022_jp_3' : 'iso2022_jp_3',
+ "iso2022jp_3" : "iso2022_jp_3",
+ "iso_2022_jp_3" : "iso2022_jp_3",
# iso2022_jp_ext codec
- 'iso2022jp_ext' : 'iso2022_jp_ext',
- 'iso_2022_jp_ext' : 'iso2022_jp_ext',
+ "iso2022jp_ext" : "iso2022_jp_ext",
+ "iso_2022_jp_ext" : "iso2022_jp_ext",
# iso2022_kr codec
- 'csiso2022kr' : 'iso2022_kr',
- 'iso2022kr' : 'iso2022_kr',
- 'iso_2022_kr' : 'iso2022_kr',
+ "csiso2022kr" : "iso2022_kr",
+ "iso2022kr" : "iso2022_kr",
+ "iso_2022_kr" : "iso2022_kr",
# iso8859_10 codec
- 'csisolatin6' : 'iso8859_10',
- 'iso_8859_10' : 'iso8859_10',
- 'iso_8859_10_1992' : 'iso8859_10',
- 'iso_ir_157' : 'iso8859_10',
- 'l6' : 'iso8859_10',
- 'latin6' : 'iso8859_10',
+ "csisolatin6" : "iso8859_10",
+ "iso_8859_10" : "iso8859_10",
+ "iso_8859_10_1992" : "iso8859_10",
+ "iso_ir_157" : "iso8859_10",
+ "l6" : "iso8859_10",
+ "latin6" : "iso8859_10",
# iso8859_11 codec
- 'thai' : 'iso8859_11',
- 'iso_8859_11' : 'iso8859_11',
- 'iso_8859_11_2001' : 'iso8859_11',
+ "thai" : "iso8859_11",
+ "iso_8859_11" : "iso8859_11",
+ "iso_8859_11_2001" : "iso8859_11",
# iso8859_13 codec
- 'iso_8859_13' : 'iso8859_13',
- 'l7' : 'iso8859_13',
- 'latin7' : 'iso8859_13',
+ "iso_8859_13" : "iso8859_13",
+ "l7" : "iso8859_13",
+ "latin7" : "iso8859_13",
# iso8859_14 codec
- 'iso_8859_14' : 'iso8859_14',
- 'iso_8859_14_1998' : 'iso8859_14',
- 'iso_celtic' : 'iso8859_14',
- 'iso_ir_199' : 'iso8859_14',
- 'l8' : 'iso8859_14',
- 'latin8' : 'iso8859_14',
+ "iso_8859_14" : "iso8859_14",
+ "iso_8859_14_1998" : "iso8859_14",
+ "iso_celtic" : "iso8859_14",
+ "iso_ir_199" : "iso8859_14",
+ "l8" : "iso8859_14",
+ "latin8" : "iso8859_14",
# iso8859_15 codec
- 'iso_8859_15' : 'iso8859_15',
- 'l9' : 'iso8859_15',
- 'latin9' : 'iso8859_15',
+ "iso_8859_15" : "iso8859_15",
+ "l9" : "iso8859_15",
+ "latin9" : "iso8859_15",
# iso8859_16 codec
- 'iso_8859_16' : 'iso8859_16',
- 'iso_8859_16_2001' : 'iso8859_16',
- 'iso_ir_226' : 'iso8859_16',
- 'l10' : 'iso8859_16',
- 'latin10' : 'iso8859_16',
+ "iso_8859_16" : "iso8859_16",
+ "iso_8859_16_2001" : "iso8859_16",
+ "iso_ir_226" : "iso8859_16",
+ "l10" : "iso8859_16",
+ "latin10" : "iso8859_16",
# iso8859_2 codec
- 'csisolatin2' : 'iso8859_2',
- 'iso_8859_2' : 'iso8859_2',
- 'iso_8859_2_1987' : 'iso8859_2',
- 'iso_ir_101' : 'iso8859_2',
- 'l2' : 'iso8859_2',
- 'latin2' : 'iso8859_2',
+ "csisolatin2" : "iso8859_2",
+ "iso_8859_2" : "iso8859_2",
+ "iso_8859_2_1987" : "iso8859_2",
+ "iso_ir_101" : "iso8859_2",
+ "l2" : "iso8859_2",
+ "latin2" : "iso8859_2",
# iso8859_3 codec
- 'csisolatin3' : 'iso8859_3',
- 'iso_8859_3' : 'iso8859_3',
- 'iso_8859_3_1988' : 'iso8859_3',
- 'iso_ir_109' : 'iso8859_3',
- 'l3' : 'iso8859_3',
- 'latin3' : 'iso8859_3',
+ "csisolatin3" : "iso8859_3",
+ "iso_8859_3" : "iso8859_3",
+ "iso_8859_3_1988" : "iso8859_3",
+ "iso_ir_109" : "iso8859_3",
+ "l3" : "iso8859_3",
+ "latin3" : "iso8859_3",
# iso8859_4 codec
- 'csisolatin4' : 'iso8859_4',
- 'iso_8859_4' : 'iso8859_4',
- 'iso_8859_4_1988' : 'iso8859_4',
- 'iso_ir_110' : 'iso8859_4',
- 'l4' : 'iso8859_4',
- 'latin4' : 'iso8859_4',
+ "csisolatin4" : "iso8859_4",
+ "iso_8859_4" : "iso8859_4",
+ "iso_8859_4_1988" : "iso8859_4",
+ "iso_ir_110" : "iso8859_4",
+ "l4" : "iso8859_4",
+ "latin4" : "iso8859_4",
# iso8859_5 codec
- 'csisolatincyrillic' : 'iso8859_5',
- 'cyrillic' : 'iso8859_5',
- 'iso_8859_5' : 'iso8859_5',
- 'iso_8859_5_1988' : 'iso8859_5',
- 'iso_ir_144' : 'iso8859_5',
+ "csisolatincyrillic" : "iso8859_5",
+ "cyrillic" : "iso8859_5",
+ "iso_8859_5" : "iso8859_5",
+ "iso_8859_5_1988" : "iso8859_5",
+ "iso_ir_144" : "iso8859_5",
# iso8859_6 codec
- 'arabic' : 'iso8859_6',
- 'asmo_708' : 'iso8859_6',
- 'csisolatinarabic' : 'iso8859_6',
- 'ecma_114' : 'iso8859_6',
- 'iso_8859_6' : 'iso8859_6',
- 'iso_8859_6_1987' : 'iso8859_6',
- 'iso_ir_127' : 'iso8859_6',
+ "arabic" : "iso8859_6",
+ "asmo_708" : "iso8859_6",
+ "csisolatinarabic" : "iso8859_6",
+ "ecma_114" : "iso8859_6",
+ "iso_8859_6" : "iso8859_6",
+ "iso_8859_6_1987" : "iso8859_6",
+ "iso_ir_127" : "iso8859_6",
# iso8859_7 codec
- 'csisolatingreek' : 'iso8859_7',
- 'ecma_118' : 'iso8859_7',
- 'elot_928' : 'iso8859_7',
- 'greek' : 'iso8859_7',
- 'greek8' : 'iso8859_7',
- 'iso_8859_7' : 'iso8859_7',
- 'iso_8859_7_1987' : 'iso8859_7',
- 'iso_ir_126' : 'iso8859_7',
+ "csisolatingreek" : "iso8859_7",
+ "ecma_118" : "iso8859_7",
+ "elot_928" : "iso8859_7",
+ "greek" : "iso8859_7",
+ "greek8" : "iso8859_7",
+ "iso_8859_7" : "iso8859_7",
+ "iso_8859_7_1987" : "iso8859_7",
+ "iso_ir_126" : "iso8859_7",
# iso8859_8 codec
- 'csisolatinhebrew' : 'iso8859_8',
- 'hebrew' : 'iso8859_8',
- 'iso_8859_8' : 'iso8859_8',
- 'iso_8859_8_1988' : 'iso8859_8',
- 'iso_ir_138' : 'iso8859_8',
+ "csisolatinhebrew" : "iso8859_8",
+ "hebrew" : "iso8859_8",
+ "iso_8859_8" : "iso8859_8",
+ "iso_8859_8_1988" : "iso8859_8",
+ "iso_ir_138" : "iso8859_8",
# iso8859_9 codec
- 'csisolatin5' : 'iso8859_9',
- 'iso_8859_9' : 'iso8859_9',
- 'iso_8859_9_1989' : 'iso8859_9',
- 'iso_ir_148' : 'iso8859_9',
- 'l5' : 'iso8859_9',
- 'latin5' : 'iso8859_9',
+ "csisolatin5" : "iso8859_9",
+ "iso_8859_9" : "iso8859_9",
+ "iso_8859_9_1989" : "iso8859_9",
+ "iso_ir_148" : "iso8859_9",
+ "l5" : "iso8859_9",
+ "latin5" : "iso8859_9",
# johab codec
- 'cp1361' : 'johab',
- 'ms1361' : 'johab',
+ "cp1361" : "johab",
+ "ms1361" : "johab",
# koi8_r codec
- 'cskoi8r' : 'koi8_r',
+ "cskoi8r" : "koi8_r",
# kz1048 codec
- 'kz_1048' : 'kz1048',
- 'rk1048' : 'kz1048',
- 'strk1048_2002' : 'kz1048',
+ "kz_1048" : "kz1048",
+ "rk1048" : "kz1048",
+ "strk1048_2002" : "kz1048",
# latin_1 codec
#
@@ -426,126 +426,126 @@
# encoding. This is why we discourage the use of the iso8859_1
# codec and alias it to latin_1 instead.
#
- '8859' : 'latin_1',
- 'cp819' : 'latin_1',
- 'csisolatin1' : 'latin_1',
- 'ibm819' : 'latin_1',
- 'iso8859' : 'latin_1',
- 'iso8859_1' : 'latin_1',
- 'iso_8859_1' : 'latin_1',
- 'iso_8859_1_1987' : 'latin_1',
- 'iso_ir_100' : 'latin_1',
- 'l1' : 'latin_1',
- 'latin' : 'latin_1',
- 'latin1' : 'latin_1',
+ "8859" : "latin_1",
+ "cp819" : "latin_1",
+ "csisolatin1" : "latin_1",
+ "ibm819" : "latin_1",
+ "iso8859" : "latin_1",
+ "iso8859_1" : "latin_1",
+ "iso_8859_1" : "latin_1",
+ "iso_8859_1_1987" : "latin_1",
+ "iso_ir_100" : "latin_1",
+ "l1" : "latin_1",
+ "latin" : "latin_1",
+ "latin1" : "latin_1",
# mac_cyrillic codec
- 'maccyrillic' : 'mac_cyrillic',
+ "maccyrillic" : "mac_cyrillic",
# mac_greek codec
- 'macgreek' : 'mac_greek',
+ "macgreek" : "mac_greek",
# mac_iceland codec
- 'maciceland' : 'mac_iceland',
+ "maciceland" : "mac_iceland",
# mac_latin2 codec
- 'maccentraleurope' : 'mac_latin2',
- 'mac_centeuro' : 'mac_latin2',
- 'maclatin2' : 'mac_latin2',
+ "maccentraleurope" : "mac_latin2",
+ "mac_centeuro" : "mac_latin2",
+ "maclatin2" : "mac_latin2",
# mac_roman codec
- 'macintosh' : 'mac_roman',
- 'macroman' : 'mac_roman',
+ "macintosh" : "mac_roman",
+ "macroman" : "mac_roman",
# mac_turkish codec
- 'macturkish' : 'mac_turkish',
+ "macturkish" : "mac_turkish",
# mbcs codec
- 'ansi' : 'mbcs',
- 'dbcs' : 'mbcs',
+ "ansi" : "mbcs",
+ "dbcs" : "mbcs",
# ptcp154 codec
- 'csptcp154' : 'ptcp154',
- 'pt154' : 'ptcp154',
- 'cp154' : 'ptcp154',
- 'cyrillic_asian' : 'ptcp154',
+ "csptcp154" : "ptcp154",
+ "pt154" : "ptcp154",
+ "cp154" : "ptcp154",
+ "cyrillic_asian" : "ptcp154",
# quopri_codec codec
- 'quopri' : 'quopri_codec',
- 'quoted_printable' : 'quopri_codec',
- 'quotedprintable' : 'quopri_codec',
+ "quopri" : "quopri_codec",
+ "quoted_printable" : "quopri_codec",
+ "quotedprintable" : "quopri_codec",
# rot_13 codec
- 'rot13' : 'rot_13',
+ "rot13" : "rot_13",
# shift_jis codec
- 'csshiftjis' : 'shift_jis',
- 'shiftjis' : 'shift_jis',
- 'sjis' : 'shift_jis',
- 's_jis' : 'shift_jis',
+ "csshiftjis" : "shift_jis",
+ "shiftjis" : "shift_jis",
+ "sjis" : "shift_jis",
+ "s_jis" : "shift_jis",
# shift_jis_2004 codec
- 'shiftjis2004' : 'shift_jis_2004',
- 'sjis_2004' : 'shift_jis_2004',
- 's_jis_2004' : 'shift_jis_2004',
+ "shiftjis2004" : "shift_jis_2004",
+ "sjis_2004" : "shift_jis_2004",
+ "s_jis_2004" : "shift_jis_2004",
# shift_jisx0213 codec
- 'shiftjisx0213' : 'shift_jisx0213',
- 'sjisx0213' : 'shift_jisx0213',
- 's_jisx0213' : 'shift_jisx0213',
+ "shiftjisx0213" : "shift_jisx0213",
+ "sjisx0213" : "shift_jisx0213",
+ "s_jisx0213" : "shift_jisx0213",
# tis_620 codec
- 'tis620' : 'tis_620',
- 'tis_620_0' : 'tis_620',
- 'tis_620_2529_0' : 'tis_620',
- 'tis_620_2529_1' : 'tis_620',
- 'iso_ir_166' : 'tis_620',
+ "tis620" : "tis_620",
+ "tis_620_0" : "tis_620",
+ "tis_620_2529_0" : "tis_620",
+ "tis_620_2529_1" : "tis_620",
+ "iso_ir_166" : "tis_620",
# utf_16 codec
- 'u16' : 'utf_16',
- 'utf16' : 'utf_16',
+ "u16" : "utf_16",
+ "utf16" : "utf_16",
# utf_16_be codec
- 'unicodebigunmarked' : 'utf_16_be',
- 'utf_16be' : 'utf_16_be',
+ "unicodebigunmarked" : "utf_16_be",
+ "utf_16be" : "utf_16_be",
# utf_16_le codec
- 'unicodelittleunmarked' : 'utf_16_le',
- 'utf_16le' : 'utf_16_le',
+ "unicodelittleunmarked" : "utf_16_le",
+ "utf_16le" : "utf_16_le",
# utf_32 codec
- 'u32' : 'utf_32',
- 'utf32' : 'utf_32',
+ "u32" : "utf_32",
+ "utf32" : "utf_32",
# utf_32_be codec
- 'utf_32be' : 'utf_32_be',
+ "utf_32be" : "utf_32_be",
# utf_32_le codec
- 'utf_32le' : 'utf_32_le',
+ "utf_32le" : "utf_32_le",
# utf_7 codec
- 'u7' : 'utf_7',
- 'utf7' : 'utf_7',
- 'unicode_1_1_utf_7' : 'utf_7',
+ "u7" : "utf_7",
+ "utf7" : "utf_7",
+ "unicode_1_1_utf_7" : "utf_7",
# utf_8 codec
- 'u8' : 'utf_8',
- 'utf' : 'utf_8',
- 'utf8' : 'utf_8',
- 'utf8_ucs2' : 'utf_8',
- 'utf8_ucs4' : 'utf_8',
- 'cp65001' : 'utf_8',
+ "u8" : "utf_8",
+ "utf" : "utf_8",
+ "utf8" : "utf_8",
+ "utf8_ucs2" : "utf_8",
+ "utf8_ucs4" : "utf_8",
+ "cp65001" : "utf_8",
# uu_codec codec
- 'uu' : 'uu_codec',
+ "uu" : "uu_codec",
# zlib_codec codec
- 'zip' : 'zlib_codec',
- 'zlib' : 'zlib_codec',
+ "zip" : "zlib_codec",
+ "zlib" : "zlib_codec",
# temporary mac CJK aliases, will be replaced by proper codecs in 3.1
- 'x_mac_japanese' : 'shift_jis',
- 'x_mac_korean' : 'euc_kr',
- 'x_mac_simp_chinese' : 'gb2312',
- 'x_mac_trad_chinese' : 'big5',
+ "x_mac_japanese" : "shift_jis",
+ "x_mac_korean" : "euc_kr",
+ "x_mac_simp_chinese" : "gb2312",
+ "x_mac_trad_chinese" : "big5",
}
diff --git a/.venv3.10/Lib/encodings/ascii.py b/.venv3.10/Lib/encodings/ascii.py
index 2033cde9..8aae8b8d 100644
--- a/.venv3.10/Lib/encodings/ascii.py
+++ b/.venv3.10/Lib/encodings/ascii.py
@@ -40,7 +40,7 @@ class StreamConverter(StreamWriter,StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='ascii',
+ name="ascii",
encode=Codec.encode,
decode=Codec.decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/base64_codec.py b/.venv3.10/Lib/encodings/base64_codec.py
index 8e7703b3..09f91c46 100644
--- a/.venv3.10/Lib/encodings/base64_codec.py
+++ b/.venv3.10/Lib/encodings/base64_codec.py
@@ -10,28 +10,28 @@
### Codec APIs
-def base64_encode(input, errors='strict'):
- assert errors == 'strict'
+def base64_encode(input, errors="strict"):
+ assert errors == "strict"
return (base64.encodebytes(input), len(input))
-def base64_decode(input, errors='strict'):
- assert errors == 'strict'
+def base64_decode(input, errors="strict"):
+ assert errors == "strict"
return (base64.decodebytes(input), len(input))
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return base64_encode(input, errors)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return base64_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
- assert self.errors == 'strict'
+ assert self.errors == "strict"
return base64.encodebytes(input)
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
- assert self.errors == 'strict'
+ assert self.errors == "strict"
return base64.decodebytes(input)
class StreamWriter(Codec, codecs.StreamWriter):
@@ -44,7 +44,7 @@ class StreamReader(Codec, codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='base64',
+ name="base64",
encode=base64_encode,
decode=base64_decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/big5.py b/.venv3.10/Lib/encodings/big5.py
index 7adeb0e1..2b1d794f 100644
--- a/.venv3.10/Lib/encodings/big5.py
+++ b/.venv3.10/Lib/encodings/big5.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_tw, codecs
+import _codecs_tw
+import codecs
import _multibytecodec as mbc
-codec = _codecs_tw.getcodec('big5')
+codec = _codecs_tw.getcodec("big5")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='big5',
+ name="big5",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/big5hkscs.py b/.venv3.10/Lib/encodings/big5hkscs.py
index 350df37b..a5b09adf 100644
--- a/.venv3.10/Lib/encodings/big5hkscs.py
+++ b/.venv3.10/Lib/encodings/big5hkscs.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_hk, codecs
+import _codecs_hk
+import codecs
import _multibytecodec as mbc
-codec = _codecs_hk.getcodec('big5hkscs')
+codec = _codecs_hk.getcodec("big5hkscs")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='big5hkscs',
+ name="big5hkscs",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/bz2_codec.py b/.venv3.10/Lib/encodings/bz2_codec.py
index fd9495e3..a2c97bd7 100644
--- a/.venv3.10/Lib/encodings/bz2_codec.py
+++ b/.venv3.10/Lib/encodings/bz2_codec.py
@@ -12,23 +12,23 @@
### Codec APIs
-def bz2_encode(input, errors='strict'):
- assert errors == 'strict'
+def bz2_encode(input, errors="strict"):
+ assert errors == "strict"
return (bz2.compress(input), len(input))
-def bz2_decode(input, errors='strict'):
- assert errors == 'strict'
+def bz2_decode(input, errors="strict"):
+ assert errors == "strict"
return (bz2.decompress(input), len(input))
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return bz2_encode(input, errors)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return bz2_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
+ def __init__(self, errors="strict"):
+ assert errors == "strict"
self.errors = errors
self.compressobj = bz2.BZ2Compressor()
@@ -43,8 +43,8 @@ def reset(self):
self.compressobj = bz2.BZ2Compressor()
class IncrementalDecoder(codecs.IncrementalDecoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
+ def __init__(self, errors="strict"):
+ assert errors == "strict"
self.errors = errors
self.decompressobj = bz2.BZ2Decompressor()
@@ -52,7 +52,7 @@ def decode(self, input, final=False):
try:
return self.decompressobj.decompress(input)
except EOFError:
- return ''
+ return ""
def reset(self):
self.decompressobj = bz2.BZ2Decompressor()
diff --git a/.venv3.10/Lib/encodings/charmap.py b/.venv3.10/Lib/encodings/charmap.py
index 81189b16..c4e87910 100644
--- a/.venv3.10/Lib/encodings/charmap.py
+++ b/.venv3.10/Lib/encodings/charmap.py
@@ -22,7 +22,7 @@ class Codec(codecs.Codec):
decode = codecs.charmap_decode
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict', mapping=None):
+ def __init__(self, errors="strict", mapping=None):
codecs.IncrementalEncoder.__init__(self, errors)
self.mapping = mapping
@@ -30,7 +30,7 @@ def encode(self, input, final=False):
return codecs.charmap_encode(input, self.errors, self.mapping)[0]
class IncrementalDecoder(codecs.IncrementalDecoder):
- def __init__(self, errors='strict', mapping=None):
+ def __init__(self, errors="strict", mapping=None):
codecs.IncrementalDecoder.__init__(self, errors)
self.mapping = mapping
@@ -39,27 +39,27 @@ def decode(self, input, final=False):
class StreamWriter(Codec,codecs.StreamWriter):
- def __init__(self,stream,errors='strict',mapping=None):
+ def __init__(self,stream,errors="strict",mapping=None):
codecs.StreamWriter.__init__(self,stream,errors)
self.mapping = mapping
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return Codec.encode(input,errors,self.mapping)
class StreamReader(Codec,codecs.StreamReader):
- def __init__(self,stream,errors='strict',mapping=None):
+ def __init__(self,stream,errors="strict",mapping=None):
codecs.StreamReader.__init__(self,stream,errors)
self.mapping = mapping
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return Codec.decode(input,errors,self.mapping)
### encodings module API
def getregentry():
return codecs.CodecInfo(
- name='charmap',
+ name="charmap",
encode=Codec.encode,
decode=Codec.decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp037.py b/.venv3.10/Lib/encodings/cp037.py
index 4edd708f..8581cc9f 100644
--- a/.venv3.10/Lib/encodings/cp037.py
+++ b/.venv3.10/Lib/encodings/cp037.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp037',
+ name="cp037",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1006.py b/.venv3.10/Lib/encodings/cp1006.py
index a1221c3e..ba2e9f48 100644
--- a/.venv3.10/Lib/encodings/cp1006.py
+++ b/.venv3.10/Lib/encodings/cp1006.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1006',
+ name="cp1006",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1026.py b/.venv3.10/Lib/encodings/cp1026.py
index 46f71f74..e1570e12 100644
--- a/.venv3.10/Lib/encodings/cp1026.py
+++ b/.venv3.10/Lib/encodings/cp1026.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1026',
+ name="cp1026",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1125.py b/.venv3.10/Lib/encodings/cp1125.py
index b1fd69de..7c7e67cf 100644
--- a/.venv3.10/Lib/encodings/cp1125.py
+++ b/.venv3.10/Lib/encodings/cp1125.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1125',
+ name="cp1125",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1140.py b/.venv3.10/Lib/encodings/cp1140.py
index 0a919d83..9576998c 100644
--- a/.venv3.10/Lib/encodings/cp1140.py
+++ b/.venv3.10/Lib/encodings/cp1140.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1140',
+ name="cp1140",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1250.py b/.venv3.10/Lib/encodings/cp1250.py
index c2c83aaf..67d7bb6b 100644
--- a/.venv3.10/Lib/encodings/cp1250.py
+++ b/.venv3.10/Lib/encodings/cp1250.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1250',
+ name="cp1250",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1251.py b/.venv3.10/Lib/encodings/cp1251.py
index 22bc6600..4c8462e9 100644
--- a/.venv3.10/Lib/encodings/cp1251.py
+++ b/.venv3.10/Lib/encodings/cp1251.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1251',
+ name="cp1251",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1252.py b/.venv3.10/Lib/encodings/cp1252.py
index c0e8088e..6b546fbf 100644
--- a/.venv3.10/Lib/encodings/cp1252.py
+++ b/.venv3.10/Lib/encodings/cp1252.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1252',
+ name="cp1252",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1253.py b/.venv3.10/Lib/encodings/cp1253.py
index ec9c0972..e48745b4 100644
--- a/.venv3.10/Lib/encodings/cp1253.py
+++ b/.venv3.10/Lib/encodings/cp1253.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1253',
+ name="cp1253",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1254.py b/.venv3.10/Lib/encodings/cp1254.py
index 4912327a..03b36501 100644
--- a/.venv3.10/Lib/encodings/cp1254.py
+++ b/.venv3.10/Lib/encodings/cp1254.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1254',
+ name="cp1254",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1255.py b/.venv3.10/Lib/encodings/cp1255.py
index 91ce26b9..595a4530 100644
--- a/.venv3.10/Lib/encodings/cp1255.py
+++ b/.venv3.10/Lib/encodings/cp1255.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1255',
+ name="cp1255",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1256.py b/.venv3.10/Lib/encodings/cp1256.py
index fd6afab5..971189f2 100644
--- a/.venv3.10/Lib/encodings/cp1256.py
+++ b/.venv3.10/Lib/encodings/cp1256.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1256',
+ name="cp1256",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1257.py b/.venv3.10/Lib/encodings/cp1257.py
index 9ebc90d5..ff896744 100644
--- a/.venv3.10/Lib/encodings/cp1257.py
+++ b/.venv3.10/Lib/encodings/cp1257.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1257',
+ name="cp1257",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp1258.py b/.venv3.10/Lib/encodings/cp1258.py
index 784378a8..99975c63 100644
--- a/.venv3.10/Lib/encodings/cp1258.py
+++ b/.venv3.10/Lib/encodings/cp1258.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp1258',
+ name="cp1258",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp273.py b/.venv3.10/Lib/encodings/cp273.py
index 69c6d778..66a61222 100644
--- a/.venv3.10/Lib/encodings/cp273.py
+++ b/.venv3.10/Lib/encodings/cp273.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp273',
+ name="cp273",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp424.py b/.venv3.10/Lib/encodings/cp424.py
index 6753daf1..3ef39480 100644
--- a/.venv3.10/Lib/encodings/cp424.py
+++ b/.venv3.10/Lib/encodings/cp424.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp424',
+ name="cp424",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp437.py b/.venv3.10/Lib/encodings/cp437.py
index b6c75e2c..6ffe1200 100644
--- a/.venv3.10/Lib/encodings/cp437.py
+++ b/.venv3.10/Lib/encodings/cp437.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp437',
+ name="cp437",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp500.py b/.venv3.10/Lib/encodings/cp500.py
index 5f61535f..24ea73b2 100644
--- a/.venv3.10/Lib/encodings/cp500.py
+++ b/.venv3.10/Lib/encodings/cp500.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp500',
+ name="cp500",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp720.py b/.venv3.10/Lib/encodings/cp720.py
index 96d60961..0118bffa 100644
--- a/.venv3.10/Lib/encodings/cp720.py
+++ b/.venv3.10/Lib/encodings/cp720.py
@@ -10,10 +10,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -34,7 +34,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp720',
+ name="cp720",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp737.py b/.venv3.10/Lib/encodings/cp737.py
index 9685bae7..3bb7cfbf 100644
--- a/.venv3.10/Lib/encodings/cp737.py
+++ b/.venv3.10/Lib/encodings/cp737.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp737',
+ name="cp737",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp775.py b/.venv3.10/Lib/encodings/cp775.py
index fe06e7bc..ae839c5e 100644
--- a/.venv3.10/Lib/encodings/cp775.py
+++ b/.venv3.10/Lib/encodings/cp775.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp775',
+ name="cp775",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp850.py b/.venv3.10/Lib/encodings/cp850.py
index f98aef99..a85ed7d8 100644
--- a/.venv3.10/Lib/encodings/cp850.py
+++ b/.venv3.10/Lib/encodings/cp850.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp850',
+ name="cp850",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp852.py b/.venv3.10/Lib/encodings/cp852.py
index 34d8a0ea..0a8374e5 100644
--- a/.venv3.10/Lib/encodings/cp852.py
+++ b/.venv3.10/Lib/encodings/cp852.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp852',
+ name="cp852",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp855.py b/.venv3.10/Lib/encodings/cp855.py
index 4fe92106..58848c77 100644
--- a/.venv3.10/Lib/encodings/cp855.py
+++ b/.venv3.10/Lib/encodings/cp855.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp855',
+ name="cp855",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp856.py b/.venv3.10/Lib/encodings/cp856.py
index cacbfb2f..38f31fe2 100644
--- a/.venv3.10/Lib/encodings/cp856.py
+++ b/.venv3.10/Lib/encodings/cp856.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp856',
+ name="cp856",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp857.py b/.venv3.10/Lib/encodings/cp857.py
index 741b059b..8bb9c87c 100644
--- a/.venv3.10/Lib/encodings/cp857.py
+++ b/.venv3.10/Lib/encodings/cp857.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp857',
+ name="cp857",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp858.py b/.venv3.10/Lib/encodings/cp858.py
index 7579f525..b87e0b8f 100644
--- a/.venv3.10/Lib/encodings/cp858.py
+++ b/.venv3.10/Lib/encodings/cp858.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp858',
+ name="cp858",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp860.py b/.venv3.10/Lib/encodings/cp860.py
index 65903e74..5bad614d 100644
--- a/.venv3.10/Lib/encodings/cp860.py
+++ b/.venv3.10/Lib/encodings/cp860.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp860',
+ name="cp860",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp861.py b/.venv3.10/Lib/encodings/cp861.py
index 860a05fa..62142848 100644
--- a/.venv3.10/Lib/encodings/cp861.py
+++ b/.venv3.10/Lib/encodings/cp861.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp861',
+ name="cp861",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp862.py b/.venv3.10/Lib/encodings/cp862.py
index 3df22f99..04744a2a 100644
--- a/.venv3.10/Lib/encodings/cp862.py
+++ b/.venv3.10/Lib/encodings/cp862.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp862',
+ name="cp862",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp863.py b/.venv3.10/Lib/encodings/cp863.py
index 764180b6..de341ab3 100644
--- a/.venv3.10/Lib/encodings/cp863.py
+++ b/.venv3.10/Lib/encodings/cp863.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp863',
+ name="cp863",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp864.py b/.venv3.10/Lib/encodings/cp864.py
index 53df482d..07183a80 100644
--- a/.venv3.10/Lib/encodings/cp864.py
+++ b/.venv3.10/Lib/encodings/cp864.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp864',
+ name="cp864",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp865.py b/.venv3.10/Lib/encodings/cp865.py
index 6726cf3f..3837f4c3 100644
--- a/.venv3.10/Lib/encodings/cp865.py
+++ b/.venv3.10/Lib/encodings/cp865.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp865',
+ name="cp865",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp866.py b/.venv3.10/Lib/encodings/cp866.py
index bec7ae39..6c798fd6 100644
--- a/.venv3.10/Lib/encodings/cp866.py
+++ b/.venv3.10/Lib/encodings/cp866.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp866',
+ name="cp866",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp869.py b/.venv3.10/Lib/encodings/cp869.py
index 8d8a29b1..06755be8 100644
--- a/.venv3.10/Lib/encodings/cp869.py
+++ b/.venv3.10/Lib/encodings/cp869.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp869',
+ name="cp869",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp874.py b/.venv3.10/Lib/encodings/cp874.py
index 59bfcbc9..7f832db2 100644
--- a/.venv3.10/Lib/encodings/cp874.py
+++ b/.venv3.10/Lib/encodings/cp874.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp874',
+ name="cp874",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp875.py b/.venv3.10/Lib/encodings/cp875.py
index c25a5a43..d67107b7 100644
--- a/.venv3.10/Lib/encodings/cp875.py
+++ b/.venv3.10/Lib/encodings/cp875.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='cp875',
+ name="cp875",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp932.py b/.venv3.10/Lib/encodings/cp932.py
index e01f59b7..1782597d 100644
--- a/.venv3.10/Lib/encodings/cp932.py
+++ b/.venv3.10/Lib/encodings/cp932.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('cp932')
+codec = _codecs_jp.getcodec("cp932")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='cp932',
+ name="cp932",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp949.py b/.venv3.10/Lib/encodings/cp949.py
index 627c8712..36c090cd 100644
--- a/.venv3.10/Lib/encodings/cp949.py
+++ b/.venv3.10/Lib/encodings/cp949.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_kr, codecs
+import _codecs_kr
+import codecs
import _multibytecodec as mbc
-codec = _codecs_kr.getcodec('cp949')
+codec = _codecs_kr.getcodec("cp949")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='cp949',
+ name="cp949",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/cp950.py b/.venv3.10/Lib/encodings/cp950.py
index 39eec5ed..14252c2e 100644
--- a/.venv3.10/Lib/encodings/cp950.py
+++ b/.venv3.10/Lib/encodings/cp950.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_tw, codecs
+import _codecs_tw
+import codecs
import _multibytecodec as mbc
-codec = _codecs_tw.getcodec('cp950')
+codec = _codecs_tw.getcodec("cp950")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='cp950',
+ name="cp950",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/euc_jis_2004.py b/.venv3.10/Lib/encodings/euc_jis_2004.py
index 72b87aea..79dc4f5f 100644
--- a/.venv3.10/Lib/encodings/euc_jis_2004.py
+++ b/.venv3.10/Lib/encodings/euc_jis_2004.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('euc_jis_2004')
+codec = _codecs_jp.getcodec("euc_jis_2004")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='euc_jis_2004',
+ name="euc_jis_2004",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/euc_jisx0213.py b/.venv3.10/Lib/encodings/euc_jisx0213.py
index cc47d041..d3034987 100644
--- a/.venv3.10/Lib/encodings/euc_jisx0213.py
+++ b/.venv3.10/Lib/encodings/euc_jisx0213.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('euc_jisx0213')
+codec = _codecs_jp.getcodec("euc_jisx0213")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='euc_jisx0213',
+ name="euc_jisx0213",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/euc_jp.py b/.venv3.10/Lib/encodings/euc_jp.py
index 7bcbe414..b7efa894 100644
--- a/.venv3.10/Lib/encodings/euc_jp.py
+++ b/.venv3.10/Lib/encodings/euc_jp.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('euc_jp')
+codec = _codecs_jp.getcodec("euc_jp")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='euc_jp',
+ name="euc_jp",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/euc_kr.py b/.venv3.10/Lib/encodings/euc_kr.py
index c1fb1260..1a98e7ec 100644
--- a/.venv3.10/Lib/encodings/euc_kr.py
+++ b/.venv3.10/Lib/encodings/euc_kr.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_kr, codecs
+import _codecs_kr
+import codecs
import _multibytecodec as mbc
-codec = _codecs_kr.getcodec('euc_kr')
+codec = _codecs_kr.getcodec("euc_kr")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='euc_kr',
+ name="euc_kr",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/gb18030.py b/.venv3.10/Lib/encodings/gb18030.py
index 34fb6c36..59d445f9 100644
--- a/.venv3.10/Lib/encodings/gb18030.py
+++ b/.venv3.10/Lib/encodings/gb18030.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_cn, codecs
+import _codecs_cn
+import codecs
import _multibytecodec as mbc
-codec = _codecs_cn.getcodec('gb18030')
+codec = _codecs_cn.getcodec("gb18030")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='gb18030',
+ name="gb18030",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/gb2312.py b/.venv3.10/Lib/encodings/gb2312.py
index 3c3b837d..37ccab55 100644
--- a/.venv3.10/Lib/encodings/gb2312.py
+++ b/.venv3.10/Lib/encodings/gb2312.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_cn, codecs
+import _codecs_cn
+import codecs
import _multibytecodec as mbc
-codec = _codecs_cn.getcodec('gb2312')
+codec = _codecs_cn.getcodec("gb2312")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='gb2312',
+ name="gb2312",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/gbk.py b/.venv3.10/Lib/encodings/gbk.py
index 1b45db89..33981f29 100644
--- a/.venv3.10/Lib/encodings/gbk.py
+++ b/.venv3.10/Lib/encodings/gbk.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_cn, codecs
+import _codecs_cn
+import codecs
import _multibytecodec as mbc
-codec = _codecs_cn.getcodec('gbk')
+codec = _codecs_cn.getcodec("gbk")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='gbk',
+ name="gbk",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/hex_codec.py b/.venv3.10/Lib/encodings/hex_codec.py
index 9fb10728..8d0a5ad6 100644
--- a/.venv3.10/Lib/encodings/hex_codec.py
+++ b/.venv3.10/Lib/encodings/hex_codec.py
@@ -10,28 +10,28 @@
### Codec APIs
-def hex_encode(input, errors='strict'):
- assert errors == 'strict'
+def hex_encode(input, errors="strict"):
+ assert errors == "strict"
return (binascii.b2a_hex(input), len(input))
-def hex_decode(input, errors='strict'):
- assert errors == 'strict'
+def hex_decode(input, errors="strict"):
+ assert errors == "strict"
return (binascii.a2b_hex(input), len(input))
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return hex_encode(input, errors)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return hex_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
- assert self.errors == 'strict'
+ assert self.errors == "strict"
return binascii.b2a_hex(input)
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
- assert self.errors == 'strict'
+ assert self.errors == "strict"
return binascii.a2b_hex(input)
class StreamWriter(Codec, codecs.StreamWriter):
@@ -44,7 +44,7 @@ class StreamReader(Codec, codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='hex',
+ name="hex",
encode=hex_encode,
decode=hex_decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/hp_roman8.py b/.venv3.10/Lib/encodings/hp_roman8.py
index 58de1033..fe298df8 100644
--- a/.venv3.10/Lib/encodings/hp_roman8.py
+++ b/.venv3.10/Lib/encodings/hp_roman8.py
@@ -15,10 +15,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -39,7 +39,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='hp-roman8',
+ name="hp-roman8",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/hz.py b/.venv3.10/Lib/encodings/hz.py
index 383442a3..118eee57 100644
--- a/.venv3.10/Lib/encodings/hz.py
+++ b/.venv3.10/Lib/encodings/hz.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_cn, codecs
+import _codecs_cn
+import codecs
import _multibytecodec as mbc
-codec = _codecs_cn.getcodec('hz')
+codec = _codecs_cn.getcodec("hz")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='hz',
+ name="hz",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/idna.py b/.venv3.10/Lib/encodings/idna.py
index bf98f513..06a0ec44 100644
--- a/.venv3.10/Lib/encodings/idna.py
+++ b/.venv3.10/Lib/encodings/idna.py
@@ -1,6 +1,8 @@
# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)
-import stringprep, re, codecs
+import stringprep
+import re
+import codecs
from unicodedata import ucd_3_2_0 as unicodedata
# IDNA section 3.1
@@ -142,22 +144,22 @@ def ToUnicode(label):
### Codec APIs
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
- if errors != 'strict':
+ if errors != "strict":
# IDNA is quite clear that implementations must be strict
raise UnicodeError("unsupported error handling "+errors)
if not input:
- return b'', 0
+ return b"", 0
try:
- result = input.encode('ascii')
+ result = input.encode("ascii")
except UnicodeEncodeError:
pass
else:
# ASCII name: fast path
- labels = result.split(b'.')
+ labels = result.split(b".")
for label in labels[:-1]:
if not (0 < len(label) < 64):
raise UnicodeError("label empty or too long")
@@ -168,20 +170,20 @@ def encode(self, input, errors='strict'):
result = bytearray()
labels = dots.split(input)
if labels and not labels[-1]:
- trailing_dot = b'.'
+ trailing_dot = b"."
del labels[-1]
else:
- trailing_dot = b''
+ trailing_dot = b""
for label in labels:
if result:
# Join with U+002E
- result.extend(b'.')
+ result.extend(b".")
result.extend(ToASCII(label))
return bytes(result+trailing_dot), len(input)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
- if errors != 'strict':
+ if errors != "strict":
raise UnicodeError("Unsupported error handling "+errors)
if not input:
@@ -195,17 +197,17 @@ def decode(self, input, errors='strict'):
if ace_prefix not in input:
# Fast path
try:
- return input.decode('ascii'), len(input)
+ return input.decode("ascii"), len(input)
except UnicodeDecodeError:
pass
labels = input.split(b".")
if labels and len(labels[-1]) == 0:
- trailing_dot = '.'
+ trailing_dot = "."
del labels[-1]
else:
- trailing_dot = ''
+ trailing_dot = ""
result = []
for label in labels:
@@ -215,31 +217,31 @@ def decode(self, input, errors='strict'):
class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
def _buffer_encode(self, input, errors, final):
- if errors != 'strict':
+ if errors != "strict":
# IDNA is quite clear that implementations must be strict
raise UnicodeError("unsupported error handling "+errors)
if not input:
- return (b'', 0)
+ return (b"", 0)
labels = dots.split(input)
- trailing_dot = b''
+ trailing_dot = b""
if labels:
if not labels[-1]:
- trailing_dot = b'.'
+ trailing_dot = b"."
del labels[-1]
elif not final:
# Keep potentially unfinished label until the next call
del labels[-1]
if labels:
- trailing_dot = b'.'
+ trailing_dot = b"."
result = bytearray()
size = 0
for label in labels:
if size:
# Join with U+002E
- result.extend(b'.')
+ result.extend(b".")
size += 1
result.extend(ToASCII(label))
size += len(label)
@@ -250,7 +252,7 @@ def _buffer_encode(self, input, errors, final):
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
def _buffer_decode(self, input, errors, final):
- if errors != 'strict':
+ if errors != "strict":
raise UnicodeError("Unsupported error handling "+errors)
if not input:
@@ -264,16 +266,16 @@ def _buffer_decode(self, input, errors, final):
input = str(input, "ascii")
labels = input.split(".")
- trailing_dot = ''
+ trailing_dot = ""
if labels:
if not labels[-1]:
- trailing_dot = '.'
+ trailing_dot = "."
del labels[-1]
elif not final:
# Keep potentially unfinished label until the next call
del labels[-1]
if labels:
- trailing_dot = '.'
+ trailing_dot = "."
result = []
size = 0
@@ -297,7 +299,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='idna',
+ name="idna",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_jp.py b/.venv3.10/Lib/encodings/iso2022_jp.py
index ab040606..2c1a0518 100644
--- a/.venv3.10/Lib/encodings/iso2022_jp.py
+++ b/.venv3.10/Lib/encodings/iso2022_jp.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_jp')
+codec = _codecs_iso2022.getcodec("iso2022_jp")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_jp',
+ name="iso2022_jp",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_jp_1.py b/.venv3.10/Lib/encodings/iso2022_jp_1.py
index 997044dc..02759db1 100644
--- a/.venv3.10/Lib/encodings/iso2022_jp_1.py
+++ b/.venv3.10/Lib/encodings/iso2022_jp_1.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_jp_1')
+codec = _codecs_iso2022.getcodec("iso2022_jp_1")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_jp_1',
+ name="iso2022_jp_1",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_jp_2.py b/.venv3.10/Lib/encodings/iso2022_jp_2.py
index 9106bf76..9811c544 100644
--- a/.venv3.10/Lib/encodings/iso2022_jp_2.py
+++ b/.venv3.10/Lib/encodings/iso2022_jp_2.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_jp_2')
+codec = _codecs_iso2022.getcodec("iso2022_jp_2")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_jp_2',
+ name="iso2022_jp_2",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_jp_2004.py b/.venv3.10/Lib/encodings/iso2022_jp_2004.py
index 40198bf0..49b4f333 100644
--- a/.venv3.10/Lib/encodings/iso2022_jp_2004.py
+++ b/.venv3.10/Lib/encodings/iso2022_jp_2004.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_jp_2004')
+codec = _codecs_iso2022.getcodec("iso2022_jp_2004")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_jp_2004',
+ name="iso2022_jp_2004",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_jp_3.py b/.venv3.10/Lib/encodings/iso2022_jp_3.py
index 346e08be..7dd1d5b4 100644
--- a/.venv3.10/Lib/encodings/iso2022_jp_3.py
+++ b/.venv3.10/Lib/encodings/iso2022_jp_3.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_jp_3')
+codec = _codecs_iso2022.getcodec("iso2022_jp_3")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_jp_3',
+ name="iso2022_jp_3",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_jp_ext.py b/.venv3.10/Lib/encodings/iso2022_jp_ext.py
index 752bab98..cf3d66d8 100644
--- a/.venv3.10/Lib/encodings/iso2022_jp_ext.py
+++ b/.venv3.10/Lib/encodings/iso2022_jp_ext.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
+codec = _codecs_iso2022.getcodec("iso2022_jp_ext")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_jp_ext',
+ name="iso2022_jp_ext",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso2022_kr.py b/.venv3.10/Lib/encodings/iso2022_kr.py
index bf701876..07a6076b 100644
--- a/.venv3.10/Lib/encodings/iso2022_kr.py
+++ b/.venv3.10/Lib/encodings/iso2022_kr.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_iso2022, codecs
+import _codecs_iso2022
+import codecs
import _multibytecodec as mbc
-codec = _codecs_iso2022.getcodec('iso2022_kr')
+codec = _codecs_iso2022.getcodec("iso2022_kr")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='iso2022_kr',
+ name="iso2022_kr",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_1.py b/.venv3.10/Lib/encodings/iso8859_1.py
index 8cfc01fe..2efe94d3 100644
--- a/.venv3.10/Lib/encodings/iso8859_1.py
+++ b/.venv3.10/Lib/encodings/iso8859_1.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-1',
+ name="iso8859-1",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_10.py b/.venv3.10/Lib/encodings/iso8859_10.py
index b4fb0419..581938fa 100644
--- a/.venv3.10/Lib/encodings/iso8859_10.py
+++ b/.venv3.10/Lib/encodings/iso8859_10.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-10',
+ name="iso8859-10",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_11.py b/.venv3.10/Lib/encodings/iso8859_11.py
index c7258ecf..e8b52465 100644
--- a/.venv3.10/Lib/encodings/iso8859_11.py
+++ b/.venv3.10/Lib/encodings/iso8859_11.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-11',
+ name="iso8859-11",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_13.py b/.venv3.10/Lib/encodings/iso8859_13.py
index 6f8eab2b..e661df98 100644
--- a/.venv3.10/Lib/encodings/iso8859_13.py
+++ b/.venv3.10/Lib/encodings/iso8859_13.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-13',
+ name="iso8859-13",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_14.py b/.venv3.10/Lib/encodings/iso8859_14.py
index 7568d4ee..010212ce 100644
--- a/.venv3.10/Lib/encodings/iso8859_14.py
+++ b/.venv3.10/Lib/encodings/iso8859_14.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-14',
+ name="iso8859-14",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_15.py b/.venv3.10/Lib/encodings/iso8859_15.py
index 43bdecd4..68fee39f 100644
--- a/.venv3.10/Lib/encodings/iso8859_15.py
+++ b/.venv3.10/Lib/encodings/iso8859_15.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-15',
+ name="iso8859-15",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_16.py b/.venv3.10/Lib/encodings/iso8859_16.py
index e70c96e3..4ac53b59 100644
--- a/.venv3.10/Lib/encodings/iso8859_16.py
+++ b/.venv3.10/Lib/encodings/iso8859_16.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-16',
+ name="iso8859-16",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_2.py b/.venv3.10/Lib/encodings/iso8859_2.py
index 3698747b..e6df665c 100644
--- a/.venv3.10/Lib/encodings/iso8859_2.py
+++ b/.venv3.10/Lib/encodings/iso8859_2.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-2',
+ name="iso8859-2",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_3.py b/.venv3.10/Lib/encodings/iso8859_3.py
index 96d3063e..11d9c7ec 100644
--- a/.venv3.10/Lib/encodings/iso8859_3.py
+++ b/.venv3.10/Lib/encodings/iso8859_3.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-3',
+ name="iso8859-3",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_4.py b/.venv3.10/Lib/encodings/iso8859_4.py
index 65c1e00f..2418840c 100644
--- a/.venv3.10/Lib/encodings/iso8859_4.py
+++ b/.venv3.10/Lib/encodings/iso8859_4.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-4',
+ name="iso8859-4",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_5.py b/.venv3.10/Lib/encodings/iso8859_5.py
index a3c868a5..00103460 100644
--- a/.venv3.10/Lib/encodings/iso8859_5.py
+++ b/.venv3.10/Lib/encodings/iso8859_5.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-5',
+ name="iso8859-5",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_6.py b/.venv3.10/Lib/encodings/iso8859_6.py
index b02ade6e..52373cac 100644
--- a/.venv3.10/Lib/encodings/iso8859_6.py
+++ b/.venv3.10/Lib/encodings/iso8859_6.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-6',
+ name="iso8859-6",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_7.py b/.venv3.10/Lib/encodings/iso8859_7.py
index d7b39cbc..ecdc0949 100644
--- a/.venv3.10/Lib/encodings/iso8859_7.py
+++ b/.venv3.10/Lib/encodings/iso8859_7.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-7',
+ name="iso8859-7",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_8.py b/.venv3.10/Lib/encodings/iso8859_8.py
index 81849027..28792dd7 100644
--- a/.venv3.10/Lib/encodings/iso8859_8.py
+++ b/.venv3.10/Lib/encodings/iso8859_8.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-8',
+ name="iso8859-8",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/iso8859_9.py b/.venv3.10/Lib/encodings/iso8859_9.py
index e539fdda..0859b87e 100644
--- a/.venv3.10/Lib/encodings/iso8859_9.py
+++ b/.venv3.10/Lib/encodings/iso8859_9.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-9',
+ name="iso8859-9",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/johab.py b/.venv3.10/Lib/encodings/johab.py
index 512aeeb7..e7f2b9b4 100644
--- a/.venv3.10/Lib/encodings/johab.py
+++ b/.venv3.10/Lib/encodings/johab.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_kr, codecs
+import _codecs_kr
+import codecs
import _multibytecodec as mbc
-codec = _codecs_kr.getcodec('johab')
+codec = _codecs_kr.getcodec("johab")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='johab',
+ name="johab",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/koi8_r.py b/.venv3.10/Lib/encodings/koi8_r.py
index 41ddde85..abb06d1f 100644
--- a/.venv3.10/Lib/encodings/koi8_r.py
+++ b/.venv3.10/Lib/encodings/koi8_r.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='koi8-r',
+ name="koi8-r",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/koi8_t.py b/.venv3.10/Lib/encodings/koi8_t.py
index b5415ba3..5c98ee0b 100644
--- a/.venv3.10/Lib/encodings/koi8_t.py
+++ b/.venv3.10/Lib/encodings/koi8_t.py
@@ -9,10 +9,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -33,7 +33,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='koi8-t',
+ name="koi8-t",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/koi8_u.py b/.venv3.10/Lib/encodings/koi8_u.py
index f9e3fae5..36b6b8d1 100644
--- a/.venv3.10/Lib/encodings/koi8_u.py
+++ b/.venv3.10/Lib/encodings/koi8_u.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='koi8-u',
+ name="koi8-u",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/kz1048.py b/.venv3.10/Lib/encodings/kz1048.py
index 712aee6e..a087496c 100644
--- a/.venv3.10/Lib/encodings/kz1048.py
+++ b/.venv3.10/Lib/encodings/kz1048.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return codecs.charmap_encode(input, errors, encoding_table)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return codecs.charmap_decode(input, errors, decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec, codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='kz1048',
+ name="kz1048",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/latin_1.py b/.venv3.10/Lib/encodings/latin_1.py
index 370160c0..411b537a 100644
--- a/.venv3.10/Lib/encodings/latin_1.py
+++ b/.venv3.10/Lib/encodings/latin_1.py
@@ -40,7 +40,7 @@ class StreamConverter(StreamWriter,StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='iso8859-1',
+ name="iso8859-1",
encode=Codec.encode,
decode=Codec.decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_arabic.py b/.venv3.10/Lib/encodings/mac_arabic.py
index 72847e85..a2810cbd 100644
--- a/.venv3.10/Lib/encodings/mac_arabic.py
+++ b/.venv3.10/Lib/encodings/mac_arabic.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_map)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-arabic',
+ name="mac-arabic",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_croatian.py b/.venv3.10/Lib/encodings/mac_croatian.py
index 4a92fe61..7c651d71 100644
--- a/.venv3.10/Lib/encodings/mac_croatian.py
+++ b/.venv3.10/Lib/encodings/mac_croatian.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-croatian',
+ name="mac-croatian",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_cyrillic.py b/.venv3.10/Lib/encodings/mac_cyrillic.py
index d20272ac..785597ea 100644
--- a/.venv3.10/Lib/encodings/mac_cyrillic.py
+++ b/.venv3.10/Lib/encodings/mac_cyrillic.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-cyrillic',
+ name="mac-cyrillic",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_farsi.py b/.venv3.10/Lib/encodings/mac_farsi.py
index e357d435..898adc65 100644
--- a/.venv3.10/Lib/encodings/mac_farsi.py
+++ b/.venv3.10/Lib/encodings/mac_farsi.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-farsi',
+ name="mac-farsi",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_greek.py b/.venv3.10/Lib/encodings/mac_greek.py
index d3d0c4f0..59a1b88a 100644
--- a/.venv3.10/Lib/encodings/mac_greek.py
+++ b/.venv3.10/Lib/encodings/mac_greek.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-greek',
+ name="mac-greek",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_iceland.py b/.venv3.10/Lib/encodings/mac_iceland.py
index add10f4e..ffc36c1d 100644
--- a/.venv3.10/Lib/encodings/mac_iceland.py
+++ b/.venv3.10/Lib/encodings/mac_iceland.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-iceland',
+ name="mac-iceland",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_latin2.py b/.venv3.10/Lib/encodings/mac_latin2.py
index da9d4b13..087b6350 100644
--- a/.venv3.10/Lib/encodings/mac_latin2.py
+++ b/.venv3.10/Lib/encodings/mac_latin2.py
@@ -13,10 +13,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -37,7 +37,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-latin2',
+ name="mac-latin2",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_roman.py b/.venv3.10/Lib/encodings/mac_roman.py
index b74b0021..1fcd13c3 100644
--- a/.venv3.10/Lib/encodings/mac_roman.py
+++ b/.venv3.10/Lib/encodings/mac_roman.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-roman',
+ name="mac-roman",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_romanian.py b/.venv3.10/Lib/encodings/mac_romanian.py
index d141b4c5..2314efe6 100644
--- a/.venv3.10/Lib/encodings/mac_romanian.py
+++ b/.venv3.10/Lib/encodings/mac_romanian.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-romanian',
+ name="mac-romanian",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mac_turkish.py b/.venv3.10/Lib/encodings/mac_turkish.py
index 044d4cb5..3c5e4133 100644
--- a/.venv3.10/Lib/encodings/mac_turkish.py
+++ b/.venv3.10/Lib/encodings/mac_turkish.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mac-turkish',
+ name="mac-turkish",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/mbcs.py b/.venv3.10/Lib/encodings/mbcs.py
index baf46cbd..03819a54 100644
--- a/.venv3.10/Lib/encodings/mbcs.py
+++ b/.venv3.10/Lib/encodings/mbcs.py
@@ -17,7 +17,7 @@
encode = mbcs_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return mbcs_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -37,7 +37,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='mbcs',
+ name="mbcs",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/oem.py b/.venv3.10/Lib/encodings/oem.py
index 2c3426ba..e3f4b26a 100644
--- a/.venv3.10/Lib/encodings/oem.py
+++ b/.venv3.10/Lib/encodings/oem.py
@@ -11,7 +11,7 @@
encode = oem_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return oem_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -31,7 +31,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='oem',
+ name="oem",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/palmos.py b/.venv3.10/Lib/encodings/palmos.py
index c506d654..2b82e5f2 100644
--- a/.venv3.10/Lib/encodings/palmos.py
+++ b/.venv3.10/Lib/encodings/palmos.py
@@ -9,10 +9,10 @@
### Codec APIs
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -33,7 +33,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='palmos',
+ name="palmos",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/ptcp154.py b/.venv3.10/Lib/encodings/ptcp154.py
index 656b79d6..1b98aec9 100644
--- a/.venv3.10/Lib/encodings/ptcp154.py
+++ b/.venv3.10/Lib/encodings/ptcp154.py
@@ -13,10 +13,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -37,7 +37,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='ptcp154',
+ name="ptcp154",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/punycode.py b/.venv3.10/Lib/encodings/punycode.py
index 1c572644..65402dfa 100644
--- a/.venv3.10/Lib/encodings/punycode.py
+++ b/.venv3.10/Lib/encodings/punycode.py
@@ -172,7 +172,7 @@ def insertion_sort(base, extended, errors):
if char > 0x10FFFF:
if errors == "strict":
raise UnicodeError("Invalid character U+%x" % char)
- char = ord('?')
+ char = ord("?")
pos = pos % (len(base) + 1)
base = base[:pos] + chr(char) + base[pos:]
bias = adapt(delta, (extpos == 0), len(base))
@@ -197,12 +197,12 @@ def punycode_decode(text, errors):
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
res = punycode_encode(input)
return res, len(input)
- def decode(self, input, errors='strict'):
- if errors not in ('strict', 'replace', 'ignore'):
+ def decode(self, input, errors="strict"):
+ if errors not in ("strict", "replace", "ignore"):
raise UnicodeError("Unsupported error handling "+errors)
res = punycode_decode(input, errors)
return res, len(input)
@@ -213,7 +213,7 @@ def encode(self, input, final=False):
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
- if self.errors not in ('strict', 'replace', 'ignore'):
+ if self.errors not in ("strict", "replace", "ignore"):
raise UnicodeError("Unsupported error handling "+self.errors)
return punycode_decode(input, self.errors)
@@ -227,7 +227,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='punycode',
+ name="punycode",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/quopri_codec.py b/.venv3.10/Lib/encodings/quopri_codec.py
index 496cb765..ef92e01b 100644
--- a/.venv3.10/Lib/encodings/quopri_codec.py
+++ b/.venv3.10/Lib/encodings/quopri_codec.py
@@ -7,24 +7,24 @@
import quopri
from io import BytesIO
-def quopri_encode(input, errors='strict'):
- assert errors == 'strict'
+def quopri_encode(input, errors="strict"):
+ assert errors == "strict"
f = BytesIO(input)
g = BytesIO()
quopri.encode(f, g, quotetabs=True)
return (g.getvalue(), len(input))
-def quopri_decode(input, errors='strict'):
- assert errors == 'strict'
+def quopri_decode(input, errors="strict"):
+ assert errors == "strict"
f = BytesIO(input)
g = BytesIO()
quopri.decode(f, g)
return (g.getvalue(), len(input))
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return quopri_encode(input, errors)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return quopri_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -45,7 +45,7 @@ class StreamReader(Codec, codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='quopri',
+ name="quopri",
encode=quopri_encode,
decode=quopri_decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/raw_unicode_escape.py b/.venv3.10/Lib/encodings/raw_unicode_escape.py
index 46c8e070..6febc2ae 100644
--- a/.venv3.10/Lib/encodings/raw_unicode_escape.py
+++ b/.venv3.10/Lib/encodings/raw_unicode_escape.py
@@ -29,14 +29,14 @@ class StreamWriter(Codec,codecs.StreamWriter):
pass
class StreamReader(Codec,codecs.StreamReader):
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return codecs.raw_unicode_escape_decode(input, errors, False)
### encodings module API
def getregentry():
return codecs.CodecInfo(
- name='raw-unicode-escape',
+ name="raw-unicode-escape",
encode=Codec.encode,
decode=Codec.decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/rot_13.py b/.venv3.10/Lib/encodings/rot_13.py
index 5627bfbc..6160fed4 100644
--- a/.venv3.10/Lib/encodings/rot_13.py
+++ b/.venv3.10/Lib/encodings/rot_13.py
@@ -11,10 +11,10 @@
### Codec APIs
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return (str.translate(input, rot13_map), len(input))
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return (str.translate(input, rot13_map), len(input))
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -35,7 +35,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='rot-13',
+ name="rot-13",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
@@ -106,8 +106,8 @@ def getregentry():
### Filter API
def rot13(infile, outfile):
- outfile.write(codecs.encode(infile.read(), 'rot-13'))
+ outfile.write(codecs.encode(infile.read(), "rot-13"))
-if __name__ == '__main__':
+if __name__ == "__main__":
import sys
rot13(sys.stdin, sys.stdout)
diff --git a/.venv3.10/Lib/encodings/shift_jis.py b/.venv3.10/Lib/encodings/shift_jis.py
index 83381172..a7054962 100644
--- a/.venv3.10/Lib/encodings/shift_jis.py
+++ b/.venv3.10/Lib/encodings/shift_jis.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('shift_jis')
+codec = _codecs_jp.getcodec("shift_jis")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='shift_jis',
+ name="shift_jis",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/shift_jis_2004.py b/.venv3.10/Lib/encodings/shift_jis_2004.py
index 161b1e86..67bef405 100644
--- a/.venv3.10/Lib/encodings/shift_jis_2004.py
+++ b/.venv3.10/Lib/encodings/shift_jis_2004.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('shift_jis_2004')
+codec = _codecs_jp.getcodec("shift_jis_2004")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='shift_jis_2004',
+ name="shift_jis_2004",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/shift_jisx0213.py b/.venv3.10/Lib/encodings/shift_jisx0213.py
index cb653f53..629436da 100644
--- a/.venv3.10/Lib/encodings/shift_jisx0213.py
+++ b/.venv3.10/Lib/encodings/shift_jisx0213.py
@@ -4,10 +4,11 @@
# Written by Hye-Shik Chang
#
-import _codecs_jp, codecs
+import _codecs_jp
+import codecs
import _multibytecodec as mbc
-codec = _codecs_jp.getcodec('shift_jisx0213')
+codec = _codecs_jp.getcodec("shift_jisx0213")
class Codec(codecs.Codec):
encode = codec.encode
@@ -29,7 +30,7 @@ class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
def getregentry():
return codecs.CodecInfo(
- name='shift_jisx0213',
+ name="shift_jisx0213",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/tis_620.py b/.venv3.10/Lib/encodings/tis_620.py
index e2883863..7f846dc8 100644
--- a/.venv3.10/Lib/encodings/tis_620.py
+++ b/.venv3.10/Lib/encodings/tis_620.py
@@ -8,10 +8,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
return codecs.charmap_encode(input,errors,encoding_table)
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='tis-620',
+ name="tis-620",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/undefined.py b/.venv3.10/Lib/encodings/undefined.py
index 46902883..63c8d31a 100644
--- a/.venv3.10/Lib/encodings/undefined.py
+++ b/.venv3.10/Lib/encodings/undefined.py
@@ -15,10 +15,10 @@
class Codec(codecs.Codec):
- def encode(self,input,errors='strict'):
+ def encode(self,input,errors="strict"):
raise UnicodeError("undefined encoding")
- def decode(self,input,errors='strict'):
+ def decode(self,input,errors="strict"):
raise UnicodeError("undefined encoding")
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -39,7 +39,7 @@ class StreamReader(Codec,codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='undefined',
+ name="undefined",
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/unicode_escape.py b/.venv3.10/Lib/encodings/unicode_escape.py
index 9b1ce99b..d5e6e999 100644
--- a/.venv3.10/Lib/encodings/unicode_escape.py
+++ b/.venv3.10/Lib/encodings/unicode_escape.py
@@ -29,14 +29,14 @@ class StreamWriter(Codec,codecs.StreamWriter):
pass
class StreamReader(Codec,codecs.StreamReader):
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return codecs.unicode_escape_decode(input, errors, False)
### encodings module API
def getregentry():
return codecs.CodecInfo(
- name='unicode-escape',
+ name="unicode-escape",
encode=Codec.encode,
decode=Codec.decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_16.py b/.venv3.10/Lib/encodings/utf_16.py
index c6124824..62206f52 100644
--- a/.venv3.10/Lib/encodings/utf_16.py
+++ b/.venv3.10/Lib/encodings/utf_16.py
@@ -6,24 +6,25 @@
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
-import codecs, sys
+import codecs
+import sys
### Codec APIs
encode = codecs.utf_16_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_16_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
codecs.IncrementalEncoder.__init__(self, errors)
self.encoder = None
def encode(self, input, final=False):
if self.encoder is None:
result = codecs.utf_16_encode(input, self.errors)[0]
- if sys.byteorder == 'little':
+ if sys.byteorder == "little":
self.encoder = codecs.utf_16_le_encode
else:
self.encoder = codecs.utf_16_be_encode
@@ -45,13 +46,13 @@ def setstate(self, state):
if state:
self.encoder = None
else:
- if sys.byteorder == 'little':
+ if sys.byteorder == "little":
self.encoder = codecs.utf_16_le_encode
else:
self.encoder = codecs.utf_16_be_encode
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
codecs.BufferedIncrementalDecoder.__init__(self, errors)
self.decoder = None
@@ -102,7 +103,7 @@ def setstate(self, state):
self.decoder = None
class StreamWriter(codecs.StreamWriter):
- def __init__(self, stream, errors='strict'):
+ def __init__(self, stream, errors="strict"):
codecs.StreamWriter.__init__(self, stream, errors)
self.encoder = None
@@ -110,10 +111,10 @@ def reset(self):
codecs.StreamWriter.reset(self)
self.encoder = None
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
if self.encoder is None:
result = codecs.utf_16_encode(input, errors)
- if sys.byteorder == 'little':
+ if sys.byteorder == "little":
self.encoder = codecs.utf_16_le_encode
else:
self.encoder = codecs.utf_16_be_encode
@@ -130,7 +131,7 @@ def reset(self):
except AttributeError:
pass
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
(object, consumed, byteorder) = \
codecs.utf_16_ex_decode(input, errors, 0, False)
if byteorder == -1:
@@ -145,7 +146,7 @@ def decode(self, input, errors='strict'):
def getregentry():
return codecs.CodecInfo(
- name='utf-16',
+ name="utf-16",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_16_be.py b/.venv3.10/Lib/encodings/utf_16_be.py
index 86b458eb..644cd9c2 100644
--- a/.venv3.10/Lib/encodings/utf_16_be.py
+++ b/.venv3.10/Lib/encodings/utf_16_be.py
@@ -12,7 +12,7 @@
encode = codecs.utf_16_be_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_16_be_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='utf-16-be',
+ name="utf-16-be",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_16_le.py b/.venv3.10/Lib/encodings/utf_16_le.py
index ec454142..87399b57 100644
--- a/.venv3.10/Lib/encodings/utf_16_le.py
+++ b/.venv3.10/Lib/encodings/utf_16_le.py
@@ -12,7 +12,7 @@
encode = codecs.utf_16_le_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='utf-16-le',
+ name="utf-16-le",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_32.py b/.venv3.10/Lib/encodings/utf_32.py
index cdf84d14..95a3865c 100644
--- a/.venv3.10/Lib/encodings/utf_32.py
+++ b/.venv3.10/Lib/encodings/utf_32.py
@@ -1,24 +1,25 @@
"""
Python 'utf-32' Codec
"""
-import codecs, sys
+import codecs
+import sys
### Codec APIs
encode = codecs.utf_32_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_32_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
codecs.IncrementalEncoder.__init__(self, errors)
self.encoder = None
def encode(self, input, final=False):
if self.encoder is None:
result = codecs.utf_32_encode(input, self.errors)[0]
- if sys.byteorder == 'little':
+ if sys.byteorder == "little":
self.encoder = codecs.utf_32_le_encode
else:
self.encoder = codecs.utf_32_be_encode
@@ -40,13 +41,13 @@ def setstate(self, state):
if state:
self.encoder = None
else:
- if sys.byteorder == 'little':
+ if sys.byteorder == "little":
self.encoder = codecs.utf_32_le_encode
else:
self.encoder = codecs.utf_32_be_encode
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
codecs.BufferedIncrementalDecoder.__init__(self, errors)
self.decoder = None
@@ -97,7 +98,7 @@ def setstate(self, state):
self.decoder = None
class StreamWriter(codecs.StreamWriter):
- def __init__(self, stream, errors='strict'):
+ def __init__(self, stream, errors="strict"):
self.encoder = None
codecs.StreamWriter.__init__(self, stream, errors)
@@ -105,10 +106,10 @@ def reset(self):
codecs.StreamWriter.reset(self)
self.encoder = None
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
if self.encoder is None:
result = codecs.utf_32_encode(input, errors)
- if sys.byteorder == 'little':
+ if sys.byteorder == "little":
self.encoder = codecs.utf_32_le_encode
else:
self.encoder = codecs.utf_32_be_encode
@@ -125,7 +126,7 @@ def reset(self):
except AttributeError:
pass
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
(object, consumed, byteorder) = \
codecs.utf_32_ex_decode(input, errors, 0, False)
if byteorder == -1:
@@ -140,7 +141,7 @@ def decode(self, input, errors='strict'):
def getregentry():
return codecs.CodecInfo(
- name='utf-32',
+ name="utf-32",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_32_be.py b/.venv3.10/Lib/encodings/utf_32_be.py
index fe272b5f..dc229430 100644
--- a/.venv3.10/Lib/encodings/utf_32_be.py
+++ b/.venv3.10/Lib/encodings/utf_32_be.py
@@ -7,7 +7,7 @@
encode = codecs.utf_32_be_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_32_be_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -27,7 +27,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='utf-32-be',
+ name="utf-32-be",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_32_le.py b/.venv3.10/Lib/encodings/utf_32_le.py
index 9e482109..cb3fc7d5 100644
--- a/.venv3.10/Lib/encodings/utf_32_le.py
+++ b/.venv3.10/Lib/encodings/utf_32_le.py
@@ -7,7 +7,7 @@
encode = codecs.utf_32_le_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_32_le_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -27,7 +27,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='utf-32-le',
+ name="utf-32-le",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_7.py b/.venv3.10/Lib/encodings/utf_7.py
index 8e0567f2..b7d5fefb 100644
--- a/.venv3.10/Lib/encodings/utf_7.py
+++ b/.venv3.10/Lib/encodings/utf_7.py
@@ -8,7 +8,7 @@
encode = codecs.utf_7_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_7_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -28,7 +28,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='utf-7',
+ name="utf-7",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_8.py b/.venv3.10/Lib/encodings/utf_8.py
index 1bf63365..389b1cf9 100644
--- a/.venv3.10/Lib/encodings/utf_8.py
+++ b/.venv3.10/Lib/encodings/utf_8.py
@@ -12,7 +12,7 @@
encode = codecs.utf_8_encode
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
return codecs.utf_8_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -32,7 +32,7 @@ class StreamReader(codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='utf-8',
+ name="utf-8",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/utf_8_sig.py b/.venv3.10/Lib/encodings/utf_8_sig.py
index 1bb47920..8cf4447b 100644
--- a/.venv3.10/Lib/encodings/utf_8_sig.py
+++ b/.venv3.10/Lib/encodings/utf_8_sig.py
@@ -11,11 +11,11 @@
### Codec APIs
-def encode(input, errors='strict'):
+def encode(input, errors="strict"):
return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0],
len(input))
-def decode(input, errors='strict'):
+def decode(input, errors="strict"):
prefix = 0
if input[:3] == codecs.BOM_UTF8:
input = input[3:]
@@ -24,7 +24,7 @@ def decode(input, errors='strict'):
return (output, consumed+prefix)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
codecs.IncrementalEncoder.__init__(self, errors)
self.first = 1
@@ -47,7 +47,7 @@ def setstate(self, state):
self.first = state
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
- def __init__(self, errors='strict'):
+ def __init__(self, errors="strict"):
codecs.BufferedIncrementalDecoder.__init__(self, errors)
self.first = 1
@@ -90,7 +90,7 @@ def reset(self):
except AttributeError:
pass
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
self.encode = codecs.utf_8_encode
return encode(input, errors)
@@ -102,7 +102,7 @@ def reset(self):
except AttributeError:
pass
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
if len(input) < 3:
if codecs.BOM_UTF8.startswith(input):
# not enough data to decide if this is a BOM
@@ -120,7 +120,7 @@ def decode(self, input, errors='strict'):
def getregentry():
return codecs.CodecInfo(
- name='utf-8-sig',
+ name="utf-8-sig",
encode=encode,
decode=decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/uu_codec.py b/.venv3.10/Lib/encodings/uu_codec.py
index 4e58c62f..e102255d 100644
--- a/.venv3.10/Lib/encodings/uu_codec.py
+++ b/.venv3.10/Lib/encodings/uu_codec.py
@@ -13,29 +13,29 @@
### Codec APIs
-def uu_encode(input, errors='strict', filename='', mode=0o666):
- assert errors == 'strict'
+def uu_encode(input, errors="strict", filename="", mode=0o666):
+ assert errors == "strict"
infile = BytesIO(input)
outfile = BytesIO()
read = infile.read
write = outfile.write
# Remove newline chars from filename
- filename = filename.replace('\n','\\n')
- filename = filename.replace('\r','\\r')
+ filename = filename.replace("\n","\\n")
+ filename = filename.replace("\r","\\r")
# Encode
- write(('begin %o %s\n' % (mode & 0o777, filename)).encode('ascii'))
+ write(("begin %o %s\n" % (mode & 0o777, filename)).encode("ascii"))
chunk = read(45)
while chunk:
write(binascii.b2a_uu(chunk))
chunk = read(45)
- write(b' \nend\n')
+ write(b" \nend\n")
return (outfile.getvalue(), len(input))
-def uu_decode(input, errors='strict'):
- assert errors == 'strict'
+def uu_decode(input, errors="strict"):
+ assert errors == "strict"
infile = BytesIO(input)
outfile = BytesIO()
readline = infile.readline
@@ -46,32 +46,32 @@ def uu_decode(input, errors='strict'):
s = readline()
if not s:
raise ValueError('Missing "begin" line in input data')
- if s[:5] == b'begin':
+ if s[:5] == b"begin":
break
# Decode
while True:
s = readline()
- if not s or s == b'end\n':
+ if not s or s == b"end\n":
break
try:
data = binascii.a2b_uu(s)
- except binascii.Error as v:
+ except binascii.Error:
# Workaround for broken uuencoders by /Fredrik Lundh
nbytes = (((s[0]-32) & 63) * 4 + 5) // 3
data = binascii.a2b_uu(s[:nbytes])
#sys.stderr.write("Warning: %s\n" % str(v))
write(data)
if not s:
- raise ValueError('Truncated input data')
+ raise ValueError("Truncated input data")
return (outfile.getvalue(), len(input))
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return uu_encode(input, errors)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return uu_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
@@ -92,7 +92,7 @@ class StreamReader(Codec, codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='uu',
+ name="uu",
encode=uu_encode,
decode=uu_decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/encodings/zlib_codec.py b/.venv3.10/Lib/encodings/zlib_codec.py
index 95908a4b..049d7e09 100644
--- a/.venv3.10/Lib/encodings/zlib_codec.py
+++ b/.venv3.10/Lib/encodings/zlib_codec.py
@@ -10,23 +10,23 @@
### Codec APIs
-def zlib_encode(input, errors='strict'):
- assert errors == 'strict'
+def zlib_encode(input, errors="strict"):
+ assert errors == "strict"
return (zlib.compress(input), len(input))
-def zlib_decode(input, errors='strict'):
- assert errors == 'strict'
+def zlib_decode(input, errors="strict"):
+ assert errors == "strict"
return (zlib.decompress(input), len(input))
class Codec(codecs.Codec):
- def encode(self, input, errors='strict'):
+ def encode(self, input, errors="strict"):
return zlib_encode(input, errors)
- def decode(self, input, errors='strict'):
+ def decode(self, input, errors="strict"):
return zlib_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
+ def __init__(self, errors="strict"):
+ assert errors == "strict"
self.errors = errors
self.compressobj = zlib.compressobj()
@@ -41,8 +41,8 @@ def reset(self):
self.compressobj = zlib.compressobj()
class IncrementalDecoder(codecs.IncrementalDecoder):
- def __init__(self, errors='strict'):
- assert errors == 'strict'
+ def __init__(self, errors="strict"):
+ assert errors == "strict"
self.errors = errors
self.decompressobj = zlib.decompressobj()
@@ -66,7 +66,7 @@ class StreamReader(Codec, codecs.StreamReader):
def getregentry():
return codecs.CodecInfo(
- name='zlib',
+ name="zlib",
encode=zlib_encode,
decode=zlib_decode,
incrementalencoder=IncrementalEncoder,
diff --git a/.venv3.10/Lib/ensurepip/__init__.py b/.venv3.10/Lib/ensurepip/__init__.py
index 94ddda44..b5a2e0bd 100644
--- a/.venv3.10/Lib/ensurepip/__init__.py
+++ b/.venv3.10/Lib/ensurepip/__init__.py
@@ -10,7 +10,7 @@
__all__ = ["version", "bootstrap"]
-_PACKAGE_NAMES = ('setuptools', 'pip')
+_PACKAGE_NAMES = ("setuptools", "pip")
_SETUPTOOLS_VERSION = "79.0.1"
_PIP_VERSION = "23.0.1"
_PROJECTS = [
@@ -20,14 +20,14 @@
# Packages bundled in ensurepip._bundled have wheel_name set.
# Packages from WHEEL_PKG_DIR have wheel_path set.
-_Package = collections.namedtuple('Package',
- ('version', 'wheel_name', 'wheel_path'))
+_Package = collections.namedtuple("Package",
+ ("version", "wheel_name", "wheel_path"))
# Directory of system wheel packages. Some Linux distribution packaging
# policies recommend against bundling dependencies. For example, Fedora
# installs wheel packages in the /usr/share/python-wheels/ directory and don't
# install the ensurepip._bundled package.
-_WHEEL_PKG_DIR = sysconfig.get_config_var('WHEEL_PKG_DIR')
+_WHEEL_PKG_DIR = sysconfig.get_config_var("WHEEL_PKG_DIR")
def _find_packages(path):
@@ -46,14 +46,14 @@ def _find_packages(path):
if not filename.endswith(".whl"):
continue
for name in _PACKAGE_NAMES:
- prefix = name + '-'
+ prefix = name + "-"
if filename.startswith(prefix):
break
else:
continue
# Extract '21.2.4' from 'pip-21.2.4-py3-none-any.whl'
- version = filename.removeprefix(prefix).partition('-')[0]
+ version = filename.removeprefix(prefix).partition("-")[0]
wheel_path = os.path.join(path, filename)
packages[name] = _Package(version, None, wheel_path)
return packages
@@ -93,14 +93,14 @@ def _run_pip(args, additional_paths=None):
cmd = [
sys.executable,
- '-W',
- 'ignore::DeprecationWarning',
- '-c',
+ "-W",
+ "ignore::DeprecationWarning",
+ "-c",
code,
]
if sys.flags.isolated:
# run code in isolated mode if currently running isolated
- cmd.insert(1, '-I')
+ cmd.insert(1, "-I")
return subprocess.run(cmd, check=True).returncode
@@ -108,7 +108,7 @@ def version():
"""
Returns a string specifying the bundled version of pip.
"""
- return _get_packages()['pip'].version
+ return _get_packages()["pip"].version
def _disable_pip_configuration_settings():
@@ -120,7 +120,7 @@ def _disable_pip_configuration_settings():
del os.environ[k]
# We also ignore the settings in the default pip configuration file
# See http://bugs.python.org/issue20053 for details
- os.environ['PIP_CONFIG_FILE'] = os.devnull
+ os.environ["PIP_CONFIG_FILE"] = os.devnull
def bootstrap(*, root=None, upgrade=False, user=False,
diff --git a/.venv3.10/Lib/enum.py b/.venv3.10/Lib/enum.py
index f5657a6e..3fb1291f 100644
--- a/.venv3.10/Lib/enum.py
+++ b/.venv3.10/Lib/enum.py
@@ -3,9 +3,9 @@
__all__ = [
- 'EnumMeta',
- 'Enum', 'IntEnum', 'Flag', 'IntFlag',
- 'auto', 'unique',
+ "EnumMeta",
+ "Enum", "IntEnum", "Flag", "IntFlag",
+ "auto", "unique",
]
@@ -14,9 +14,9 @@ def _is_descriptor(obj):
Returns True if obj is a descriptor, False otherwise.
"""
return (
- hasattr(obj, '__get__') or
- hasattr(obj, '__set__') or
- hasattr(obj, '__delete__')
+ hasattr(obj, "__get__") or
+ hasattr(obj, "__set__") or
+ hasattr(obj, "__delete__")
)
def _is_dunder(name):
@@ -25,9 +25,9 @@ def _is_dunder(name):
"""
return (
len(name) > 4 and
- name[:2] == name[-2:] == '__' and
- name[2] != '_' and
- name[-3] != '_'
+ name[:2] == name[-2:] == "__" and
+ name[2] != "_" and
+ name[-3] != "_"
)
def _is_sunder(name):
@@ -36,20 +36,20 @@ def _is_sunder(name):
"""
return (
len(name) > 2 and
- name[0] == name[-1] == '_' and
- name[1:2] != '_' and
- name[-2:-1] != '_'
+ name[0] == name[-1] == "_" and
+ name[1:2] != "_" and
+ name[-2:-1] != "_"
)
def _is_private(cls_name, name):
# do not use `re` as `re` imports `enum`
- pattern = '_%s__' % (cls_name, )
+ pattern = "_%s__" % (cls_name, )
pat_len = len(pattern)
if (
len(name) > pat_len
and name.startswith(pattern)
- and name[pat_len:pat_len+1] != ['_']
- and (name[-1] != '_' or name[-2] != '_')
+ and name[pat_len:pat_len+1] != ["_"]
+ and (name[-1] != "_" or name[-2] != "_")
):
return True
else:
@@ -60,9 +60,9 @@ def _make_class_unpicklable(cls):
Make the given class un-picklable.
"""
def _break_on_call_reduce(self, proto):
- raise TypeError('%r cannot be pickled' % self)
+ raise TypeError("%r cannot be pickled" % self)
cls.__reduce_ex__ = _break_on_call_reduce
- cls.__module__ = ''
+ cls.__module__ = ""
_auto_null = object()
class auto:
@@ -105,39 +105,39 @@ def __setitem__(self, key, value):
)
if _is_sunder(key):
if key not in (
- '_order_', '_create_pseudo_member_',
- '_generate_next_value_', '_missing_', '_ignore_',
+ "_order_", "_create_pseudo_member_",
+ "_generate_next_value_", "_missing_", "_ignore_",
):
- raise ValueError('_names_ are reserved for future Enum use')
- if key == '_generate_next_value_':
+ raise ValueError("_names_ are reserved for future Enum use")
+ if key == "_generate_next_value_":
# check if members already defined as auto()
if self._auto_called:
raise TypeError("_generate_next_value_ must be defined before members")
- setattr(self, '_generate_next_value', value)
- elif key == '_ignore_':
+ self._generate_next_value = value
+ elif key == "_ignore_":
if isinstance(value, str):
- value = value.replace(',',' ').split()
+ value = value.replace(","," ").split()
else:
value = list(value)
self._ignore = value
already = set(value) & set(self._member_names)
if already:
raise ValueError(
- '_ignore_ cannot specify already set names: %r'
+ "_ignore_ cannot specify already set names: %r"
% (already, )
)
elif _is_dunder(key):
- if key == '__order__':
- key = '_order_'
+ if key == "__order__":
+ key = "_order_"
elif key in self._member_names:
# descriptor overwriting an enum?
- raise TypeError('Attempted to reuse key: %r' % key)
+ raise TypeError("Attempted to reuse key: %r" % key)
elif key in self._ignore:
pass
elif not _is_descriptor(value):
if key in self:
# enum overwriting a descriptor?
- raise TypeError('%r already defined as: %r' % (key, self[key]))
+ raise TypeError("%r already defined as: %r" % (key, self[key]))
if isinstance(value, auto):
if value.value == _auto_null:
value.value = self._generate_next_value(
@@ -172,8 +172,8 @@ def __prepare__(metacls, cls, bases, **kwds):
# inherit previous flags and _generate_next_value_ function
member_type, first_enum = metacls._get_mixins_(cls, bases)
if first_enum is not None:
- enum_dict['_generate_next_value_'] = getattr(
- first_enum, '_generate_next_value_', None,
+ enum_dict["_generate_next_value_"] = getattr(
+ first_enum, "_generate_next_value_", None,
)
return enum_dict
@@ -184,8 +184,8 @@ def __new__(metacls, cls, bases, classdict, **kwds):
# class will fail).
#
# remove any keys listed in _ignore_
- classdict.setdefault('_ignore_', []).append('_ignore_')
- ignore = classdict['_ignore_']
+ classdict.setdefault("_ignore_", []).append("_ignore_")
+ ignore = classdict["_ignore_"]
for key in ignore:
classdict.pop(key, None)
member_type, first_enum = metacls._get_mixins_(cls, bases)
@@ -200,17 +200,17 @@ def __new__(metacls, cls, bases, classdict, **kwds):
del classdict[name]
# adjust the sunders
- _order_ = classdict.pop('_order_', None)
+ _order_ = classdict.pop("_order_", None)
# check for illegal enum names (any others?)
- invalid_names = set(enum_members) & {'mro', ''}
+ invalid_names = set(enum_members) & {"mro", ""}
if invalid_names:
- raise ValueError('Invalid enum member name: {0}'.format(
- ','.join(invalid_names)))
+ raise ValueError("Invalid enum member name: {0}".format(
+ ",".join(invalid_names)))
# create a default docstring if one has not been provided
- if '__doc__' not in classdict:
- classdict['__doc__'] = 'An enumeration.'
+ if "__doc__" not in classdict:
+ classdict["__doc__"] = "An enumeration."
enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
enum_class._member_names_ = [] # names in definition order
@@ -238,12 +238,12 @@ def __new__(metacls, cls, bases, classdict, **kwds):
# sabotage -- it's on them to make sure it works correctly. We use
# __reduce_ex__ instead of any of the others as it is preferred by
# pickle over __reduce__, and it handles all pickle protocols.
- if '__reduce_ex__' not in classdict:
+ if "__reduce_ex__" not in classdict:
if member_type is not object:
- methods = ('__getnewargs_ex__', '__getnewargs__',
- '__reduce_ex__', '__reduce__')
+ methods = ("__getnewargs_ex__", "__getnewargs__",
+ "__reduce_ex__", "__reduce__")
if not any(m in member_type.__dict__ for m in methods):
- if '__new__' in classdict:
+ if "__new__" in classdict:
# too late, sabotage
_make_class_unpicklable(enum_class)
else:
@@ -261,7 +261,7 @@ def __new__(metacls, cls, bases, classdict, **kwds):
# found one, we're good
sabotage = False
break
- elif '__new__' in base.__dict__:
+ elif "__new__" in base.__dict__:
# not good
sabotage = True
break
@@ -283,11 +283,11 @@ def __new__(metacls, cls, bases, classdict, **kwds):
args = (args, ) # wrap it one more time
if not use_args:
enum_member = __new__(enum_class)
- if not hasattr(enum_member, '_value_'):
+ if not hasattr(enum_member, "_value_"):
enum_member._value_ = value
else:
enum_member = __new__(enum_class, *args)
- if not hasattr(enum_member, '_value_'):
+ if not hasattr(enum_member, "_value_"):
if member_type is object:
enum_member._value_ = value
else:
@@ -323,7 +323,7 @@ def __new__(metacls, cls, bases, classdict, **kwds):
# things break (such as pickle)
# however, if the method is defined in the Enum itself, don't replace
# it
- for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
+ for name in ("__repr__", "__str__", "__format__", "__reduce_ex__"):
if name in classdict:
continue
class_method = getattr(enum_class, name)
@@ -344,9 +344,9 @@ def __new__(metacls, cls, bases, classdict, **kwds):
# py3 support for definition order (helps keep py2/py3 code in sync)
if _order_ is not None:
if isinstance(_order_, str):
- _order_ = _order_.replace(',', ' ').split()
+ _order_ = _order_.replace(",", " ").split()
if _order_ != enum_class._member_names_:
- raise TypeError('member order does not match _order_')
+ raise TypeError("member order does not match _order_")
return enum_class
@@ -416,7 +416,7 @@ def __delattr__(cls, attr):
def __dir__(self):
return (
- ['__class__', '__doc__', '__members__', '__module__']
+ ["__class__", "__doc__", "__members__", "__module__"]
+ self._member_names_
)
@@ -475,9 +475,9 @@ def __setattr__(cls, name, value):
several possible ways to get an Enum member from the Enum class,
resulting in an inconsistent Enumeration.
"""
- member_map = cls.__dict__.get('_member_map_', {})
+ member_map = cls.__dict__.get("_member_map_", {})
if name in member_map:
- raise AttributeError('Cannot reassign members.')
+ raise AttributeError("Cannot reassign members.")
super().__setattr__(name, value)
def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, start=1):
@@ -499,7 +499,7 @@ def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, s
# special processing needed for names?
if isinstance(names, str):
- names = names.replace(',', ' ').split()
+ names = names.replace(",", " ").split()
if isinstance(names, (tuple, list)) and names and isinstance(names[0], str):
original_names, names = names, []
last_values = []
@@ -521,7 +521,7 @@ def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, s
# module is ever developed
if module is None:
try:
- module = sys._getframe(2).f_globals['__name__']
+ module = sys._getframe(2).f_globals["__name__"]
except (AttributeError, ValueError, KeyError):
pass
if module is None:
@@ -598,7 +598,7 @@ def _find_data_type(bases):
if base._member_type_ is not object:
data_types.add(base._member_type_)
break
- elif '__new__' in base.__dict__:
+ elif "__new__" in base.__dict__:
if issubclass(base, Enum):
continue
data_types.add(candidate or base)
@@ -606,7 +606,7 @@ def _find_data_type(bases):
else:
candidate = candidate or base
if len(data_types) > 1:
- raise TypeError('%r: too many data types: %r' % (class_name, data_types))
+ raise TypeError("%r: too many data types: %r" % (class_name, data_types))
elif data_types:
return data_types.pop()
else:
@@ -635,7 +635,7 @@ def _find_new_(classdict, member_type, first_enum):
# now find the correct __new__, checking to see of one was defined
# by the user; also check earlier enum classes in case a __new__ was
# saved as __new_member__
- __new__ = classdict.get('__new__', None)
+ __new__ = classdict.get("__new__", None)
# should __new__ be saved as __new_member__ later?
save_new = __new__ is not None
@@ -643,7 +643,7 @@ def _find_new_(classdict, member_type, first_enum):
if __new__ is None:
# check all possibles for __new_member__ before falling back to
# __new__
- for method in ('__new_member__', '__new__'):
+ for method in ("__new_member__", "__new__"):
for possible in (member_type, first_enum):
target = getattr(possible, method, None)
if target not in {
@@ -710,7 +710,7 @@ def __new__(cls, value):
raise ve_exc
elif exc is None:
exc = TypeError(
- 'error in %s._missing_: returned %r instead of None or a valid member'
+ "error in %s._missing_: returned %r instead of None or a valid member"
% (cls.__name__, result)
)
if not isinstance(exc, ValueError):
@@ -757,9 +757,9 @@ def __dir__(self):
m
for cls in self.__class__.mro()
for m in cls.__dict__
- if m[0] != '_' and m not in self._member_map_
- ] + [m for m in self.__dict__ if m[0] != '_']
- return (['__class__', '__doc__', '__module__'] + added_behavior)
+ if m[0] != "_" and m not in self._member_map_
+ ] + [m for m in self.__dict__ if m[0] != "_"]
+ return (["__class__", "__doc__", "__module__"] + added_behavior)
def __format__(self, format_spec):
"""
@@ -832,7 +832,7 @@ def _generate_next_value_(name, start, count, last_values):
high_bit = _high_bit(last_value)
break
except Exception:
- raise TypeError('Invalid Flag value: %r' % last_value) from None
+ raise TypeError("Invalid Flag value: %r" % last_value) from None
return 2 ** (high_bit+1)
@classmethod
@@ -881,25 +881,25 @@ def __contains__(self, other):
def __repr__(self):
cls = self.__class__
if self._name_ is not None:
- return '<%s.%s: %r>' % (cls.__name__, self._name_, self._value_)
+ return "<%s.%s: %r>" % (cls.__name__, self._name_, self._value_)
members, uncovered = _decompose(cls, self._value_)
- return '<%s.%s: %r>' % (
+ return "<%s.%s: %r>" % (
cls.__name__,
- '|'.join([str(m._name_ or m._value_) for m in members]),
+ "|".join([str(m._name_ or m._value_) for m in members]),
self._value_,
)
def __str__(self):
cls = self.__class__
if self._name_ is not None:
- return '%s.%s' % (cls.__name__, self._name_)
+ return "%s.%s" % (cls.__name__, self._name_)
members, uncovered = _decompose(cls, self._value_)
if len(members) == 1 and members[0]._name_ is None:
- return '%s.%r' % (cls.__name__, members[0]._value_)
+ return "%s.%r" % (cls.__name__, members[0]._value_)
else:
- return '%s.%s' % (
+ return "%s.%s" % (
cls.__name__,
- '|'.join([str(m._name_ or m._value_) for m in members]),
+ "|".join([str(m._name_ or m._value_) for m in members]),
)
def __bool__(self):
@@ -1017,9 +1017,9 @@ def unique(enumeration):
if name != member.name:
duplicates.append((name, member.name))
if duplicates:
- alias_details = ', '.join(
+ alias_details = ", ".join(
["%s -> %s" % (alias, name) for (alias, name) in duplicates])
- raise ValueError('duplicate values found in %r: %s' %
+ raise ValueError("duplicate values found in %r: %s" %
(enumeration, alias_details))
return enumeration
diff --git a/.venv3.10/Lib/filecmp.py b/.venv3.10/Lib/filecmp.py
index 70a4b23c..54a48e9f 100644
--- a/.venv3.10/Lib/filecmp.py
+++ b/.venv3.10/Lib/filecmp.py
@@ -15,13 +15,13 @@
from itertools import filterfalse
from types import GenericAlias
-__all__ = ['clear_cache', 'cmp', 'dircmp', 'cmpfiles', 'DEFAULT_IGNORES']
+__all__ = ["clear_cache", "cmp", "dircmp", "cmpfiles", "DEFAULT_IGNORES"]
_cache = {}
BUFSIZE = 8*1024
DEFAULT_IGNORES = [
- 'RCS', 'CVS', 'tags', '.git', '.hg', '.bzr', '_darcs', '__pycache__']
+ "RCS", "CVS", "tags", ".git", ".hg", ".bzr", "_darcs", "__pycache__"]
def clear_cache():
"""Clear the filecmp cache."""
@@ -74,7 +74,7 @@ def _sig(st):
def _do_cmp(f1, f2):
bufsize = BUFSIZE
- with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
+ with open(f1, "rb") as fp1, open(f2, "rb") as fp2:
while True:
b1 = fp1.read(bufsize)
b2 = fp2.read(bufsize)
@@ -205,28 +205,28 @@ def phase4_closure(self): # Recursively call phase4() on subdirectories
def report(self): # Print a report on the differences between a and b
# Output format is purposely lousy
- print('diff', self.left, self.right)
+ print("diff", self.left, self.right)
if self.left_only:
self.left_only.sort()
- print('Only in', self.left, ':', self.left_only)
+ print("Only in", self.left, ":", self.left_only)
if self.right_only:
self.right_only.sort()
- print('Only in', self.right, ':', self.right_only)
+ print("Only in", self.right, ":", self.right_only)
if self.same_files:
self.same_files.sort()
- print('Identical files :', self.same_files)
+ print("Identical files :", self.same_files)
if self.diff_files:
self.diff_files.sort()
- print('Differing files :', self.diff_files)
+ print("Differing files :", self.diff_files)
if self.funny_files:
self.funny_files.sort()
- print('Trouble with common files :', self.funny_files)
+ print("Trouble with common files :", self.funny_files)
if self.common_dirs:
self.common_dirs.sort()
- print('Common subdirectories :', self.common_dirs)
+ print("Common subdirectories :", self.common_dirs)
if self.common_funny:
self.common_funny.sort()
- print('Common funny cases :', self.common_funny)
+ print("Common funny cases :", self.common_funny)
def report_partial_closure(self): # Print reports on self and on subdirs
self.report()
@@ -300,14 +300,14 @@ def _filter(flist, skip):
def demo():
import sys
import getopt
- options, args = getopt.getopt(sys.argv[1:], 'r')
+ options, args = getopt.getopt(sys.argv[1:], "r")
if len(args) != 2:
- raise getopt.GetoptError('need exactly two args', None)
+ raise getopt.GetoptError("need exactly two args", None)
dd = dircmp(args[0], args[1])
- if ('-r', '') in options:
+ if ("-r", "") in options:
dd.report_full_closure()
else:
dd.report()
-if __name__ == '__main__':
+if __name__ == "__main__":
demo()
diff --git a/.venv3.10/Lib/fileinput.py b/.venv3.10/Lib/fileinput.py
index 3bd19906..2bfeee1a 100644
--- a/.venv3.10/Lib/fileinput.py
+++ b/.venv3.10/Lib/fileinput.py
@@ -66,7 +66,8 @@
"""
import io
-import sys, os
+import sys
+import os
from types import GenericAlias
__all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno",
@@ -191,7 +192,7 @@ def __init__(self, files=None, inplace=False, backup="", *,
if files is None:
files = sys.argv[1:]
if not files:
- files = ('-',)
+ files = ("-",)
else:
files = tuple(files)
self._files = files
@@ -217,15 +218,15 @@ def __init__(self, files=None, inplace=False, backup="", *,
EncodingWarning, 2)
# restrict mode argument to reading modes
- if mode not in ('r', 'rU', 'U', 'rb'):
+ if mode not in ("r", "rU", "U", "rb"):
raise ValueError("FileInput opening mode must be one of "
"'r', 'rU', 'U' and 'rb'")
- if 'U' in mode:
+ if "U" in mode:
import warnings
warnings.warn("'U' mode is deprecated",
DeprecationWarning, 2)
self._mode = mode
- self._write_mode = mode.replace('r', 'w') if 'U' not in mode else 'w'
+ self._write_mode = mode.replace("r", "w") if "U" not in mode else "w"
if openhook:
if inplace:
raise ValueError("FileInput cannot use an opening hook in inplace mode")
@@ -320,10 +321,10 @@ def readline(self):
def _readline(self):
if not self._files:
- if 'b' in self._mode:
- return b''
+ if "b" in self._mode:
+ return b""
else:
- return ''
+ return ""
self._filename = self._files[0]
self._files = self._files[1:]
self._startlineno = self.lineno()
@@ -338,10 +339,10 @@ def _readline(self):
else:
encoding = None
- if self._filename == '-':
- self._filename = ''
- if 'b' in self._mode:
- self._file = getattr(sys.stdin, 'buffer', sys.stdin)
+ if self._filename == "-":
+ self._filename = ""
+ if "b" in self._mode:
+ self._file = getattr(sys.stdin, "buffer", sys.stdin)
else:
self._file = sys.stdin
self._isstdin = True
@@ -364,7 +365,7 @@ def _readline(self):
encoding=encoding, errors=self._errors)
else:
mode = os.O_CREAT | os.O_WRONLY | os.O_TRUNC
- if hasattr(os, 'O_BINARY'):
+ if hasattr(os, "O_BINARY"):
mode |= os.O_BINARY
fd = os.open(self._filename, mode, perm)
@@ -422,10 +423,10 @@ def hook_compressed(filename, mode, *, encoding=None, errors=None):
if encoding is None and "b" not in mode: # EncodingWarning is emitted in FileInput() already.
encoding = "locale"
ext = os.path.splitext(filename)[1]
- if ext == '.gz':
+ if ext == ".gz":
import gzip
stream = gzip.open(filename, mode)
- elif ext == '.bz2':
+ elif ext == ".bz2":
import bz2
stream = bz2.BZ2File(filename, mode)
else:
@@ -449,14 +450,14 @@ def _test():
backup = False
opts, args = getopt.getopt(sys.argv[1:], "ib:")
for o, a in opts:
- if o == '-i': inplace = True
- if o == '-b': backup = a
+ if o == "-i": inplace = True
+ if o == "-b": backup = a
for line in input(args, inplace=inplace, backup=backup):
- if line[-1:] == '\n': line = line[:-1]
- if line[-1:] == '\r': line = line[:-1]
+ if line[-1:] == "\n": line = line[:-1]
+ if line[-1:] == "\r": line = line[:-1]
print("%d: %s[%d]%s %s" % (lineno(), filename(), filelineno(),
isfirstline() and "*" or "", line))
print("%d: %s[%d]" % (lineno(), filename(), filelineno()))
-if __name__ == '__main__':
+if __name__ == "__main__":
_test()
diff --git a/.venv3.10/Lib/fnmatch.py b/.venv3.10/Lib/fnmatch.py
index fee59bf7..3735529f 100644
--- a/.venv3.10/Lib/fnmatch.py
+++ b/.venv3.10/Lib/fnmatch.py
@@ -44,9 +44,9 @@ def fnmatch(name, pat):
@functools.lru_cache(maxsize=256, typed=True)
def _compile_pattern(pat):
if isinstance(pat, bytes):
- pat_str = str(pat, 'ISO-8859-1')
+ pat_str = str(pat, "ISO-8859-1")
res_str = translate(pat_str)
- res = bytes(res_str, 'ISO-8859-1')
+ res = bytes(res_str, "ISO-8859-1")
else:
res = translate(pat)
return re.compile(res).match
@@ -90,31 +90,31 @@ def translate(pat):
while i < n:
c = pat[i]
i = i+1
- if c == '*':
+ if c == "*":
# compress consecutive `*` into one
if (not res) or res[-1] is not STAR:
add(STAR)
- elif c == '?':
- add('.')
- elif c == '[':
+ elif c == "?":
+ add(".")
+ elif c == "[":
j = i
- if j < n and pat[j] == '!':
+ if j < n and pat[j] == "!":
j = j+1
- if j < n and pat[j] == ']':
+ if j < n and pat[j] == "]":
j = j+1
- while j < n and pat[j] != ']':
+ while j < n and pat[j] != "]":
j = j+1
if j >= n:
- add('\\[')
+ add("\\[")
else:
stuff = pat[i:j]
- if '-' not in stuff:
- stuff = stuff.replace('\\', r'\\')
+ if "-" not in stuff:
+ stuff = stuff.replace("\\", r"\\")
else:
chunks = []
- k = i+2 if pat[i] == '!' else i+1
+ k = i+2 if pat[i] == "!" else i+1
while True:
- k = pat.find('-', k, j)
+ k = pat.find("-", k, j)
if k < 0:
break
chunks.append(pat[i:k])
@@ -124,7 +124,7 @@ def translate(pat):
if chunk:
chunks.append(chunk)
else:
- chunks[-1] += '-'
+ chunks[-1] += "-"
# Remove empty ranges -- invalid in RE.
for k in range(len(chunks)-1, 0, -1):
if chunks[k-1][-1] > chunks[k][0]:
@@ -132,23 +132,23 @@ def translate(pat):
del chunks[k]
# Escape backslashes and hyphens for set difference (--).
# Hyphens that create ranges shouldn't be escaped.
- stuff = '-'.join(s.replace('\\', r'\\').replace('-', r'\-')
+ stuff = "-".join(s.replace("\\", r"\\").replace("-", r"\-")
for s in chunks)
# Escape set operations (&&, ~~ and ||).
- stuff = re.sub(r'([&~|])', r'\\\1', stuff)
+ stuff = re.sub(r"([&~|])", r"\\\1", stuff)
i = j+1
if not stuff:
# Empty range: never match.
- add('(?!)')
- elif stuff == '!':
+ add("(?!)")
+ elif stuff == "!":
# Negated empty range: match any character.
- add('.')
+ add(".")
else:
- if stuff[0] == '!':
- stuff = '^' + stuff[1:]
- elif stuff[0] in ('^', '['):
- stuff = '\\' + stuff
- add(f'[{stuff}]')
+ if stuff[0] == "!":
+ stuff = "^" + stuff[1:]
+ elif stuff[0] in ("^", "["):
+ stuff = "\\" + stuff
+ add(f"[{stuff}]")
else:
add(re.escape(c))
assert i == n
@@ -196,4 +196,4 @@ def translate(pat):
add(f"(?=(?P.*?{fixed}))(?P=g{groupnum})")
assert i == n
res = "".join(res)
- return fr'(?s:{res})\Z'
+ return fr"(?s:{res})\Z"
diff --git a/.venv3.10/Lib/fractions.py b/.venv3.10/Lib/fractions.py
index 96047beb..e0a59116 100644
--- a/.venv3.10/Lib/fractions.py
+++ b/.venv3.10/Lib/fractions.py
@@ -10,7 +10,7 @@
import re
import sys
-__all__ = ['Fraction']
+__all__ = ["Fraction"]
# Constants related to the hash implementation; hash(x) is based
@@ -56,7 +56,7 @@ class Fraction(numbers.Rational):
"""
- __slots__ = ('_numerator', '_denominator')
+ __slots__ = ("_numerator", "_denominator")
# We're immutable, so use __new__ not __init__
def __new__(cls, numerator=0, denominator=None, *, _normalize=True):
@@ -112,27 +112,27 @@ def __new__(cls, numerator=0, denominator=None, *, _normalize=True):
# Handle construction from strings.
m = _RATIONAL_FORMAT.match(numerator)
if m is None:
- raise ValueError('Invalid literal for Fraction: %r' %
+ raise ValueError("Invalid literal for Fraction: %r" %
numerator)
- numerator = int(m.group('num') or '0')
- denom = m.group('denom')
+ numerator = int(m.group("num") or "0")
+ denom = m.group("denom")
if denom:
denominator = int(denom)
else:
denominator = 1
- decimal = m.group('decimal')
+ decimal = m.group("decimal")
if decimal:
scale = 10**len(decimal)
numerator = numerator * scale + int(decimal)
denominator *= scale
- exp = m.group('exp')
+ exp = m.group("exp")
if exp:
exp = int(exp)
if exp >= 0:
numerator *= 10**exp
else:
denominator *= 10**-exp
- if m.group('sign') == '-':
+ if m.group("sign") == "-":
numerator = -numerator
else:
@@ -153,7 +153,7 @@ def __new__(cls, numerator=0, denominator=None, *, _normalize=True):
"Rational instances")
if denominator == 0:
- raise ZeroDivisionError('Fraction(%s, 0)' % numerator)
+ raise ZeroDivisionError("Fraction(%s, 0)" % numerator)
if _normalize:
g = math.gcd(numerator, denominator)
if denominator < 0:
@@ -263,7 +263,7 @@ def denominator(a):
def __repr__(self):
"""repr(self)"""
- return '%s(%s, %s)' % (self.__class__.__name__,
+ return "%s(%s, %s)" % (self.__class__.__name__,
self._numerator, self._denominator)
def __str__(self):
@@ -271,7 +271,7 @@ def __str__(self):
if self._denominator == 1:
return str(self._numerator)
else:
- return '%s/%s' % (self._numerator, self._denominator)
+ return "%s/%s" % (self._numerator, self._denominator)
def _operator_fallbacks(monomorphic_operator, fallback_operator):
"""Generates forward and reverse operators given a purely-rational
@@ -362,7 +362,7 @@ def forward(a, b):
return fallback_operator(complex(a), b)
else:
return NotImplemented
- forward.__name__ = '__' + fallback_operator.__name__ + '__'
+ forward.__name__ = "__" + fallback_operator.__name__ + "__"
forward.__doc__ = monomorphic_operator.__doc__
def reverse(b, a):
@@ -375,7 +375,7 @@ def reverse(b, a):
return fallback_operator(complex(a), complex(b))
else:
return NotImplemented
- reverse.__name__ = '__r' + fallback_operator.__name__ + '__'
+ reverse.__name__ = "__r" + fallback_operator.__name__ + "__"
reverse.__doc__ = monomorphic_operator.__doc__
return forward, reverse
diff --git a/.venv3.10/Lib/ftplib.py b/.venv3.10/Lib/ftplib.py
index 7c5a5071..e11518ab 100644
--- a/.venv3.10/Lib/ftplib.py
+++ b/.venv3.10/Lib/ftplib.py
@@ -67,12 +67,12 @@ class error_proto(Error): pass # response does not begin with [1-5]
# Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)
-CRLF = '\r\n'
-B_CRLF = b'\r\n'
+CRLF = "\r\n"
+B_CRLF = b"\r\n"
# The class itself
class FTP:
- '''An FTP client class.
+ """An FTP client class.
To create a connection, call the class using these arguments:
host, user, passwd, acct, timeout, source_address, encoding
@@ -93,10 +93,10 @@ class FTP:
below for details).
The download/upload functions first issue appropriate TYPE
and PORT or PASV commands.
- '''
+ """
debugging = 0
- host = ''
+ host = ""
port = FTP_PORT
maxline = MAXLINE
sock = None
@@ -106,9 +106,9 @@ class FTP:
# Disables https://bugs.python.org/issue43285 security if set to True.
trust_server_pasv_ipv4_address = False
- def __init__(self, host='', user='', passwd='', acct='',
+ def __init__(self, host="", user="", passwd="", acct="",
timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *,
- encoding='utf-8'):
+ encoding="utf-8"):
"""Initialization method (called by class instantiation).
Initialize host to localhost, port to standard ftp port.
Optional arguments are host (for connect()),
@@ -136,74 +136,74 @@ def __exit__(self, *args):
if self.sock is not None:
self.close()
- def connect(self, host='', port=0, timeout=-999, source_address=None):
- '''Connect to host. Arguments are:
+ def connect(self, host="", port=0, timeout=-999, source_address=None):
+ """Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)
- source_address: a 2-tuple (host, port) for the socket to bind
to as its source address before connecting.
- '''
- if host != '':
+ """
+ if host != "":
self.host = host
if port > 0:
self.port = port
if timeout != -999:
self.timeout = timeout
if self.timeout is not None and not self.timeout:
- raise ValueError('Non-blocking socket (timeout=0) is not supported')
+ raise ValueError("Non-blocking socket (timeout=0) is not supported")
if source_address is not None:
self.source_address = source_address
sys.audit("ftplib.connect", self, self.host, self.port)
self.sock = socket.create_connection((self.host, self.port), self.timeout,
source_address=self.source_address)
self.af = self.sock.family
- self.file = self.sock.makefile('r', encoding=self.encoding)
+ self.file = self.sock.makefile("r", encoding=self.encoding)
self.welcome = self.getresp()
return self.welcome
def getwelcome(self):
- '''Get the welcome message from the server.
- (this is read and squirreled away by connect())'''
+ """Get the welcome message from the server.
+ (this is read and squirreled away by connect())"""
if self.debugging:
- print('*welcome*', self.sanitize(self.welcome))
+ print("*welcome*", self.sanitize(self.welcome))
return self.welcome
def set_debuglevel(self, level):
- '''Set the debugging level.
+ """Set the debugging level.
The required argument level means:
0: no debugging output (default)
1: print commands and responses but not body text etc.
- 2: also print raw lines read and sent before stripping CR/LF'''
+ 2: also print raw lines read and sent before stripping CR/LF"""
self.debugging = level
debug = set_debuglevel
def set_pasv(self, val):
- '''Use passive or active mode for data transfers.
+ """Use passive or active mode for data transfers.
With a false argument, use the normal PORT mode,
- With a true argument, use the PASV command.'''
+ With a true argument, use the PASV command."""
self.passiveserver = val
# Internal: "sanitize" a string for printing
def sanitize(self, s):
- if s[:5] in {'pass ', 'PASS '}:
- i = len(s.rstrip('\r\n'))
- s = s[:5] + '*'*(i-5) + s[i:]
+ if s[:5] in {"pass ", "PASS "}:
+ i = len(s.rstrip("\r\n"))
+ s = s[:5] + "*"*(i-5) + s[i:]
return repr(s)
# Internal: send one line to the server, appending CRLF
def putline(self, line):
- if '\r' in line or '\n' in line:
- raise ValueError('an illegal newline character should not be contained')
+ if "\r" in line or "\n" in line:
+ raise ValueError("an illegal newline character should not be contained")
sys.audit("ftplib.sendcmd", self, line)
line = line + CRLF
if self.debugging > 1:
- print('*put*', self.sanitize(line))
+ print("*put*", self.sanitize(line))
self.sock.sendall(line.encode(self.encoding))
# Internal: send one command to the server (through putline())
def putcmd(self, line):
- if self.debugging: print('*cmd*', self.sanitize(line))
+ if self.debugging: print("*cmd*", self.sanitize(line))
self.putline(line)
# Internal: return one line from the server, stripping CRLF.
@@ -213,7 +213,7 @@ def getline(self):
if len(line) > self.maxline:
raise Error("got more than %d bytes" % self.maxline)
if self.debugging > 1:
- print('*get*', self.sanitize(line))
+ print("*get*", self.sanitize(line))
if not line:
raise EOFError
if line[-2:] == CRLF:
@@ -228,13 +228,13 @@ def getline(self):
# these are separated by '\n' characters in the string
def getmultiline(self):
line = self.getline()
- if line[3:4] == '-':
+ if line[3:4] == "-":
code = line[:3]
while 1:
nextline = self.getline()
- line = line + ('\n' + nextline)
+ line = line + ("\n" + nextline)
if nextline[:3] == code and \
- nextline[3:4] != '-':
+ nextline[3:4] != "-":
break
return line
@@ -243,40 +243,40 @@ def getmultiline(self):
def getresp(self):
resp = self.getmultiline()
if self.debugging:
- print('*resp*', self.sanitize(resp))
+ print("*resp*", self.sanitize(resp))
self.lastresp = resp[:3]
c = resp[:1]
- if c in {'1', '2', '3'}:
+ if c in {"1", "2", "3"}:
return resp
- if c == '4':
+ if c == "4":
raise error_temp(resp)
- if c == '5':
+ if c == "5":
raise error_perm(resp)
raise error_proto(resp)
def voidresp(self):
"""Expect a response beginning with '2'."""
resp = self.getresp()
- if resp[:1] != '2':
+ if resp[:1] != "2":
raise error_reply(resp)
return resp
def abort(self):
- '''Abort a file transfer. Uses out-of-band data.
+ """Abort a file transfer. Uses out-of-band data.
This does not follow the procedure from the RFC to send Telnet
IP and Synch; that doesn't seem to work with the servers I've
- tried. Instead, just send the ABOR command as OOB data.'''
- line = b'ABOR' + B_CRLF
+ tried. Instead, just send the ABOR command as OOB data."""
+ line = b"ABOR" + B_CRLF
if self.debugging > 1:
- print('*put urgent*', self.sanitize(line))
+ print("*put urgent*", self.sanitize(line))
self.sock.sendall(line, MSG_OOB)
resp = self.getmultiline()
- if resp[:3] not in {'426', '225', '226'}:
+ if resp[:3] not in {"426", "225", "226"}:
raise error_proto(resp)
return resp
def sendcmd(self, cmd):
- '''Send a command and return the response.'''
+ """Send a command and return the response."""
self.putcmd(cmd)
return self.getresp()
@@ -286,30 +286,30 @@ def voidcmd(self, cmd):
return self.voidresp()
def sendport(self, host, port):
- '''Send a PORT command with the current host and the given
+ """Send a PORT command with the current host and the given
port number.
- '''
- hbytes = host.split('.')
+ """
+ hbytes = host.split(".")
pbytes = [repr(port//256), repr(port%256)]
bytes = hbytes + pbytes
- cmd = 'PORT ' + ','.join(bytes)
+ cmd = "PORT " + ",".join(bytes)
return self.voidcmd(cmd)
def sendeprt(self, host, port):
- '''Send an EPRT command with the current host and the given port number.'''
+ """Send an EPRT command with the current host and the given port number."""
af = 0
if self.af == socket.AF_INET:
af = 1
if self.af == socket.AF_INET6:
af = 2
if af == 0:
- raise error_proto('unsupported address family')
- fields = ['', repr(af), host, repr(port), '']
- cmd = 'EPRT ' + '|'.join(fields)
+ raise error_proto("unsupported address family")
+ fields = ["", repr(af), host, repr(port), ""]
+ cmd = "EPRT " + "|".join(fields)
return self.voidcmd(cmd)
def makeport(self):
- '''Create a new socket and send a PORT command for it.'''
+ """Create a new socket and send a PORT command for it."""
sock = socket.create_server(("", 0), family=self.af, backlog=1)
port = sock.getsockname()[1] # Get proper port
host = self.sock.getsockname()[0] # Get proper host
@@ -324,13 +324,13 @@ def makeport(self):
def makepasv(self):
"""Internal: Does the PASV or EPSV handshake -> (address, port)"""
if self.af == socket.AF_INET:
- untrusted_host, port = parse227(self.sendcmd('PASV'))
+ untrusted_host, port = parse227(self.sendcmd("PASV"))
if self.trust_server_pasv_ipv4_address:
host = untrusted_host
else:
host = self.sock.getpeername()[0]
else:
- host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
+ host, port = parse229(self.sendcmd("EPSV"), self.sock.getpeername())
return host, port
def ntransfercmd(self, cmd, rest=None):
@@ -363,9 +363,9 @@ def ntransfercmd(self, cmd, rest=None):
# be in violation of the protocol (which only allows
# 1xx or error messages for LIST), so we just discard
# this response.
- if resp[0] == '2':
+ if resp[0] == "2":
resp = self.getresp()
- if resp[0] != '1':
+ if resp[0] != "1":
raise error_reply(resp)
except:
conn.close()
@@ -376,14 +376,14 @@ def ntransfercmd(self, cmd, rest=None):
self.sendcmd("REST %s" % rest)
resp = self.sendcmd(cmd)
# See above.
- if resp[0] == '2':
+ if resp[0] == "2":
resp = self.getresp()
- if resp[0] != '1':
+ if resp[0] != "1":
raise error_reply(resp)
conn, sockaddr = sock.accept()
if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
conn.settimeout(self.timeout)
- if resp[:3] == '150':
+ if resp[:3] == "150":
# this is conditional in case we received a 125
size = parse150(resp)
return conn, size
@@ -392,15 +392,15 @@ def transfercmd(self, cmd, rest=None):
"""Like ntransfercmd() but returns only the socket."""
return self.ntransfercmd(cmd, rest)[0]
- def login(self, user = '', passwd = '', acct = ''):
- '''Login, default anonymous.'''
+ def login(self, user = "", passwd = "", acct = ""):
+ """Login, default anonymous."""
if not user:
- user = 'anonymous'
+ user = "anonymous"
if not passwd:
- passwd = ''
+ passwd = ""
if not acct:
- acct = ''
- if user == 'anonymous' and passwd in {'', '-'}:
+ acct = ""
+ if user == "anonymous" and passwd in {"", "-"}:
# If there is no anonymous ftp password specified
# then we'll just use anonymous@
# We don't send any other thing because:
@@ -408,13 +408,13 @@ def login(self, user = '', passwd = '', acct = ''):
# - We want to stop SPAM
# - We don't want to let ftp sites to discriminate by the user,
# host or country.
- passwd = passwd + 'anonymous@'
- resp = self.sendcmd('USER ' + user)
- if resp[0] == '3':
- resp = self.sendcmd('PASS ' + passwd)
- if resp[0] == '3':
- resp = self.sendcmd('ACCT ' + acct)
- if resp[0] != '2':
+ passwd = passwd + "anonymous@"
+ resp = self.sendcmd("USER " + user)
+ if resp[0] == "3":
+ resp = self.sendcmd("PASS " + passwd)
+ if resp[0] == "3":
+ resp = self.sendcmd("ACCT " + acct)
+ if resp[0] != "2":
raise error_reply(resp)
return resp
@@ -432,7 +432,7 @@ def retrbinary(self, cmd, callback, blocksize=8192, rest=None):
Returns:
The response code.
"""
- self.voidcmd('TYPE I')
+ self.voidcmd("TYPE I")
with self.transfercmd(cmd, rest) as conn:
while 1:
data = conn.recv(blocksize)
@@ -458,20 +458,20 @@ def retrlines(self, cmd, callback = None):
"""
if callback is None:
callback = print_line
- resp = self.sendcmd('TYPE A')
+ resp = self.sendcmd("TYPE A")
with self.transfercmd(cmd) as conn, \
- conn.makefile('r', encoding=self.encoding) as fp:
+ conn.makefile("r", encoding=self.encoding) as fp:
while 1:
line = fp.readline(self.maxline + 1)
if len(line) > self.maxline:
raise Error("got more than %d bytes" % self.maxline)
if self.debugging > 2:
- print('*retr*', repr(line))
+ print("*retr*", repr(line))
if not line:
break
if line[-2:] == CRLF:
line = line[:-2]
- elif line[-1:] == '\n':
+ elif line[-1:] == "\n":
line = line[:-1]
callback(line)
# shutdown ssl layer
@@ -494,7 +494,7 @@ def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
Returns:
The response code.
"""
- self.voidcmd('TYPE I')
+ self.voidcmd("TYPE I")
with self.transfercmd(cmd, rest) as conn:
while 1:
buf = fp.read(blocksize)
@@ -520,7 +520,7 @@ def storlines(self, cmd, fp, callback=None):
Returns:
The response code.
"""
- self.voidcmd('TYPE A')
+ self.voidcmd("TYPE A")
with self.transfercmd(cmd) as conn:
while 1:
buf = fp.readline(self.maxline + 1)
@@ -540,32 +540,32 @@ def storlines(self, cmd, fp, callback=None):
return self.voidresp()
def acct(self, password):
- '''Send new account name.'''
- cmd = 'ACCT ' + password
+ """Send new account name."""
+ cmd = "ACCT " + password
return self.voidcmd(cmd)
def nlst(self, *args):
- '''Return a list of files in a given directory (default the current).'''
- cmd = 'NLST'
+ """Return a list of files in a given directory (default the current)."""
+ cmd = "NLST"
for arg in args:
- cmd = cmd + (' ' + arg)
+ cmd = cmd + (" " + arg)
files = []
self.retrlines(cmd, files.append)
return files
def dir(self, *args):
- '''List a directory in long form.
+ """List a directory in long form.
By default list current directory to stdout.
Optional last argument is callback function; all
non-empty arguments before it are concatenated to the
- LIST command. (This *should* only be used for a pathname.)'''
- cmd = 'LIST'
+ LIST command. (This *should* only be used for a pathname.)"""
+ cmd = "LIST"
func = None
- if args[-1:] and type(args[-1]) != type(''):
+ if args[-1:] and type(args[-1]) != type(""):
args, func = args[:-1], args[-1]
for arg in args:
if arg:
- cmd = cmd + (' ' + arg)
+ cmd = cmd + (" " + arg)
self.retrlines(cmd, func)
def mlsd(self, path="", facts=[]):
@@ -589,7 +589,7 @@ def mlsd(self, path="", facts=[]):
lines = []
self.retrlines(cmd, lines.append)
for line in lines:
- facts_found, _, name = line.rstrip(CRLF).partition(' ')
+ facts_found, _, name = line.rstrip(CRLF).partition(" ")
entry = {}
for fact in facts_found[:-1].split(";"):
key, _, value = fact.partition("=")
@@ -597,71 +597,71 @@ def mlsd(self, path="", facts=[]):
yield (name, entry)
def rename(self, fromname, toname):
- '''Rename a file.'''
- resp = self.sendcmd('RNFR ' + fromname)
- if resp[0] != '3':
+ """Rename a file."""
+ resp = self.sendcmd("RNFR " + fromname)
+ if resp[0] != "3":
raise error_reply(resp)
- return self.voidcmd('RNTO ' + toname)
+ return self.voidcmd("RNTO " + toname)
def delete(self, filename):
- '''Delete a file.'''
- resp = self.sendcmd('DELE ' + filename)
- if resp[:3] in {'250', '200'}:
+ """Delete a file."""
+ resp = self.sendcmd("DELE " + filename)
+ if resp[:3] in {"250", "200"}:
return resp
else:
raise error_reply(resp)
def cwd(self, dirname):
- '''Change to a directory.'''
- if dirname == '..':
+ """Change to a directory."""
+ if dirname == "..":
try:
- return self.voidcmd('CDUP')
+ return self.voidcmd("CDUP")
except error_perm as msg:
- if msg.args[0][:3] != '500':
+ if msg.args[0][:3] != "500":
raise
- elif dirname == '':
- dirname = '.' # does nothing, but could return error
- cmd = 'CWD ' + dirname
+ elif dirname == "":
+ dirname = "." # does nothing, but could return error
+ cmd = "CWD " + dirname
return self.voidcmd(cmd)
def size(self, filename):
- '''Retrieve the size of a file.'''
+ """Retrieve the size of a file."""
# The SIZE command is defined in RFC-3659
- resp = self.sendcmd('SIZE ' + filename)
- if resp[:3] == '213':
+ resp = self.sendcmd("SIZE " + filename)
+ if resp[:3] == "213":
s = resp[3:].strip()
return int(s)
def mkd(self, dirname):
- '''Make a directory, return its full pathname.'''
- resp = self.voidcmd('MKD ' + dirname)
+ """Make a directory, return its full pathname."""
+ resp = self.voidcmd("MKD " + dirname)
# fix around non-compliant implementations such as IIS shipped
# with Windows server 2003
- if not resp.startswith('257'):
- return ''
+ if not resp.startswith("257"):
+ return ""
return parse257(resp)
def rmd(self, dirname):
- '''Remove a directory.'''
- return self.voidcmd('RMD ' + dirname)
+ """Remove a directory."""
+ return self.voidcmd("RMD " + dirname)
def pwd(self):
- '''Return current working directory.'''
- resp = self.voidcmd('PWD')
+ """Return current working directory."""
+ resp = self.voidcmd("PWD")
# fix around non-compliant implementations such as IIS shipped
# with Windows server 2003
- if not resp.startswith('257'):
- return ''
+ if not resp.startswith("257"):
+ return ""
return parse257(resp)
def quit(self):
- '''Quit, and close the connection.'''
- resp = self.voidcmd('QUIT')
+ """Quit, and close the connection."""
+ resp = self.voidcmd("QUIT")
self.close()
return resp
def close(self):
- '''Close the connection without assuming anything about it.'''
+ """Close the connection without assuming anything about it."""
try:
file = self.file
self.file = None
@@ -681,7 +681,7 @@ def close(self):
_SSLSocket = ssl.SSLSocket
class FTP_TLS(FTP):
- '''A FTP subclass which adds TLS support to FTP as described
+ """A FTP subclass which adds TLS support to FTP as described
in RFC-4217.
Connect as usual to port 21 implicitly securing the FTP control
@@ -712,13 +712,13 @@ class FTP_TLS(FTP):
>>> ftps.quit()
'221 Goodbye.'
>>>
- '''
+ """
ssl_version = ssl.PROTOCOL_TLS_CLIENT
- def __init__(self, host='', user='', passwd='', acct='',
+ def __init__(self, host="", user="", passwd="", acct="",
keyfile=None, certfile=None, context=None,
timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *,
- encoding='utf-8'):
+ encoding="utf-8"):
if context is not None and keyfile is not None:
raise ValueError("context and keyfile arguments are mutually "
"exclusive")
@@ -740,33 +740,33 @@ def __init__(self, host='', user='', passwd='', acct='',
super().__init__(host, user, passwd, acct,
timeout, source_address, encoding=encoding)
- def login(self, user='', passwd='', acct='', secure=True):
+ def login(self, user="", passwd="", acct="", secure=True):
if secure and not isinstance(self.sock, ssl.SSLSocket):
self.auth()
return super().login(user, passwd, acct)
def auth(self):
- '''Set up secure control connection by using TLS/SSL.'''
+ """Set up secure control connection by using TLS/SSL."""
if isinstance(self.sock, ssl.SSLSocket):
raise ValueError("Already using TLS")
if self.ssl_version >= ssl.PROTOCOL_TLS:
- resp = self.voidcmd('AUTH TLS')
+ resp = self.voidcmd("AUTH TLS")
else:
- resp = self.voidcmd('AUTH SSL')
+ resp = self.voidcmd("AUTH SSL")
self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
- self.file = self.sock.makefile(mode='r', encoding=self.encoding)
+ self.file = self.sock.makefile(mode="r", encoding=self.encoding)
return resp
def ccc(self):
- '''Switch back to a clear-text control connection.'''
+ """Switch back to a clear-text control connection."""
if not isinstance(self.sock, ssl.SSLSocket):
raise ValueError("not using TLS")
- resp = self.voidcmd('CCC')
+ resp = self.voidcmd("CCC")
self.sock = self.sock.unwrap()
return resp
def prot_p(self):
- '''Set up secure data connection.'''
+ """Set up secure data connection."""
# PROT defines whether or not the data channel is to be protected.
# Though RFC-2228 defines four possible protection levels,
# RFC-4217 only recommends two, Clear and Private.
@@ -776,14 +776,14 @@ def prot_p(self):
# PBSZ command MUST still be issued, but must have a parameter of
# '0' to indicate that no buffering is taking place and the data
# connection should not be encapsulated.
- self.voidcmd('PBSZ 0')
- resp = self.voidcmd('PROT P')
+ self.voidcmd("PBSZ 0")
+ resp = self.voidcmd("PROT P")
self._prot_p = True
return resp
def prot_c(self):
- '''Set up clear text data connection.'''
- resp = self.voidcmd('PROT C')
+ """Set up clear text data connection."""
+ resp = self.voidcmd("PROT C")
self._prot_p = False
return resp
@@ -798,25 +798,25 @@ def ntransfercmd(self, cmd, rest=None):
def abort(self):
# overridden as we can't pass MSG_OOB flag to sendall()
- line = b'ABOR' + B_CRLF
+ line = b"ABOR" + B_CRLF
self.sock.sendall(line)
resp = self.getmultiline()
- if resp[:3] not in {'426', '225', '226'}:
+ if resp[:3] not in {"426", "225", "226"}:
raise error_proto(resp)
return resp
- __all__.append('FTP_TLS')
+ __all__.append("FTP_TLS")
all_errors = (Error, OSError, EOFError, ssl.SSLError)
_150_re = None
def parse150(resp):
- '''Parse the '150' response for a RETR request.
+ """Parse the '150' response for a RETR request.
Returns the expected transfer size or None; size is not guaranteed to
be present in the 150 message.
- '''
- if resp[:3] != '150':
+ """
+ if resp[:3] != "150":
raise error_reply(resp)
global _150_re
if _150_re is None:
@@ -832,33 +832,33 @@ def parse150(resp):
_227_re = None
def parse227(resp):
- '''Parse the '227' response for a PASV request.
+ """Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
- Return ('host.addr.as.numbers', port#) tuple.'''
- if resp[:3] != '227':
+ Return ('host.addr.as.numbers', port#) tuple."""
+ if resp[:3] != "227":
raise error_reply(resp)
global _227_re
if _227_re is None:
import re
- _227_re = re.compile(r'(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)', re.ASCII)
+ _227_re = re.compile(r"(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)", re.ASCII)
m = _227_re.search(resp)
if not m:
raise error_proto(resp)
numbers = m.groups()
- host = '.'.join(numbers[:4])
+ host = ".".join(numbers[:4])
port = (int(numbers[4]) << 8) + int(numbers[5])
return host, port
def parse229(resp, peer):
- '''Parse the '229' response for an EPSV request.
+ """Parse the '229' response for an EPSV request.
Raises error_proto if it does not contain '(|||port|)'
- Return ('host.addr.as.numbers', port#) tuple.'''
- if resp[:3] != '229':
+ Return ('host.addr.as.numbers', port#) tuple."""
+ if resp[:3] != "229":
raise error_reply(resp)
- left = resp.find('(')
+ left = resp.find("(")
if left < 0: raise error_proto(resp)
- right = resp.find(')', left + 1)
+ right = resp.find(")", left + 1)
if right < 0:
raise error_proto(resp) # should contain '(|||port|)'
if resp[left + 1] != resp[right - 1]:
@@ -872,14 +872,14 @@ def parse229(resp, peer):
def parse257(resp):
- '''Parse the '257' response for a MKD or PWD request.
+ """Parse the '257' response for a MKD or PWD request.
This is a response to a MKD or PWD request: a directory name.
- Returns the directoryname in the 257 reply.'''
- if resp[:3] != '257':
+ Returns the directoryname in the 257 reply."""
+ if resp[:3] != "257":
raise error_reply(resp)
if resp[3:5] != ' "':
- return '' # Not compliant to RFC 959, but UNIX ftpd does this
- dirname = ''
+ return "" # Not compliant to RFC 959, but UNIX ftpd does this
+ dirname = ""
i = 5
n = len(resp)
while i < n:
@@ -894,40 +894,40 @@ def parse257(resp):
def print_line(line):
- '''Default retrlines callback to print a line.'''
+ """Default retrlines callback to print a line."""
print(line)
-def ftpcp(source, sourcename, target, targetname = '', type = 'I'):
- '''Copy file from one FTP-instance to another.'''
+def ftpcp(source, sourcename, target, targetname = "", type = "I"):
+ """Copy file from one FTP-instance to another."""
if not targetname:
targetname = sourcename
- type = 'TYPE ' + type
+ type = "TYPE " + type
source.voidcmd(type)
target.voidcmd(type)
- sourcehost, sourceport = parse227(source.sendcmd('PASV'))
+ sourcehost, sourceport = parse227(source.sendcmd("PASV"))
target.sendport(sourcehost, sourceport)
# RFC 959: the user must "listen" [...] BEFORE sending the
# transfer request.
# So: STOR before RETR, because here the target is a "user".
- treply = target.sendcmd('STOR ' + targetname)
- if treply[:3] not in {'125', '150'}:
+ treply = target.sendcmd("STOR " + targetname)
+ if treply[:3] not in {"125", "150"}:
raise error_proto # RFC 959
- sreply = source.sendcmd('RETR ' + sourcename)
- if sreply[:3] not in {'125', '150'}:
+ sreply = source.sendcmd("RETR " + sourcename)
+ if sreply[:3] not in {"125", "150"}:
raise error_proto # RFC 959
source.voidresp()
target.voidresp()
def test():
- '''Test program.
+ """Test program.
Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
-d dir
-l list
-p password
- '''
+ """
if len(sys.argv) < 2:
print(test.__doc__)
@@ -937,17 +937,17 @@ def test():
debugging = 0
rcfile = None
- while sys.argv[1] == '-d':
+ while sys.argv[1] == "-d":
debugging = debugging+1
del sys.argv[1]
- if sys.argv[1][:2] == '-r':
+ if sys.argv[1][:2] == "-r":
# get name of alternate ~/.netrc file:
rcfile = sys.argv[1][2:]
del sys.argv[1]
host = sys.argv[1]
ftp = FTP(host)
ftp.set_debuglevel(debugging)
- userid = passwd = acct = ''
+ userid = passwd = acct = ""
try:
netrcobj = netrc.netrc(rcfile)
except OSError:
@@ -963,19 +963,19 @@ def test():
"No account -- using anonymous login.")
ftp.login(userid, passwd, acct)
for file in sys.argv[2:]:
- if file[:2] == '-l':
+ if file[:2] == "-l":
ftp.dir(file[2:])
- elif file[:2] == '-d':
- cmd = 'CWD'
- if file[2:]: cmd = cmd + ' ' + file[2:]
+ elif file[:2] == "-d":
+ cmd = "CWD"
+ if file[2:]: cmd = cmd + " " + file[2:]
resp = ftp.sendcmd(cmd)
- elif file == '-p':
+ elif file == "-p":
ftp.set_pasv(not ftp.passiveserver)
else:
- ftp.retrbinary('RETR ' + file, \
+ ftp.retrbinary("RETR " + file, \
sys.stdout.write, 1024)
ftp.quit()
-if __name__ == '__main__':
+if __name__ == "__main__":
test()
diff --git a/.venv3.10/Lib/functools.py b/.venv3.10/Lib/functools.py
index 305ceb45..b8f07bc0 100644
--- a/.venv3.10/Lib/functools.py
+++ b/.venv3.10/Lib/functools.py
@@ -9,10 +9,10 @@
# Copyright (C) 2006-2013 Python Software Foundation.
# See C source code for _functools credits/copyright
-__all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES',
- 'total_ordering', 'cache', 'cmp_to_key', 'lru_cache', 'reduce',
- 'partial', 'partialmethod', 'singledispatch', 'singledispatchmethod',
- 'cached_property']
+__all__ = ["update_wrapper", "wraps", "WRAPPER_ASSIGNMENTS", "WRAPPER_UPDATES",
+ "total_ordering", "cache", "cmp_to_key", "lru_cache", "reduce",
+ "partial", "partialmethod", "singledispatch", "singledispatchmethod",
+ "cached_property"]
from abc import get_cache_token
from collections import namedtuple
@@ -29,9 +29,9 @@
# update_wrapper() and wraps() are tools to help write
# wrapper functions that can handle naive introspection
-WRAPPER_ASSIGNMENTS = ('__module__', '__name__', '__qualname__', '__doc__',
- '__annotations__')
-WRAPPER_UPDATES = ('__dict__',)
+WRAPPER_ASSIGNMENTS = ("__module__", "__name__", "__qualname__", "__doc__",
+ "__annotations__")
+WRAPPER_UPDATES = ("__dict__",)
def update_wrapper(wrapper,
wrapped,
assigned = WRAPPER_ASSIGNMENTS,
@@ -87,102 +87,102 @@ def wraps(wrapped,
# detects a NotImplemented result and then calls a reflected method.
def _gt_from_lt(self, other, NotImplemented=NotImplemented):
- 'Return a > b. Computed by @total_ordering from (not a < b) and (a != b).'
+ "Return a > b. Computed by @total_ordering from (not a < b) and (a != b)."
op_result = type(self).__lt__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result and self != other
def _le_from_lt(self, other, NotImplemented=NotImplemented):
- 'Return a <= b. Computed by @total_ordering from (a < b) or (a == b).'
+ "Return a <= b. Computed by @total_ordering from (a < b) or (a == b)."
op_result = type(self).__lt__(self, other)
if op_result is NotImplemented:
return op_result
return op_result or self == other
def _ge_from_lt(self, other, NotImplemented=NotImplemented):
- 'Return a >= b. Computed by @total_ordering from (not a < b).'
+ "Return a >= b. Computed by @total_ordering from (not a < b)."
op_result = type(self).__lt__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result
def _ge_from_le(self, other, NotImplemented=NotImplemented):
- 'Return a >= b. Computed by @total_ordering from (not a <= b) or (a == b).'
+ "Return a >= b. Computed by @total_ordering from (not a <= b) or (a == b)."
op_result = type(self).__le__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result or self == other
def _lt_from_le(self, other, NotImplemented=NotImplemented):
- 'Return a < b. Computed by @total_ordering from (a <= b) and (a != b).'
+ "Return a < b. Computed by @total_ordering from (a <= b) and (a != b)."
op_result = type(self).__le__(self, other)
if op_result is NotImplemented:
return op_result
return op_result and self != other
def _gt_from_le(self, other, NotImplemented=NotImplemented):
- 'Return a > b. Computed by @total_ordering from (not a <= b).'
+ "Return a > b. Computed by @total_ordering from (not a <= b)."
op_result = type(self).__le__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result
def _lt_from_gt(self, other, NotImplemented=NotImplemented):
- 'Return a < b. Computed by @total_ordering from (not a > b) and (a != b).'
+ "Return a < b. Computed by @total_ordering from (not a > b) and (a != b)."
op_result = type(self).__gt__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result and self != other
def _ge_from_gt(self, other, NotImplemented=NotImplemented):
- 'Return a >= b. Computed by @total_ordering from (a > b) or (a == b).'
+ "Return a >= b. Computed by @total_ordering from (a > b) or (a == b)."
op_result = type(self).__gt__(self, other)
if op_result is NotImplemented:
return op_result
return op_result or self == other
def _le_from_gt(self, other, NotImplemented=NotImplemented):
- 'Return a <= b. Computed by @total_ordering from (not a > b).'
+ "Return a <= b. Computed by @total_ordering from (not a > b)."
op_result = type(self).__gt__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result
def _le_from_ge(self, other, NotImplemented=NotImplemented):
- 'Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).'
+ "Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b)."
op_result = type(self).__ge__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result or self == other
def _gt_from_ge(self, other, NotImplemented=NotImplemented):
- 'Return a > b. Computed by @total_ordering from (a >= b) and (a != b).'
+ "Return a > b. Computed by @total_ordering from (a >= b) and (a != b)."
op_result = type(self).__ge__(self, other)
if op_result is NotImplemented:
return op_result
return op_result and self != other
def _lt_from_ge(self, other, NotImplemented=NotImplemented):
- 'Return a < b. Computed by @total_ordering from (not a >= b).'
+ "Return a < b. Computed by @total_ordering from (not a >= b)."
op_result = type(self).__ge__(self, other)
if op_result is NotImplemented:
return op_result
return not op_result
_convert = {
- '__lt__': [('__gt__', _gt_from_lt),
- ('__le__', _le_from_lt),
- ('__ge__', _ge_from_lt)],
- '__le__': [('__ge__', _ge_from_le),
- ('__lt__', _lt_from_le),
- ('__gt__', _gt_from_le)],
- '__gt__': [('__lt__', _lt_from_gt),
- ('__ge__', _ge_from_gt),
- ('__le__', _le_from_gt)],
- '__ge__': [('__le__', _le_from_ge),
- ('__gt__', _gt_from_ge),
- ('__lt__', _lt_from_ge)]
+ "__lt__": [("__gt__", _gt_from_lt),
+ ("__le__", _le_from_lt),
+ ("__ge__", _ge_from_lt)],
+ "__le__": [("__ge__", _ge_from_le),
+ ("__lt__", _lt_from_le),
+ ("__gt__", _gt_from_le)],
+ "__gt__": [("__lt__", _lt_from_gt),
+ ("__ge__", _ge_from_gt),
+ ("__le__", _le_from_gt)],
+ "__ge__": [("__le__", _le_from_ge),
+ ("__gt__", _gt_from_ge),
+ ("__lt__", _lt_from_ge)]
}
def total_ordering(cls):
@@ -190,7 +190,7 @@ def total_ordering(cls):
# Find user-defined comparisons (not those inherited from object).
roots = {op for op in _convert if getattr(cls, op, None) is not getattr(object, op, None)}
if not roots:
- raise ValueError('must define at least one ordering operation: < > <= >=')
+ raise ValueError("must define at least one ordering operation: < > <= >=")
root = max(roots) # prefer __lt__ to __le__ to __gt__ to __ge__
for opname, opfunc in _convert[root]:
if opname not in roots:
@@ -206,7 +206,7 @@ def total_ordering(cls):
def cmp_to_key(mycmp):
"""Convert a cmp= function into a key= function"""
class K(object):
- __slots__ = ['obj']
+ __slots__ = ["obj"]
def __init__(self, obj):
self.obj = obj
def __lt__(self, other):
@@ -436,7 +436,7 @@ class _HashedSeq(list):
"""
- __slots__ = 'hashvalue'
+ __slots__ = "hashvalue"
def __init__(self, tup, hash=hash):
self[:] = tup
@@ -509,15 +509,15 @@ def lru_cache(maxsize=128, typed=False):
# The user_function was passed in directly via the maxsize argument
user_function, maxsize = maxsize, 128
wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
- wrapper.cache_parameters = lambda : {'maxsize': maxsize, 'typed': typed}
+ wrapper.cache_parameters = lambda : {"maxsize": maxsize, "typed": typed}
return update_wrapper(wrapper, user_function)
elif maxsize is not None:
raise TypeError(
- 'Expected first argument to be an integer, a callable, or None')
+ "Expected first argument to be an integer, a callable, or None")
def decorating_function(user_function):
wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
- wrapper.cache_parameters = lambda : {'maxsize': maxsize, 'typed': typed}
+ wrapper.cache_parameters = lambda : {"maxsize": maxsize, "typed": typed}
return update_wrapper(wrapper, user_function)
return decorating_function
@@ -702,7 +702,7 @@ def _c3_mro(cls, abcs=None):
"""
for i, base in enumerate(reversed(cls.__bases__)):
- if hasattr(base, '__abstractmethods__'):
+ if hasattr(base, "__abstractmethods__"):
boundary = len(cls.__bases__) - i
break # Bases up to the last explicit ABC are considered first.
else:
@@ -739,7 +739,7 @@ def _compose_mro(cls, types):
bases = set(cls.__mro__)
# Remove entries which are already present in the __mro__ or unrelated.
def is_related(typ):
- return (typ not in bases and hasattr(typ, '__mro__')
+ return (typ not in bases and hasattr(typ, "__mro__")
and not isinstance(typ, GenericAlias)
and issubclass(cls, typ))
types = [n for n in types if is_related(n)]
@@ -809,7 +809,8 @@ def singledispatch(func):
# There are many programs that use functools without singledispatch, so we
# trade-off making singledispatch marginally slower for the benefit of
# making start-up of such applications slightly faster.
- import types, weakref
+ import types
+ import weakref
registry = {}
dispatch_cache = weakref.WeakKeyDictionary()
@@ -857,7 +858,7 @@ def register(cls, func=None):
f"Invalid first argument to `register()`. "
f"{cls!r} is not a class."
)
- ann = getattr(cls, '__annotations__', {})
+ ann = getattr(cls, "__annotations__", {})
if not ann:
raise TypeError(
f"Invalid first argument to `register()`: {cls!r}. "
@@ -876,19 +877,19 @@ def register(cls, func=None):
)
registry[cls] = func
- if cache_token is None and hasattr(cls, '__abstractmethods__'):
+ if cache_token is None and hasattr(cls, "__abstractmethods__"):
cache_token = get_cache_token()
dispatch_cache.clear()
return func
def wrapper(*args, **kw):
if not args:
- raise TypeError(f'{funcname} requires at least '
- '1 positional argument')
+ raise TypeError(f"{funcname} requires at least "
+ "1 positional argument")
return dispatch(args[0].__class__)(*args, **kw)
- funcname = getattr(func, '__name__', 'singledispatch function')
+ funcname = getattr(func, "__name__", "singledispatch function")
registry[object] = func
wrapper.register = register
wrapper.dispatch = dispatch
@@ -932,7 +933,7 @@ def _method(*args, **kwargs):
@property
def __isabstractmethod__(self):
- return getattr(self.func, '__isabstractmethod__', False)
+ return getattr(self.func, "__isabstractmethod__", False)
################################################################################
diff --git a/.venv3.10/Lib/genericpath.py b/.venv3.10/Lib/genericpath.py
index ad8d47b4..bac45fb9 100644
--- a/.venv3.10/Lib/genericpath.py
+++ b/.venv3.10/Lib/genericpath.py
@@ -6,9 +6,9 @@
import os
import stat
-__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
- 'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfile',
- 'samestat', 'ALLOW_MISSING']
+__all__ = ["commonprefix", "exists", "getatime", "getctime", "getmtime",
+ "getsize", "isdir", "isfile", "samefile", "sameopenfile",
+ "samestat", "ALLOW_MISSING"]
# Does a path exist?
@@ -68,7 +68,7 @@ def getctime(filename):
# Return the longest prefix of all list elements.
def commonprefix(m):
"Given a list of pathnames, returns the longest common leading component"
- if not m: return ''
+ if not m: return ""
# Some people pass in a list of pathname parts to operate in an OS-agnostic
# fashion; don't try to translate in that case as that's an abuse of the
# API and they are already doing what they need to be OS-agnostic and so
@@ -149,8 +149,8 @@ def _check_arg_types(funcname, *args):
elif isinstance(s, bytes):
hasbytes = True
else:
- raise TypeError(f'{funcname}() argument must be str, bytes, or '
- f'os.PathLike object, not {s.__class__.__name__!r}') from None
+ raise TypeError(f"{funcname}() argument must be str, bytes, or "
+ f"os.PathLike object, not {s.__class__.__name__!r}") from None
if hasstr and hasbytes:
raise TypeError("Can't mix strings and bytes in path components") from None
@@ -159,6 +159,6 @@ def _check_arg_types(funcname, *args):
class ALLOW_MISSING:
"""Special value for use in realpath()."""
def __repr__(self):
- return 'os.path.ALLOW_MISSING'
+ return "os.path.ALLOW_MISSING"
def __reduce__(self):
return self.__class__.__name__
diff --git a/.venv3.10/Lib/getopt.py b/.venv3.10/Lib/getopt.py
index 9d4cab1b..87c0f7cd 100644
--- a/.venv3.10/Lib/getopt.py
+++ b/.venv3.10/Lib/getopt.py
@@ -41,9 +41,9 @@
def _(s): return s
class GetoptError(Exception):
- opt = ''
- msg = ''
- def __init__(self, msg, opt=''):
+ opt = ""
+ msg = ""
+ def __init__(self, msg, opt=""):
self.msg = msg
self.opt = opt
Exception.__init__(self, msg, opt)
@@ -85,11 +85,11 @@ def getopt(args, shortopts, longopts = []):
longopts = [longopts]
else:
longopts = list(longopts)
- while args and args[0].startswith('-') and args[0] != '-':
- if args[0] == '--':
+ while args and args[0].startswith("-") and args[0] != "-":
+ if args[0] == "--":
args = args[1:]
break
- if args[0].startswith('--'):
+ if args[0].startswith("--"):
opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
else:
opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
@@ -119,7 +119,7 @@ def gnu_getopt(args, shortopts, longopts = []):
longopts = list(longopts)
# Allow options after non-option arguments?
- if shortopts.startswith('+'):
+ if shortopts.startswith("+"):
shortopts = shortopts[1:]
all_options_first = True
elif os.environ.get("POSIXLY_CORRECT"):
@@ -128,13 +128,13 @@ def gnu_getopt(args, shortopts, longopts = []):
all_options_first = False
while args:
- if args[0] == '--':
+ if args[0] == "--":
prog_args += args[1:]
break
- if args[0][:2] == '--':
+ if args[0][:2] == "--":
opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
- elif args[0][:1] == '-' and args[0] != '-':
+ elif args[0][:1] == "-" and args[0] != "-":
opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
else:
if all_options_first:
@@ -148,7 +148,7 @@ def gnu_getopt(args, shortopts, longopts = []):
def do_longs(opts, opt, longopts, args):
try:
- i = opt.index('=')
+ i = opt.index("=")
except ValueError:
optarg = None
else:
@@ -158,11 +158,11 @@ def do_longs(opts, opt, longopts, args):
if has_arg:
if optarg is None:
if not args:
- raise GetoptError(_('option --%s requires argument') % opt, opt)
+ raise GetoptError(_("option --%s requires argument") % opt, opt)
optarg, args = args[0], args[1:]
elif optarg is not None:
- raise GetoptError(_('option --%s must not have an argument') % opt, opt)
- opts.append(('--' + opt, optarg or ''))
+ raise GetoptError(_("option --%s must not have an argument") % opt, opt)
+ opts.append(("--" + opt, optarg or ""))
return opts, args
# Return:
@@ -171,45 +171,45 @@ def do_longs(opts, opt, longopts, args):
def long_has_args(opt, longopts):
possibilities = [o for o in longopts if o.startswith(opt)]
if not possibilities:
- raise GetoptError(_('option --%s not recognized') % opt, opt)
+ raise GetoptError(_("option --%s not recognized") % opt, opt)
# Is there an exact match?
if opt in possibilities:
return False, opt
- elif opt + '=' in possibilities:
+ elif opt + "=" in possibilities:
return True, opt
# No exact match, so better be unique.
if len(possibilities) > 1:
# XXX since possibilities contains all valid continuations, might be
# nice to work them into the error msg
- raise GetoptError(_('option --%s not a unique prefix') % opt, opt)
+ raise GetoptError(_("option --%s not a unique prefix") % opt, opt)
assert len(possibilities) == 1
unique_match = possibilities[0]
- has_arg = unique_match.endswith('=')
+ has_arg = unique_match.endswith("=")
if has_arg:
unique_match = unique_match[:-1]
return has_arg, unique_match
def do_shorts(opts, optstring, shortopts, args):
- while optstring != '':
+ while optstring != "":
opt, optstring = optstring[0], optstring[1:]
if short_has_arg(opt, shortopts):
- if optstring == '':
+ if optstring == "":
if not args:
- raise GetoptError(_('option -%s requires argument') % opt,
+ raise GetoptError(_("option -%s requires argument") % opt,
opt)
optstring, args = args[0], args[1:]
- optarg, optstring = optstring, ''
+ optarg, optstring = optstring, ""
else:
- optarg = ''
- opts.append(('-' + opt, optarg))
+ optarg = ""
+ opts.append(("-" + opt, optarg))
return opts, args
def short_has_arg(opt, shortopts):
for i in range(len(shortopts)):
- if opt == shortopts[i] != ':':
- return shortopts.startswith(':', i+1)
- raise GetoptError(_('option -%s not recognized') % opt, opt)
+ if opt == shortopts[i] != ":":
+ return shortopts.startswith(":", i+1)
+ raise GetoptError(_("option -%s not recognized") % opt, opt)
-if __name__ == '__main__':
+if __name__ == "__main__":
import sys
print(getopt(sys.argv[1:], "a:b", ["alpha=", "beta"]))
diff --git a/.venv3.10/Lib/getpass.py b/.venv3.10/Lib/getpass.py
index 6970d8ad..3775b5ed 100644
--- a/.venv3.10/Lib/getpass.py
+++ b/.venv3.10/Lib/getpass.py
@@ -26,7 +26,7 @@
class GetPassWarning(UserWarning): pass
-def unix_getpass(prompt='Password: ', stream=None):
+def unix_getpass(prompt="Password: ", stream=None):
"""Prompt for a password, with echo turned off.
Args:
@@ -45,8 +45,8 @@ def unix_getpass(prompt='Password: ', stream=None):
with contextlib.ExitStack() as stack:
try:
# Always try reading and writing directly on the tty first.
- fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY)
- tty = io.FileIO(fd, 'w+')
+ fd = os.open("/dev/tty", os.O_RDWR|os.O_NOCTTY)
+ tty = io.FileIO(fd, "w+")
stack.enter_context(tty)
input = io.TextIOWrapper(tty)
stack.enter_context(input)
@@ -70,7 +70,7 @@ def unix_getpass(prompt='Password: ', stream=None):
new = old[:]
new[3] &= ~termios.ECHO # 3 == 'lflags'
tcsetattr_flags = termios.TCSAFLUSH
- if hasattr(termios, 'TCSASOFT'):
+ if hasattr(termios, "TCSASOFT"):
tcsetattr_flags |= termios.TCSASOFT
try:
termios.tcsetattr(fd, tcsetattr_flags, new)
@@ -90,11 +90,11 @@ def unix_getpass(prompt='Password: ', stream=None):
stack.close()
passwd = fallback_getpass(prompt, stream)
- stream.write('\n')
+ stream.write("\n")
return passwd
-def win_getpass(prompt='Password: ', stream=None):
+def win_getpass(prompt="Password: ", stream=None):
"""Prompt for password with echo off, using Windows getwch()."""
if sys.stdin is not sys.__stdin__:
return fallback_getpass(prompt, stream)
@@ -104,20 +104,20 @@ def win_getpass(prompt='Password: ', stream=None):
pw = ""
while 1:
c = msvcrt.getwch()
- if c == '\r' or c == '\n':
+ if c == "\r" or c == "\n":
break
- if c == '\003':
+ if c == "\003":
raise KeyboardInterrupt
- if c == '\b':
+ if c == "\b":
pw = pw[:-1]
else:
pw = pw + c
- msvcrt.putwch('\r')
- msvcrt.putwch('\n')
+ msvcrt.putwch("\r")
+ msvcrt.putwch("\n")
return pw
-def fallback_getpass(prompt='Password: ', stream=None):
+def fallback_getpass(prompt="Password: ", stream=None):
warnings.warn("Can not control echo on the terminal.", GetPassWarning,
stacklevel=2)
if not stream:
@@ -138,7 +138,7 @@ def _raw_input(prompt="", stream=None, input=None):
stream.write(prompt)
except UnicodeEncodeError:
# Use replace error handler to get as much as possible printed.
- prompt = prompt.encode(stream.encoding, 'replace')
+ prompt = prompt.encode(stream.encoding, "replace")
prompt = prompt.decode(stream.encoding)
stream.write(prompt)
stream.flush()
@@ -146,7 +146,7 @@ def _raw_input(prompt="", stream=None, input=None):
line = input.readline()
if not line:
raise EOFError
- if line[-1] == '\n':
+ if line[-1] == "\n":
line = line[:-1]
return line
@@ -159,7 +159,7 @@ def getuser():
"""
- for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
+ for name in ("LOGNAME", "USER", "LNAME", "USERNAME"):
user = os.environ.get(name)
if user:
return user
diff --git a/.venv3.10/Lib/gettext.py b/.venv3.10/Lib/gettext.py
index 77b67aef..e2607bf4 100644
--- a/.venv3.10/Lib/gettext.py
+++ b/.venv3.10/Lib/gettext.py
@@ -51,15 +51,15 @@
import sys
-__all__ = ['NullTranslations', 'GNUTranslations', 'Catalog',
- 'find', 'translation', 'install', 'textdomain', 'bindtextdomain',
- 'bind_textdomain_codeset',
- 'dgettext', 'dngettext', 'gettext', 'lgettext', 'ldgettext',
- 'ldngettext', 'lngettext', 'ngettext',
- 'pgettext', 'dpgettext', 'npgettext', 'dnpgettext',
+__all__ = ["NullTranslations", "GNUTranslations", "Catalog",
+ "find", "translation", "install", "textdomain", "bindtextdomain",
+ "bind_textdomain_codeset",
+ "dgettext", "dngettext", "gettext", "lgettext", "ldgettext",
+ "ldngettext", "lngettext", "ngettext",
+ "pgettext", "dpgettext", "npgettext", "dnpgettext",
]
-_default_localedir = os.path.join(sys.base_prefix, 'share', 'locale')
+_default_localedir = os.path.join(sys.base_prefix, "share", "locale")
# Expression parsing for plural form selection.
#
@@ -86,51 +86,51 @@
def _tokenize(plural):
for mo in re.finditer(_token_pattern, plural):
kind = mo.lastgroup
- if kind == 'WHITESPACES':
+ if kind == "WHITESPACES":
continue
value = mo.group(kind)
- if kind == 'INVALID':
- raise ValueError('invalid token in plural form: %s' % value)
+ if kind == "INVALID":
+ raise ValueError("invalid token in plural form: %s" % value)
yield value
- yield ''
+ yield ""
def _error(value):
if value:
- return ValueError('unexpected token in plural form: %s' % value)
+ return ValueError("unexpected token in plural form: %s" % value)
else:
- return ValueError('unexpected end of plural form')
+ return ValueError("unexpected end of plural form")
_binary_ops = (
- ('||',),
- ('&&',),
- ('==', '!='),
- ('<', '>', '<=', '>='),
- ('+', '-'),
- ('*', '/', '%'),
+ ("||",),
+ ("&&",),
+ ("==", "!="),
+ ("<", ">", "<=", ">="),
+ ("+", "-"),
+ ("*", "/", "%"),
)
_binary_ops = {op: i for i, ops in enumerate(_binary_ops, 1) for op in ops}
-_c2py_ops = {'||': 'or', '&&': 'and', '/': '//'}
+_c2py_ops = {"||": "or", "&&": "and", "/": "//"}
def _parse(tokens, priority=-1):
- result = ''
+ result = ""
nexttok = next(tokens)
- while nexttok == '!':
- result += 'not '
+ while nexttok == "!":
+ result += "not "
nexttok = next(tokens)
- if nexttok == '(':
+ if nexttok == "(":
sub, nexttok = _parse(tokens)
- result = '%s(%s)' % (result, sub)
- if nexttok != ')':
- raise ValueError('unbalanced parenthesis in plural form')
- elif nexttok == 'n':
- result = '%s%s' % (result, nexttok)
+ result = "%s(%s)" % (result, sub)
+ if nexttok != ")":
+ raise ValueError("unbalanced parenthesis in plural form")
+ elif nexttok == "n":
+ result = "%s%s" % (result, nexttok)
else:
try:
value = int(nexttok, 10)
except ValueError:
raise _error(nexttok) from None
- result = '%s%d' % (result, value)
+ result = "%s%d" % (result, value)
nexttok = next(tokens)
j = 100
@@ -140,23 +140,23 @@ def _parse(tokens, priority=-1):
break
# Break chained comparisons
if i in (3, 4) and j in (3, 4): # '==', '!=', '<', '>', '<=', '>='
- result = '(%s)' % result
+ result = "(%s)" % result
# Replace some C operators by their Python equivalents
op = _c2py_ops.get(nexttok, nexttok)
right, nexttok = _parse(tokens, i + 1)
- result = '%s %s %s' % (result, op, right)
+ result = "%s %s %s" % (result, op, right)
j = i
if j == priority == 4: # '<', '>', '<=', '>='
- result = '(%s)' % result
+ result = "(%s)" % result
- if nexttok == '?' and priority <= 0:
+ if nexttok == "?" and priority <= 0:
if_true, nexttok = _parse(tokens, 0)
- if nexttok != ':':
+ if nexttok != ":":
raise _error(nexttok)
if_false, nexttok = _parse(tokens)
- result = '%s if %s else %s' % (if_true, result, if_false)
+ result = "%s if %s else %s" % (if_true, result, if_false)
if priority == 0:
- result = '(%s)' % result
+ result = "(%s)" % result
return result, nexttok
@@ -164,10 +164,10 @@ def _as_int(n):
try:
i = round(n)
except TypeError:
- raise TypeError('Plural value must be an integer, got %s' %
+ raise TypeError("Plural value must be an integer, got %s" %
(n.__class__.__name__,)) from None
import warnings
- warnings.warn('Plural value must be an integer, got %s' %
+ warnings.warn("Plural value must be an integer, got %s" %
(n.__class__.__name__,),
DeprecationWarning, 4)
return n
@@ -178,7 +178,7 @@ def c2py(plural):
"""
if len(plural) > 1000:
- raise ValueError('plural form expression is too long')
+ raise ValueError("plural form expression is too long")
try:
result, nexttok = _parse(_tokenize(plural))
if nexttok:
@@ -186,26 +186,26 @@ def c2py(plural):
depth = 0
for c in result:
- if c == '(':
+ if c == "(":
depth += 1
if depth > 20:
# Python compiler limit is about 90.
# The most complex example has 2.
- raise ValueError('plural form expression is too complex')
- elif c == ')':
+ raise ValueError("plural form expression is too complex")
+ elif c == ")":
depth -= 1
- ns = {'_as_int': _as_int}
- exec('''if True:
+ ns = {"_as_int": _as_int}
+ exec("""if True:
def func(n):
if not isinstance(n, int):
n = _as_int(n)
return int(%s)
- ''' % result, ns)
- return ns['func']
+ """ % result, ns)
+ return ns["func"]
except RecursionError:
# Recursion error can be raised in _parse() or exec().
- raise ValueError('plural form expression is too complex')
+ raise ValueError("plural form expression is too complex")
def _expand_lang(loc):
@@ -216,27 +216,27 @@ def _expand_lang(loc):
COMPONENT_MODIFIER = 1 << 2
# split up the locale into its base components
mask = 0
- pos = loc.find('@')
+ pos = loc.find("@")
if pos >= 0:
modifier = loc[pos:]
loc = loc[:pos]
mask |= COMPONENT_MODIFIER
else:
- modifier = ''
- pos = loc.find('.')
+ modifier = ""
+ pos = loc.find(".")
if pos >= 0:
codeset = loc[pos:]
loc = loc[:pos]
mask |= COMPONENT_CODESET
else:
- codeset = ''
- pos = loc.find('_')
+ codeset = ""
+ pos = loc.find("_")
if pos >= 0:
territory = loc[pos:]
loc = loc[:pos]
mask |= COMPONENT_TERRITORY
else:
- territory = ''
+ territory = ""
language = loc
ret = []
for i in range(mask+1):
@@ -276,12 +276,12 @@ def gettext(self, message):
def lgettext(self, message):
import warnings
- warnings.warn('lgettext() is deprecated, use gettext() instead',
+ warnings.warn("lgettext() is deprecated, use gettext() instead",
DeprecationWarning, 2)
import locale
if self._fallback:
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\blgettext\b.*',
+ warnings.filterwarnings("ignore", r".*\blgettext\b.*",
DeprecationWarning)
return self._fallback.lgettext(message)
if self._output_charset:
@@ -298,12 +298,12 @@ def ngettext(self, msgid1, msgid2, n):
def lngettext(self, msgid1, msgid2, n):
import warnings
- warnings.warn('lngettext() is deprecated, use ngettext() instead',
+ warnings.warn("lngettext() is deprecated, use ngettext() instead",
DeprecationWarning, 2)
import locale
if self._fallback:
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\blngettext\b.*',
+ warnings.filterwarnings("ignore", r".*\blngettext\b.*",
DeprecationWarning)
return self._fallback.lngettext(msgid1, msgid2, n)
if n == 1:
@@ -335,22 +335,22 @@ def charset(self):
def output_charset(self):
import warnings
- warnings.warn('output_charset() is deprecated',
+ warnings.warn("output_charset() is deprecated",
DeprecationWarning, 2)
return self._output_charset
def set_output_charset(self, charset):
import warnings
- warnings.warn('set_output_charset() is deprecated',
+ warnings.warn("set_output_charset() is deprecated",
DeprecationWarning, 2)
self._output_charset = charset
def install(self, names=None):
import builtins
- builtins.__dict__['_'] = self.gettext
+ builtins.__dict__["_"] = self.gettext
if names is not None:
- allowed = {'gettext', 'lgettext', 'lngettext',
- 'ngettext', 'npgettext', 'pgettext'}
+ allowed = {"gettext", "lgettext", "lngettext",
+ "ngettext", "npgettext", "pgettext"}
for name in allowed & set(names):
builtins.__dict__[name] = getattr(self, name)
@@ -376,7 +376,7 @@ def _parse(self, fp):
# Delay struct import for speeding up gettext import when .mo files
# are not used.
from struct import unpack
- filename = getattr(fp, 'name', '')
+ filename = getattr(fp, "name", "")
# Parse the .mo file header, which consists of 5 little endian 32
# bit words.
self._catalog = catalog = {}
@@ -384,20 +384,20 @@ def _parse(self, fp):
buf = fp.read()
buflen = len(buf)
# Are we big endian or little endian?
- magic = unpack('4I', buf[4:20])
- ii = '>II'
+ version, msgcount, masteridx, transidx = unpack(">4I", buf[4:20])
+ ii = ">II"
else:
- raise OSError(0, 'Bad magic number', filename)
+ raise OSError(0, "Bad magic number", filename)
major_version, minor_version = self._get_versions(version)
if major_version not in self.VERSIONS:
- raise OSError(0, 'Bad version number ' + str(major_version), filename)
+ raise OSError(0, "Bad version number " + str(major_version), filename)
# Now put all messages from the .mo file buffer into the catalog
# dictionary.
@@ -410,32 +410,32 @@ def _parse(self, fp):
msg = buf[moff:mend]
tmsg = buf[toff:tend]
else:
- raise OSError(0, 'File is corrupt', filename)
+ raise OSError(0, "File is corrupt", filename)
# See if we're looking at GNU .mo conventions for metadata
if mlen == 0:
# Catalog description
lastk = None
- for b_item in tmsg.split(b'\n'):
+ for b_item in tmsg.split(b"\n"):
item = b_item.decode().strip()
if not item:
continue
# Skip over comment lines:
- if item.startswith('#-#-#-#-#') and item.endswith('#-#-#-#-#'):
+ if item.startswith("#-#-#-#-#") and item.endswith("#-#-#-#-#"):
continue
k = v = None
- if ':' in item:
- k, v = item.split(':', 1)
+ if ":" in item:
+ k, v = item.split(":", 1)
k = k.strip().lower()
v = v.strip()
self._info[k] = v
lastk = k
elif lastk:
- self._info[lastk] += '\n' + item
- if k == 'content-type':
- self._charset = v.split('charset=')[1]
- elif k == 'plural-forms':
- v = v.split(';')
- plural = v[1].split('plural=')[1]
+ self._info[lastk] += "\n" + item
+ if k == "content-type":
+ self._charset = v.split("charset=")[1]
+ elif k == "plural-forms":
+ v = v.split(";")
+ plural = v[1].split("plural=")[1]
self.plural = c2py(plural)
# Note: we unconditionally convert both msgids and msgstrs to
# Unicode using the character encoding specified in the charset
@@ -446,11 +446,11 @@ def _parse(self, fp):
# cause no problems since us-ascii should always be a subset of
# the charset encoding. We may want to fall back to 8-bit msgids
# if the Unicode conversion fails.
- charset = self._charset or 'ascii'
- if b'\x00' in msg:
+ charset = self._charset or "ascii"
+ if b"\x00" in msg:
# Plural forms
- msgid1, msgid2 = msg.split(b'\x00')
- tmsg = tmsg.split(b'\x00')
+ msgid1, msgid2 = msg.split(b"\x00")
+ tmsg = tmsg.split(b"\x00")
msgid1 = str(msgid1, charset)
for i, x in enumerate(tmsg):
catalog[(msgid1, i)] = str(x, charset)
@@ -462,7 +462,7 @@ def _parse(self, fp):
def lgettext(self, message):
import warnings
- warnings.warn('lgettext() is deprecated, use gettext() instead',
+ warnings.warn("lgettext() is deprecated, use gettext() instead",
DeprecationWarning, 2)
import locale
missing = object()
@@ -477,7 +477,7 @@ def lgettext(self, message):
def lngettext(self, msgid1, msgid2, n):
import warnings
- warnings.warn('lngettext() is deprecated, use ngettext() instead',
+ warnings.warn("lngettext() is deprecated, use ngettext() instead",
DeprecationWarning, 2)
import locale
try:
@@ -545,13 +545,13 @@ def find(domain, localedir=None, languages=None, all=False):
localedir = _default_localedir
if languages is None:
languages = []
- for envar in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'):
+ for envar in ("LANGUAGE", "LC_ALL", "LC_MESSAGES", "LANG"):
val = os.environ.get(envar)
if val:
- languages = val.split(':')
+ languages = val.split(":")
break
- if 'C' not in languages:
- languages.append('C')
+ if "C" not in languages:
+ languages.append("C")
# now normalize and expand the languages
nelangs = []
for lang in languages:
@@ -564,9 +564,9 @@ def find(domain, localedir=None, languages=None, all=False):
else:
result = None
for lang in nelangs:
- if lang == 'C':
+ if lang == "C":
break
- mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
+ mofile = os.path.join(localedir, lang, "LC_MESSAGES", "%s.mo" % domain)
if os.path.exists(mofile):
if all:
result.append(mofile)
@@ -578,7 +578,7 @@ def find(domain, localedir=None, languages=None, all=False):
# a mapping between absolute .mo file path and Translation object
_translations = {}
-_unspecified = ['unspecified']
+_unspecified = ["unspecified"]
def translation(domain, localedir=None, languages=None,
class_=None, fallback=False, codeset=_unspecified):
@@ -590,7 +590,7 @@ def translation(domain, localedir=None, languages=None,
return NullTranslations()
from errno import ENOENT
raise FileNotFoundError(ENOENT,
- 'No translation file found for domain', domain)
+ "No translation file found for domain", domain)
# Avoid opening, reading, and parsing the .mo file after it's been done
# once.
result = None
@@ -598,7 +598,7 @@ def translation(domain, localedir=None, languages=None,
key = (class_, os.path.abspath(mofile))
t = _translations.get(key)
if t is None:
- with open(mofile, 'rb') as fp:
+ with open(mofile, "rb") as fp:
t = _translations.setdefault(key, class_(fp))
# Copy the translation object to allow setting fallbacks and
# output charset. All other instance data is shared with the
@@ -609,11 +609,11 @@ def translation(domain, localedir=None, languages=None,
t = copy.copy(t)
if codeset is not _unspecified:
import warnings
- warnings.warn('parameter codeset is deprecated',
+ warnings.warn("parameter codeset is deprecated",
DeprecationWarning, 2)
if codeset:
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\bset_output_charset\b.*',
+ warnings.filterwarnings("ignore", r".*\bset_output_charset\b.*",
DeprecationWarning)
t.set_output_charset(codeset)
if result is None:
@@ -634,7 +634,7 @@ def install(domain, localedir=None, codeset=_unspecified, names=None):
# a mapping b/w domains and codesets
_localecodesets = {}
# current global domain, `messages' used for compatibility w/ GNU gettext
-_current_domain = 'messages'
+_current_domain = "messages"
def textdomain(domain=None):
@@ -653,7 +653,7 @@ def bindtextdomain(domain, localedir=None):
def bind_textdomain_codeset(domain, codeset=None):
import warnings
- warnings.warn('bind_textdomain_codeset() is deprecated',
+ warnings.warn("bind_textdomain_codeset() is deprecated",
DeprecationWarning, 2)
global _localecodesets
if codeset is not None:
@@ -670,19 +670,19 @@ def dgettext(domain, message):
def ldgettext(domain, message):
import warnings
- warnings.warn('ldgettext() is deprecated, use dgettext() instead',
+ warnings.warn("ldgettext() is deprecated, use dgettext() instead",
DeprecationWarning, 2)
import locale
codeset = _localecodesets.get(domain)
try:
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\bparameter codeset\b.*',
+ warnings.filterwarnings("ignore", r".*\bparameter codeset\b.*",
DeprecationWarning)
t = translation(domain, _localedirs.get(domain, None), codeset=codeset)
except OSError:
return message.encode(codeset or locale.getpreferredencoding())
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\blgettext\b.*',
+ warnings.filterwarnings("ignore", r".*\blgettext\b.*",
DeprecationWarning)
return t.lgettext(message)
@@ -698,13 +698,13 @@ def dngettext(domain, msgid1, msgid2, n):
def ldngettext(domain, msgid1, msgid2, n):
import warnings
- warnings.warn('ldngettext() is deprecated, use dngettext() instead',
+ warnings.warn("ldngettext() is deprecated, use dngettext() instead",
DeprecationWarning, 2)
import locale
codeset = _localecodesets.get(domain)
try:
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\bparameter codeset\b.*',
+ warnings.filterwarnings("ignore", r".*\bparameter codeset\b.*",
DeprecationWarning)
t = translation(domain, _localedirs.get(domain, None), codeset=codeset)
except OSError:
@@ -714,7 +714,7 @@ def ldngettext(domain, msgid1, msgid2, n):
tmsg = msgid2
return tmsg.encode(codeset or locale.getpreferredencoding())
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\blngettext\b.*',
+ warnings.filterwarnings("ignore", r".*\blngettext\b.*",
DeprecationWarning)
return t.lngettext(msgid1, msgid2, n)
@@ -743,10 +743,10 @@ def gettext(message):
def lgettext(message):
import warnings
- warnings.warn('lgettext() is deprecated, use gettext() instead',
+ warnings.warn("lgettext() is deprecated, use gettext() instead",
DeprecationWarning, 2)
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\bldgettext\b.*',
+ warnings.filterwarnings("ignore", r".*\bldgettext\b.*",
DeprecationWarning)
return ldgettext(_current_domain, message)
@@ -755,10 +755,10 @@ def ngettext(msgid1, msgid2, n):
def lngettext(msgid1, msgid2, n):
import warnings
- warnings.warn('lngettext() is deprecated, use ngettext() instead',
+ warnings.warn("lngettext() is deprecated, use ngettext() instead",
DeprecationWarning, 2)
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', r'.*\bldngettext\b.*',
+ warnings.filterwarnings("ignore", r".*\bldngettext\b.*",
DeprecationWarning)
return ldngettext(_current_domain, msgid1, msgid2, n)
diff --git a/.venv3.10/Lib/glob.py b/.venv3.10/Lib/glob.py
index 9fc08f45..55f72b86 100644
--- a/.venv3.10/Lib/glob.py
+++ b/.venv3.10/Lib/glob.py
@@ -139,7 +139,7 @@ def _iterdir(dirname, dir_fd, dironly):
elif dirname:
arg = dirname
elif isinstance(dirname, bytes):
- arg = bytes(os.curdir, 'ASCII')
+ arg = bytes(os.curdir, "ASCII")
else:
arg = os.curdir
try:
@@ -202,8 +202,8 @@ def _join(dirname, basename):
return dirname or basename
return os.path.join(dirname, basename)
-magic_check = re.compile('([*?[])')
-magic_check_bytes = re.compile(b'([*?[])')
+magic_check = re.compile("([*?[])")
+magic_check_bytes = re.compile(b"([*?[])")
def has_magic(s):
if isinstance(s, bytes):
@@ -213,13 +213,13 @@ def has_magic(s):
return match is not None
def _ishidden(path):
- return path[0] in ('.', b'.'[0])
+ return path[0] in (".", b"."[0])
def _isrecursive(pattern):
if isinstance(pattern, bytes):
- return pattern == b'**'
+ return pattern == b"**"
else:
- return pattern == '**'
+ return pattern == "**"
def escape(pathname):
"""Escape all special characters.
@@ -228,10 +228,10 @@ def escape(pathname):
# Metacharacters do not work in the drive part and shouldn't be escaped.
drive, pathname = os.path.splitdrive(pathname)
if isinstance(pathname, bytes):
- pathname = magic_check_bytes.sub(br'[\1]', pathname)
+ pathname = magic_check_bytes.sub(br"[\1]", pathname)
else:
- pathname = magic_check.sub(r'[\1]', pathname)
+ pathname = magic_check.sub(r"[\1]", pathname)
return drive + pathname
-_dir_open_flags = os.O_RDONLY | getattr(os, 'O_DIRECTORY', 0)
+_dir_open_flags = os.O_RDONLY | getattr(os, "O_DIRECTORY", 0)
diff --git a/.venv3.10/Lib/graphlib.py b/.venv3.10/Lib/graphlib.py
index 1c5d9a41..2fc0b394 100644
--- a/.venv3.10/Lib/graphlib.py
+++ b/.venv3.10/Lib/graphlib.py
@@ -101,7 +101,7 @@ def prepare(self):
# nodes as possible before cycles block more progress
cycle = self._find_cycle()
if cycle:
- raise CycleError(f"nodes are in a cycle", cycle)
+ raise CycleError("nodes are in a cycle", cycle)
def get_ready(self):
"""Return a tuple of all the nodes that are ready.
diff --git a/.venv3.10/Lib/gzip.py b/.venv3.10/Lib/gzip.py
index 475ec326..8d0af794 100644
--- a/.venv3.10/Lib/gzip.py
+++ b/.venv3.10/Lib/gzip.py
@@ -5,7 +5,10 @@
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
-import struct, sys, time, os
+import struct
+import sys
+import time
+import os
import zlib
import builtins
import io
@@ -77,7 +80,7 @@ class _PaddedFile:
of an actual file. Shouldn't be used outside of gzip.py, as it lacks
essential functionality."""
- def __init__(self, f, prepend=b''):
+ def __init__(self, f, prepend=b""):
self._buffer = prepend
self._length = len(prepend)
self.file = f
@@ -96,7 +99,7 @@ def read(self, size):
return self._buffer[read:] + \
self.file.read(size-self._length+read)
- def prepend(self, prepend=b''):
+ def prepend(self, prepend=b""):
if self._read is None:
self._buffer = prepend
else: # Assume data was read since the last prepend() call
@@ -166,29 +169,29 @@ def __init__(self, filename=None, mode=None,
"""
- if mode and ('t' in mode or 'U' in mode):
+ if mode and ("t" in mode or "U" in mode):
raise ValueError("Invalid mode: {!r}".format(mode))
- if mode and 'b' not in mode:
- mode += 'b'
+ if mode and "b" not in mode:
+ mode += "b"
if fileobj is None:
- fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
+ fileobj = self.myfileobj = builtins.open(filename, mode or "rb")
if filename is None:
- filename = getattr(fileobj, 'name', '')
+ filename = getattr(fileobj, "name", "")
if not isinstance(filename, (str, bytes)):
- filename = ''
+ filename = ""
else:
filename = os.fspath(filename)
origmode = mode
if mode is None:
- mode = getattr(fileobj, 'mode', 'rb')
+ mode = getattr(fileobj, "mode", "rb")
- if mode.startswith('r'):
+ if mode.startswith("r"):
self.mode = READ
raw = _GzipReader(fileobj)
self._buffer = io.BufferedReader(raw)
self.name = filename
- elif mode.startswith(('w', 'a', 'x')):
+ elif mode.startswith(("w", "a", "x")):
if origmode is None:
import warnings
warnings.warn(
@@ -227,7 +230,7 @@ def mtime(self):
def __repr__(self):
s = repr(self.fileobj)
- return ''
+ return ""
def _init_write(self, filename):
self.name = filename
@@ -238,36 +241,36 @@ def _init_write(self, filename):
self.offset = 0 # Current file offset for seek(), tell(), etc
def _write_gzip_header(self, compresslevel):
- self.fileobj.write(b'\037\213') # magic header
- self.fileobj.write(b'\010') # compression method
+ self.fileobj.write(b"\037\213") # magic header
+ self.fileobj.write(b"\010") # compression method
try:
# RFC 1952 requires the FNAME field to be Latin-1. Do not
# include filenames that cannot be represented that way.
fname = os.path.basename(self.name)
if not isinstance(fname, bytes):
- fname = fname.encode('latin-1')
- if fname.endswith(b'.gz'):
+ fname = fname.encode("latin-1")
+ if fname.endswith(b".gz"):
fname = fname[:-3]
except UnicodeEncodeError:
- fname = b''
+ fname = b""
flags = 0
if fname:
flags = FNAME
- self.fileobj.write(chr(flags).encode('latin-1'))
+ self.fileobj.write(chr(flags).encode("latin-1"))
mtime = self._write_mtime
if mtime is None:
mtime = time.time()
write32u(self.fileobj, int(mtime))
if compresslevel == _COMPRESS_LEVEL_BEST:
- xfl = b'\002'
+ xfl = b"\002"
elif compresslevel == _COMPRESS_LEVEL_FAST:
- xfl = b'\004'
+ xfl = b"\004"
else:
- xfl = b'\000'
+ xfl = b"\000"
self.fileobj.write(xfl)
- self.fileobj.write(b'\377')
+ self.fileobj.write(b"\377")
if fname:
- self.fileobj.write(fname + b'\000')
+ self.fileobj.write(fname + b"\000")
def write(self,data):
self._check_not_closed()
@@ -359,8 +362,8 @@ def fileno(self):
return self.fileobj.fileno()
def rewind(self):
- '''Return the uncompressed stream file position indicator to the
- beginning of the file'''
+ """Return the uncompressed stream file position indicator to the
+ beginning of the file"""
if self.mode != READ:
raise OSError("Can't rewind in write mode")
self._buffer.seek(0)
@@ -380,14 +383,14 @@ def seek(self, offset, whence=io.SEEK_SET):
if whence == io.SEEK_CUR:
offset = self.offset + offset
else:
- raise ValueError('Seek from end not supported')
+ raise ValueError("Seek from end not supported")
if offset < self.offset:
- raise OSError('Negative seek in write mode')
+ raise OSError("Negative seek in write mode")
count = offset - self.offset
- chunk = b'\0' * 1024
+ chunk = b"\0" * 1024
for i in range(count // 1024):
self.write(chunk)
- self.write(b'\0' * (count % 1024))
+ self.write(b"\0" * (count % 1024))
elif self.mode == READ:
self._check_not_closed()
return self._buffer.seek(offset, whence)
@@ -412,11 +415,11 @@ def _init_read(self):
self._stream_size = 0 # Decompressed size of unconcatenated stream
def _read_exact(self, n):
- '''Read exactly *n* bytes from `self._fp`
+ """Read exactly *n* bytes from `self._fp`
This method is required because self._fp may be unbuffered,
i.e. return short reads.
- '''
+ """
data = self._fp.read(n)
while len(data) < n:
@@ -429,16 +432,16 @@ def _read_exact(self, n):
def _read_gzip_header(self):
magic = self._fp.read(2)
- if magic == b'':
+ if magic == b"":
return False
- if magic != b'\037\213':
- raise BadGzipFile('Not a gzipped file (%r)' % magic)
+ if magic != b"\037\213":
+ raise BadGzipFile("Not a gzipped file (%r)" % magic)
(method, flag,
self._last_mtime) = struct.unpack(" blocksize:
password = new(hash_name, password).digest()
- password = password + b'\x00' * (blocksize - len(password))
+ password = password + b"\x00" * (blocksize - len(password))
inner.update(password.translate(_trans_36))
outer.update(password.translate(_trans_5C))
@@ -231,19 +231,19 @@ def prf(msg, inner=inner, outer=outer):
if dklen < 1:
raise ValueError(dklen)
- dkey = b''
+ dkey = b""
loop = 1
from_bytes = int.from_bytes
while len(dkey) < dklen:
- prev = prf(salt + loop.to_bytes(4, 'big'))
+ prev = prf(salt + loop.to_bytes(4, "big"))
# endianness doesn't matter here as long to / from use the same
- rkey = int.from_bytes(prev, 'big')
+ rkey = int.from_bytes(prev, "big")
for i in range(iterations - 1):
prev = prf(prev)
# rkey = rkey ^ prev
- rkey ^= from_bytes(prev, 'big')
+ rkey ^= from_bytes(prev, "big")
loop += 1
- dkey += rkey.to_bytes(inner.digest_size, 'big')
+ dkey += rkey.to_bytes(inner.digest_size, "big")
return dkey[:dklen]
@@ -261,7 +261,7 @@ def prf(msg, inner=inner, outer=outer):
globals()[__func_name] = __get_hash(__func_name)
except ValueError:
import logging
- logging.exception('code for hash %s was not found.', __func_name)
+ logging.exception("code for hash %s was not found.", __func_name)
# Cleanup locals()
diff --git a/.venv3.10/Lib/heapq.py b/.venv3.10/Lib/heapq.py
index fabefd87..1f55b71b 100644
--- a/.venv3.10/Lib/heapq.py
+++ b/.venv3.10/Lib/heapq.py
@@ -124,8 +124,8 @@
From all times, sorting has always been a Great Art! :-)
"""
-__all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge',
- 'nlargest', 'nsmallest', 'heappushpop']
+__all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge",
+ "nlargest", "nsmallest", "heappushpop"]
def heappush(heap, item):
"""Push item onto heap, maintaining the heap invariant."""
@@ -276,7 +276,7 @@ def _siftup(heap, pos):
_siftdown(heap, startpos, pos)
def _siftdown_max(heap, startpos, pos):
- 'Maxheap variant of _siftdown'
+ "Maxheap variant of _siftdown"
newitem = heap[pos]
# Follow the path to the root, moving parents down until finding a place
# newitem fits.
@@ -291,7 +291,7 @@ def _siftdown_max(heap, startpos, pos):
heap[pos] = newitem
def _siftup_max(heap, pos):
- 'Maxheap variant of _siftup'
+ "Maxheap variant of _siftup"
endpos = len(heap)
startpos = pos
newitem = heap[pos]
@@ -312,7 +312,7 @@ def _siftup_max(heap, pos):
_siftdown_max(heap, startpos, pos)
def merge(*iterables, key=None, reverse=False):
- '''Merge multiple sorted inputs into a single sorted output.
+ """Merge multiple sorted inputs into a single sorted output.
Similar to sorted(itertools.chain(*iterables)) but returns a generator,
does not pull the data into memory all at once, and assumes that each of
@@ -327,7 +327,7 @@ def merge(*iterables, key=None, reverse=False):
>>> list(merge(['dog', 'horse'], ['cat', 'fish', 'kangaroo'], key=len))
['dog', 'cat', 'fish', 'horse', 'kangaroo']
- '''
+ """
h = []
h_append = h.append
diff --git a/.venv3.10/Lib/hmac.py b/.venv3.10/Lib/hmac.py
index 8b4f920d..72bb4536 100644
--- a/.venv3.10/Lib/hmac.py
+++ b/.venv3.10/Lib/hmac.py
@@ -35,7 +35,7 @@ class HMAC:
"_hmac", "_inner", "_outer", "block_size", "digest_size"
)
- def __init__(self, key, msg=None, digestmod=''):
+ def __init__(self, key, msg=None, digestmod=""):
"""Create a new HMAC object.
key: bytes or buffer, key for the keyed hash object.
@@ -72,25 +72,25 @@ def _init_old(self, key, msg, digestmod):
if callable(digestmod):
digest_cons = digestmod
elif isinstance(digestmod, str):
- digest_cons = lambda d=b'': _hashlib.new(digestmod, d)
+ digest_cons = lambda d=b"": _hashlib.new(digestmod, d)
else:
- digest_cons = lambda d=b'': digestmod.new(d)
+ digest_cons = lambda d=b"": digestmod.new(d)
self._hmac = None
self._outer = digest_cons()
self._inner = digest_cons()
self.digest_size = self._inner.digest_size
- if hasattr(self._inner, 'block_size'):
+ if hasattr(self._inner, "block_size"):
blocksize = self._inner.block_size
if blocksize < 16:
- _warnings.warn('block_size of %d seems too small; using our '
- 'default of %d.' % (blocksize, self.blocksize),
+ _warnings.warn("block_size of %d seems too small; using our "
+ "default of %d." % (blocksize, self.blocksize),
RuntimeWarning, 2)
blocksize = self.blocksize
else:
- _warnings.warn('No block_size attribute on given digest object; '
- 'Assuming %d.' % (self.blocksize),
+ _warnings.warn("No block_size attribute on given digest object; "
+ "Assuming %d." % (self.blocksize),
RuntimeWarning, 2)
blocksize = self.blocksize
@@ -101,7 +101,7 @@ def _init_old(self, key, msg, digestmod):
# effective block size as well as the public API attribute.
self.block_size = blocksize
- key = key.ljust(blocksize, b'\0')
+ key = key.ljust(blocksize, b"\0")
self._outer.update(key.translate(trans_5C))
self._inner.update(key.translate(trans_36))
if msg is not None:
@@ -164,7 +164,7 @@ def hexdigest(self):
h = self._current()
return h.hexdigest()
-def new(key, msg=None, digestmod=''):
+def new(key, msg=None, digestmod=""):
"""Create a new hashing object and return it.
key: bytes or buffer, The starting key for the hash.
@@ -202,16 +202,16 @@ def digest(key, msg, digest):
if callable(digest):
digest_cons = digest
elif isinstance(digest, str):
- digest_cons = lambda d=b'': _hashlib.new(digest, d)
+ digest_cons = lambda d=b"": _hashlib.new(digest, d)
else:
- digest_cons = lambda d=b'': digest.new(d)
+ digest_cons = lambda d=b"": digest.new(d)
inner = digest_cons()
outer = digest_cons()
- blocksize = getattr(inner, 'block_size', 64)
+ blocksize = getattr(inner, "block_size", 64)
if len(key) > blocksize:
key = digest_cons(key).digest()
- key = key + b'\x00' * (blocksize - len(key))
+ key = key + b"\x00" * (blocksize - len(key))
inner.update(key.translate(trans_36))
outer.update(key.translate(trans_5C))
inner.update(msg)
diff --git a/.venv3.10/Lib/html/__init__.py b/.venv3.10/Lib/html/__init__.py
index 1543460c..173a1d65 100644
--- a/.venv3.10/Lib/html/__init__.py
+++ b/.venv3.10/Lib/html/__init__.py
@@ -6,7 +6,7 @@
from html.entities import html5 as _html5
-__all__ = ['escape', 'unescape']
+__all__ = ["escape", "unescape"]
def escape(s, quote=True):
@@ -21,47 +21,47 @@ def escape(s, quote=True):
s = s.replace(">", ">")
if quote:
s = s.replace('"', """)
- s = s.replace('\'', "'")
+ s = s.replace("'", "'")
return s
# see https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
_invalid_charrefs = {
- 0x00: '\ufffd', # REPLACEMENT CHARACTER
- 0x0d: '\r', # CARRIAGE RETURN
- 0x80: '\u20ac', # EURO SIGN
- 0x81: '\x81', #
- 0x82: '\u201a', # SINGLE LOW-9 QUOTATION MARK
- 0x83: '\u0192', # LATIN SMALL LETTER F WITH HOOK
- 0x84: '\u201e', # DOUBLE LOW-9 QUOTATION MARK
- 0x85: '\u2026', # HORIZONTAL ELLIPSIS
- 0x86: '\u2020', # DAGGER
- 0x87: '\u2021', # DOUBLE DAGGER
- 0x88: '\u02c6', # MODIFIER LETTER CIRCUMFLEX ACCENT
- 0x89: '\u2030', # PER MILLE SIGN
- 0x8a: '\u0160', # LATIN CAPITAL LETTER S WITH CARON
- 0x8b: '\u2039', # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- 0x8c: '\u0152', # LATIN CAPITAL LIGATURE OE
- 0x8d: '\x8d', #
- 0x8e: '\u017d', # LATIN CAPITAL LETTER Z WITH CARON
- 0x8f: '\x8f', #
- 0x90: '\x90', #
- 0x91: '\u2018', # LEFT SINGLE QUOTATION MARK
- 0x92: '\u2019', # RIGHT SINGLE QUOTATION MARK
- 0x93: '\u201c', # LEFT DOUBLE QUOTATION MARK
- 0x94: '\u201d', # RIGHT DOUBLE QUOTATION MARK
- 0x95: '\u2022', # BULLET
- 0x96: '\u2013', # EN DASH
- 0x97: '\u2014', # EM DASH
- 0x98: '\u02dc', # SMALL TILDE
- 0x99: '\u2122', # TRADE MARK SIGN
- 0x9a: '\u0161', # LATIN SMALL LETTER S WITH CARON
- 0x9b: '\u203a', # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- 0x9c: '\u0153', # LATIN SMALL LIGATURE OE
- 0x9d: '\x9d', #
- 0x9e: '\u017e', # LATIN SMALL LETTER Z WITH CARON
- 0x9f: '\u0178', # LATIN CAPITAL LETTER Y WITH DIAERESIS
+ 0x00: "\ufffd", # REPLACEMENT CHARACTER
+ 0x0d: "\r", # CARRIAGE RETURN
+ 0x80: "\u20ac", # EURO SIGN
+ 0x81: "\x81", #
+ 0x82: "\u201a", # SINGLE LOW-9 QUOTATION MARK
+ 0x83: "\u0192", # LATIN SMALL LETTER F WITH HOOK
+ 0x84: "\u201e", # DOUBLE LOW-9 QUOTATION MARK
+ 0x85: "\u2026", # HORIZONTAL ELLIPSIS
+ 0x86: "\u2020", # DAGGER
+ 0x87: "\u2021", # DOUBLE DAGGER
+ 0x88: "\u02c6", # MODIFIER LETTER CIRCUMFLEX ACCENT
+ 0x89: "\u2030", # PER MILLE SIGN
+ 0x8a: "\u0160", # LATIN CAPITAL LETTER S WITH CARON
+ 0x8b: "\u2039", # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ 0x8c: "\u0152", # LATIN CAPITAL LIGATURE OE
+ 0x8d: "\x8d", #
+ 0x8e: "\u017d", # LATIN CAPITAL LETTER Z WITH CARON
+ 0x8f: "\x8f", #
+ 0x90: "\x90", #
+ 0x91: "\u2018", # LEFT SINGLE QUOTATION MARK
+ 0x92: "\u2019", # RIGHT SINGLE QUOTATION MARK
+ 0x93: "\u201c", # LEFT DOUBLE QUOTATION MARK
+ 0x94: "\u201d", # RIGHT DOUBLE QUOTATION MARK
+ 0x95: "\u2022", # BULLET
+ 0x96: "\u2013", # EN DASH
+ 0x97: "\u2014", # EM DASH
+ 0x98: "\u02dc", # SMALL TILDE
+ 0x99: "\u2122", # TRADE MARK SIGN
+ 0x9a: "\u0161", # LATIN SMALL LETTER S WITH CARON
+ 0x9b: "\u203a", # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ 0x9c: "\u0153", # LATIN SMALL LIGATURE OE
+ 0x9d: "\x9d", #
+ 0x9e: "\u017e", # LATIN SMALL LETTER Z WITH CARON
+ 0x9f: "\u0178", # LATIN CAPITAL LETTER Y WITH DIAERESIS
}
_invalid_codepoints = {
@@ -90,18 +90,18 @@ def escape(s, quote=True):
def _replace_charref(s):
s = s.group(1)
- if s[0] == '#':
+ if s[0] == "#":
# numeric charref
- if s[1] in 'xX':
- num = int(s[2:].rstrip(';'), 16)
+ if s[1] in "xX":
+ num = int(s[2:].rstrip(";"), 16)
else:
- num = int(s[1:].rstrip(';'))
+ num = int(s[1:].rstrip(";"))
if num in _invalid_charrefs:
return _invalid_charrefs[num]
if 0xD800 <= num <= 0xDFFF or num > 0x10FFFF:
- return '\uFFFD'
+ return "\uFFFD"
if num in _invalid_codepoints:
- return ''
+ return ""
return chr(num)
else:
# named charref
@@ -112,12 +112,12 @@ def _replace_charref(s):
if s[:x] in _html5:
return _html5[s[:x]] + s[x:]
else:
- return '&' + s
+ return "&" + s
-_charref = _re.compile(r'&(#[0-9]+;?'
- r'|#[xX][0-9a-fA-F]+;?'
- r'|[^\t\n\f <]{1,32};?)')
+_charref = _re.compile(r"&(#[0-9]+;?"
+ r"|#[xX][0-9a-fA-F]+;?"
+ r"|[^\t\n\f <]{1,32};?)")
def unescape(s):
"""
@@ -127,6 +127,6 @@ def unescape(s):
for both valid and invalid character references, and the list of
HTML 5 named character references defined in html.entities.html5.
"""
- if '&' not in s:
+ if "&" not in s:
return s
return _charref.sub(_replace_charref, s)
diff --git a/.venv3.10/Lib/html/entities.py b/.venv3.10/Lib/html/entities.py
index dc508631..6031368b 100644
--- a/.venv3.10/Lib/html/entities.py
+++ b/.venv3.10/Lib/html/entities.py
@@ -1,2499 +1,2499 @@
"""HTML character entity references."""
-__all__ = ['html5', 'name2codepoint', 'codepoint2name', 'entitydefs']
+__all__ = ["html5", "name2codepoint", "codepoint2name", "entitydefs"]
# maps the HTML entity name to the Unicode code point
# from https://html.spec.whatwg.org/multipage/named-characters.html
name2codepoint = {
- 'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
- 'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
- 'Acirc': 0x00c2, # latin capital letter A with circumflex, U+00C2 ISOlat1
- 'Agrave': 0x00c0, # latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1
- 'Alpha': 0x0391, # greek capital letter alpha, U+0391
- 'Aring': 0x00c5, # latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
- 'Atilde': 0x00c3, # latin capital letter A with tilde, U+00C3 ISOlat1
- 'Auml': 0x00c4, # latin capital letter A with diaeresis, U+00C4 ISOlat1
- 'Beta': 0x0392, # greek capital letter beta, U+0392
- 'Ccedil': 0x00c7, # latin capital letter C with cedilla, U+00C7 ISOlat1
- 'Chi': 0x03a7, # greek capital letter chi, U+03A7
- 'Dagger': 0x2021, # double dagger, U+2021 ISOpub
- 'Delta': 0x0394, # greek capital letter delta, U+0394 ISOgrk3
- 'ETH': 0x00d0, # latin capital letter ETH, U+00D0 ISOlat1
- 'Eacute': 0x00c9, # latin capital letter E with acute, U+00C9 ISOlat1
- 'Ecirc': 0x00ca, # latin capital letter E with circumflex, U+00CA ISOlat1
- 'Egrave': 0x00c8, # latin capital letter E with grave, U+00C8 ISOlat1
- 'Epsilon': 0x0395, # greek capital letter epsilon, U+0395
- 'Eta': 0x0397, # greek capital letter eta, U+0397
- 'Euml': 0x00cb, # latin capital letter E with diaeresis, U+00CB ISOlat1
- 'Gamma': 0x0393, # greek capital letter gamma, U+0393 ISOgrk3
- 'Iacute': 0x00cd, # latin capital letter I with acute, U+00CD ISOlat1
- 'Icirc': 0x00ce, # latin capital letter I with circumflex, U+00CE ISOlat1
- 'Igrave': 0x00cc, # latin capital letter I with grave, U+00CC ISOlat1
- 'Iota': 0x0399, # greek capital letter iota, U+0399
- 'Iuml': 0x00cf, # latin capital letter I with diaeresis, U+00CF ISOlat1
- 'Kappa': 0x039a, # greek capital letter kappa, U+039A
- 'Lambda': 0x039b, # greek capital letter lambda, U+039B ISOgrk3
- 'Mu': 0x039c, # greek capital letter mu, U+039C
- 'Ntilde': 0x00d1, # latin capital letter N with tilde, U+00D1 ISOlat1
- 'Nu': 0x039d, # greek capital letter nu, U+039D
- 'OElig': 0x0152, # latin capital ligature OE, U+0152 ISOlat2
- 'Oacute': 0x00d3, # latin capital letter O with acute, U+00D3 ISOlat1
- 'Ocirc': 0x00d4, # latin capital letter O with circumflex, U+00D4 ISOlat1
- 'Ograve': 0x00d2, # latin capital letter O with grave, U+00D2 ISOlat1
- 'Omega': 0x03a9, # greek capital letter omega, U+03A9 ISOgrk3
- 'Omicron': 0x039f, # greek capital letter omicron, U+039F
- 'Oslash': 0x00d8, # latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1
- 'Otilde': 0x00d5, # latin capital letter O with tilde, U+00D5 ISOlat1
- 'Ouml': 0x00d6, # latin capital letter O with diaeresis, U+00D6 ISOlat1
- 'Phi': 0x03a6, # greek capital letter phi, U+03A6 ISOgrk3
- 'Pi': 0x03a0, # greek capital letter pi, U+03A0 ISOgrk3
- 'Prime': 0x2033, # double prime = seconds = inches, U+2033 ISOtech
- 'Psi': 0x03a8, # greek capital letter psi, U+03A8 ISOgrk3
- 'Rho': 0x03a1, # greek capital letter rho, U+03A1
- 'Scaron': 0x0160, # latin capital letter S with caron, U+0160 ISOlat2
- 'Sigma': 0x03a3, # greek capital letter sigma, U+03A3 ISOgrk3
- 'THORN': 0x00de, # latin capital letter THORN, U+00DE ISOlat1
- 'Tau': 0x03a4, # greek capital letter tau, U+03A4
- 'Theta': 0x0398, # greek capital letter theta, U+0398 ISOgrk3
- 'Uacute': 0x00da, # latin capital letter U with acute, U+00DA ISOlat1
- 'Ucirc': 0x00db, # latin capital letter U with circumflex, U+00DB ISOlat1
- 'Ugrave': 0x00d9, # latin capital letter U with grave, U+00D9 ISOlat1
- 'Upsilon': 0x03a5, # greek capital letter upsilon, U+03A5 ISOgrk3
- 'Uuml': 0x00dc, # latin capital letter U with diaeresis, U+00DC ISOlat1
- 'Xi': 0x039e, # greek capital letter xi, U+039E ISOgrk3
- 'Yacute': 0x00dd, # latin capital letter Y with acute, U+00DD ISOlat1
- 'Yuml': 0x0178, # latin capital letter Y with diaeresis, U+0178 ISOlat2
- 'Zeta': 0x0396, # greek capital letter zeta, U+0396
- 'aacute': 0x00e1, # latin small letter a with acute, U+00E1 ISOlat1
- 'acirc': 0x00e2, # latin small letter a with circumflex, U+00E2 ISOlat1
- 'acute': 0x00b4, # acute accent = spacing acute, U+00B4 ISOdia
- 'aelig': 0x00e6, # latin small letter ae = latin small ligature ae, U+00E6 ISOlat1
- 'agrave': 0x00e0, # latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1
- 'alefsym': 0x2135, # alef symbol = first transfinite cardinal, U+2135 NEW
- 'alpha': 0x03b1, # greek small letter alpha, U+03B1 ISOgrk3
- 'amp': 0x0026, # ampersand, U+0026 ISOnum
- 'and': 0x2227, # logical and = wedge, U+2227 ISOtech
- 'ang': 0x2220, # angle, U+2220 ISOamso
- 'aring': 0x00e5, # latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1
- 'asymp': 0x2248, # almost equal to = asymptotic to, U+2248 ISOamsr
- 'atilde': 0x00e3, # latin small letter a with tilde, U+00E3 ISOlat1
- 'auml': 0x00e4, # latin small letter a with diaeresis, U+00E4 ISOlat1
- 'bdquo': 0x201e, # double low-9 quotation mark, U+201E NEW
- 'beta': 0x03b2, # greek small letter beta, U+03B2 ISOgrk3
- 'brvbar': 0x00a6, # broken bar = broken vertical bar, U+00A6 ISOnum
- 'bull': 0x2022, # bullet = black small circle, U+2022 ISOpub
- 'cap': 0x2229, # intersection = cap, U+2229 ISOtech
- 'ccedil': 0x00e7, # latin small letter c with cedilla, U+00E7 ISOlat1
- 'cedil': 0x00b8, # cedilla = spacing cedilla, U+00B8 ISOdia
- 'cent': 0x00a2, # cent sign, U+00A2 ISOnum
- 'chi': 0x03c7, # greek small letter chi, U+03C7 ISOgrk3
- 'circ': 0x02c6, # modifier letter circumflex accent, U+02C6 ISOpub
- 'clubs': 0x2663, # black club suit = shamrock, U+2663 ISOpub
- 'cong': 0x2245, # approximately equal to, U+2245 ISOtech
- 'copy': 0x00a9, # copyright sign, U+00A9 ISOnum
- 'crarr': 0x21b5, # downwards arrow with corner leftwards = carriage return, U+21B5 NEW
- 'cup': 0x222a, # union = cup, U+222A ISOtech
- 'curren': 0x00a4, # currency sign, U+00A4 ISOnum
- 'dArr': 0x21d3, # downwards double arrow, U+21D3 ISOamsa
- 'dagger': 0x2020, # dagger, U+2020 ISOpub
- 'darr': 0x2193, # downwards arrow, U+2193 ISOnum
- 'deg': 0x00b0, # degree sign, U+00B0 ISOnum
- 'delta': 0x03b4, # greek small letter delta, U+03B4 ISOgrk3
- 'diams': 0x2666, # black diamond suit, U+2666 ISOpub
- 'divide': 0x00f7, # division sign, U+00F7 ISOnum
- 'eacute': 0x00e9, # latin small letter e with acute, U+00E9 ISOlat1
- 'ecirc': 0x00ea, # latin small letter e with circumflex, U+00EA ISOlat1
- 'egrave': 0x00e8, # latin small letter e with grave, U+00E8 ISOlat1
- 'empty': 0x2205, # empty set = null set = diameter, U+2205 ISOamso
- 'emsp': 0x2003, # em space, U+2003 ISOpub
- 'ensp': 0x2002, # en space, U+2002 ISOpub
- 'epsilon': 0x03b5, # greek small letter epsilon, U+03B5 ISOgrk3
- 'equiv': 0x2261, # identical to, U+2261 ISOtech
- 'eta': 0x03b7, # greek small letter eta, U+03B7 ISOgrk3
- 'eth': 0x00f0, # latin small letter eth, U+00F0 ISOlat1
- 'euml': 0x00eb, # latin small letter e with diaeresis, U+00EB ISOlat1
- 'euro': 0x20ac, # euro sign, U+20AC NEW
- 'exist': 0x2203, # there exists, U+2203 ISOtech
- 'fnof': 0x0192, # latin small f with hook = function = florin, U+0192 ISOtech
- 'forall': 0x2200, # for all, U+2200 ISOtech
- 'frac12': 0x00bd, # vulgar fraction one half = fraction one half, U+00BD ISOnum
- 'frac14': 0x00bc, # vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum
- 'frac34': 0x00be, # vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum
- 'frasl': 0x2044, # fraction slash, U+2044 NEW
- 'gamma': 0x03b3, # greek small letter gamma, U+03B3 ISOgrk3
- 'ge': 0x2265, # greater-than or equal to, U+2265 ISOtech
- 'gt': 0x003e, # greater-than sign, U+003E ISOnum
- 'hArr': 0x21d4, # left right double arrow, U+21D4 ISOamsa
- 'harr': 0x2194, # left right arrow, U+2194 ISOamsa
- 'hearts': 0x2665, # black heart suit = valentine, U+2665 ISOpub
- 'hellip': 0x2026, # horizontal ellipsis = three dot leader, U+2026 ISOpub
- 'iacute': 0x00ed, # latin small letter i with acute, U+00ED ISOlat1
- 'icirc': 0x00ee, # latin small letter i with circumflex, U+00EE ISOlat1
- 'iexcl': 0x00a1, # inverted exclamation mark, U+00A1 ISOnum
- 'igrave': 0x00ec, # latin small letter i with grave, U+00EC ISOlat1
- 'image': 0x2111, # blackletter capital I = imaginary part, U+2111 ISOamso
- 'infin': 0x221e, # infinity, U+221E ISOtech
- 'int': 0x222b, # integral, U+222B ISOtech
- 'iota': 0x03b9, # greek small letter iota, U+03B9 ISOgrk3
- 'iquest': 0x00bf, # inverted question mark = turned question mark, U+00BF ISOnum
- 'isin': 0x2208, # element of, U+2208 ISOtech
- 'iuml': 0x00ef, # latin small letter i with diaeresis, U+00EF ISOlat1
- 'kappa': 0x03ba, # greek small letter kappa, U+03BA ISOgrk3
- 'lArr': 0x21d0, # leftwards double arrow, U+21D0 ISOtech
- 'lambda': 0x03bb, # greek small letter lambda, U+03BB ISOgrk3
- 'lang': 0x2329, # left-pointing angle bracket = bra, U+2329 ISOtech
- 'laquo': 0x00ab, # left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum
- 'larr': 0x2190, # leftwards arrow, U+2190 ISOnum
- 'lceil': 0x2308, # left ceiling = apl upstile, U+2308 ISOamsc
- 'ldquo': 0x201c, # left double quotation mark, U+201C ISOnum
- 'le': 0x2264, # less-than or equal to, U+2264 ISOtech
- 'lfloor': 0x230a, # left floor = apl downstile, U+230A ISOamsc
- 'lowast': 0x2217, # asterisk operator, U+2217 ISOtech
- 'loz': 0x25ca, # lozenge, U+25CA ISOpub
- 'lrm': 0x200e, # left-to-right mark, U+200E NEW RFC 2070
- 'lsaquo': 0x2039, # single left-pointing angle quotation mark, U+2039 ISO proposed
- 'lsquo': 0x2018, # left single quotation mark, U+2018 ISOnum
- 'lt': 0x003c, # less-than sign, U+003C ISOnum
- 'macr': 0x00af, # macron = spacing macron = overline = APL overbar, U+00AF ISOdia
- 'mdash': 0x2014, # em dash, U+2014 ISOpub
- 'micro': 0x00b5, # micro sign, U+00B5 ISOnum
- 'middot': 0x00b7, # middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum
- 'minus': 0x2212, # minus sign, U+2212 ISOtech
- 'mu': 0x03bc, # greek small letter mu, U+03BC ISOgrk3
- 'nabla': 0x2207, # nabla = backward difference, U+2207 ISOtech
- 'nbsp': 0x00a0, # no-break space = non-breaking space, U+00A0 ISOnum
- 'ndash': 0x2013, # en dash, U+2013 ISOpub
- 'ne': 0x2260, # not equal to, U+2260 ISOtech
- 'ni': 0x220b, # contains as member, U+220B ISOtech
- 'not': 0x00ac, # not sign, U+00AC ISOnum
- 'notin': 0x2209, # not an element of, U+2209 ISOtech
- 'nsub': 0x2284, # not a subset of, U+2284 ISOamsn
- 'ntilde': 0x00f1, # latin small letter n with tilde, U+00F1 ISOlat1
- 'nu': 0x03bd, # greek small letter nu, U+03BD ISOgrk3
- 'oacute': 0x00f3, # latin small letter o with acute, U+00F3 ISOlat1
- 'ocirc': 0x00f4, # latin small letter o with circumflex, U+00F4 ISOlat1
- 'oelig': 0x0153, # latin small ligature oe, U+0153 ISOlat2
- 'ograve': 0x00f2, # latin small letter o with grave, U+00F2 ISOlat1
- 'oline': 0x203e, # overline = spacing overscore, U+203E NEW
- 'omega': 0x03c9, # greek small letter omega, U+03C9 ISOgrk3
- 'omicron': 0x03bf, # greek small letter omicron, U+03BF NEW
- 'oplus': 0x2295, # circled plus = direct sum, U+2295 ISOamsb
- 'or': 0x2228, # logical or = vee, U+2228 ISOtech
- 'ordf': 0x00aa, # feminine ordinal indicator, U+00AA ISOnum
- 'ordm': 0x00ba, # masculine ordinal indicator, U+00BA ISOnum
- 'oslash': 0x00f8, # latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1
- 'otilde': 0x00f5, # latin small letter o with tilde, U+00F5 ISOlat1
- 'otimes': 0x2297, # circled times = vector product, U+2297 ISOamsb
- 'ouml': 0x00f6, # latin small letter o with diaeresis, U+00F6 ISOlat1
- 'para': 0x00b6, # pilcrow sign = paragraph sign, U+00B6 ISOnum
- 'part': 0x2202, # partial differential, U+2202 ISOtech
- 'permil': 0x2030, # per mille sign, U+2030 ISOtech
- 'perp': 0x22a5, # up tack = orthogonal to = perpendicular, U+22A5 ISOtech
- 'phi': 0x03c6, # greek small letter phi, U+03C6 ISOgrk3
- 'pi': 0x03c0, # greek small letter pi, U+03C0 ISOgrk3
- 'piv': 0x03d6, # greek pi symbol, U+03D6 ISOgrk3
- 'plusmn': 0x00b1, # plus-minus sign = plus-or-minus sign, U+00B1 ISOnum
- 'pound': 0x00a3, # pound sign, U+00A3 ISOnum
- 'prime': 0x2032, # prime = minutes = feet, U+2032 ISOtech
- 'prod': 0x220f, # n-ary product = product sign, U+220F ISOamsb
- 'prop': 0x221d, # proportional to, U+221D ISOtech
- 'psi': 0x03c8, # greek small letter psi, U+03C8 ISOgrk3
- 'quot': 0x0022, # quotation mark = APL quote, U+0022 ISOnum
- 'rArr': 0x21d2, # rightwards double arrow, U+21D2 ISOtech
- 'radic': 0x221a, # square root = radical sign, U+221A ISOtech
- 'rang': 0x232a, # right-pointing angle bracket = ket, U+232A ISOtech
- 'raquo': 0x00bb, # right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum
- 'rarr': 0x2192, # rightwards arrow, U+2192 ISOnum
- 'rceil': 0x2309, # right ceiling, U+2309 ISOamsc
- 'rdquo': 0x201d, # right double quotation mark, U+201D ISOnum
- 'real': 0x211c, # blackletter capital R = real part symbol, U+211C ISOamso
- 'reg': 0x00ae, # registered sign = registered trade mark sign, U+00AE ISOnum
- 'rfloor': 0x230b, # right floor, U+230B ISOamsc
- 'rho': 0x03c1, # greek small letter rho, U+03C1 ISOgrk3
- 'rlm': 0x200f, # right-to-left mark, U+200F NEW RFC 2070
- 'rsaquo': 0x203a, # single right-pointing angle quotation mark, U+203A ISO proposed
- 'rsquo': 0x2019, # right single quotation mark, U+2019 ISOnum
- 'sbquo': 0x201a, # single low-9 quotation mark, U+201A NEW
- 'scaron': 0x0161, # latin small letter s with caron, U+0161 ISOlat2
- 'sdot': 0x22c5, # dot operator, U+22C5 ISOamsb
- 'sect': 0x00a7, # section sign, U+00A7 ISOnum
- 'shy': 0x00ad, # soft hyphen = discretionary hyphen, U+00AD ISOnum
- 'sigma': 0x03c3, # greek small letter sigma, U+03C3 ISOgrk3
- 'sigmaf': 0x03c2, # greek small letter final sigma, U+03C2 ISOgrk3
- 'sim': 0x223c, # tilde operator = varies with = similar to, U+223C ISOtech
- 'spades': 0x2660, # black spade suit, U+2660 ISOpub
- 'sub': 0x2282, # subset of, U+2282 ISOtech
- 'sube': 0x2286, # subset of or equal to, U+2286 ISOtech
- 'sum': 0x2211, # n-ary summation, U+2211 ISOamsb
- 'sup': 0x2283, # superset of, U+2283 ISOtech
- 'sup1': 0x00b9, # superscript one = superscript digit one, U+00B9 ISOnum
- 'sup2': 0x00b2, # superscript two = superscript digit two = squared, U+00B2 ISOnum
- 'sup3': 0x00b3, # superscript three = superscript digit three = cubed, U+00B3 ISOnum
- 'supe': 0x2287, # superset of or equal to, U+2287 ISOtech
- 'szlig': 0x00df, # latin small letter sharp s = ess-zed, U+00DF ISOlat1
- 'tau': 0x03c4, # greek small letter tau, U+03C4 ISOgrk3
- 'there4': 0x2234, # therefore, U+2234 ISOtech
- 'theta': 0x03b8, # greek small letter theta, U+03B8 ISOgrk3
- 'thetasym': 0x03d1, # greek small letter theta symbol, U+03D1 NEW
- 'thinsp': 0x2009, # thin space, U+2009 ISOpub
- 'thorn': 0x00fe, # latin small letter thorn with, U+00FE ISOlat1
- 'tilde': 0x02dc, # small tilde, U+02DC ISOdia
- 'times': 0x00d7, # multiplication sign, U+00D7 ISOnum
- 'trade': 0x2122, # trade mark sign, U+2122 ISOnum
- 'uArr': 0x21d1, # upwards double arrow, U+21D1 ISOamsa
- 'uacute': 0x00fa, # latin small letter u with acute, U+00FA ISOlat1
- 'uarr': 0x2191, # upwards arrow, U+2191 ISOnum
- 'ucirc': 0x00fb, # latin small letter u with circumflex, U+00FB ISOlat1
- 'ugrave': 0x00f9, # latin small letter u with grave, U+00F9 ISOlat1
- 'uml': 0x00a8, # diaeresis = spacing diaeresis, U+00A8 ISOdia
- 'upsih': 0x03d2, # greek upsilon with hook symbol, U+03D2 NEW
- 'upsilon': 0x03c5, # greek small letter upsilon, U+03C5 ISOgrk3
- 'uuml': 0x00fc, # latin small letter u with diaeresis, U+00FC ISOlat1
- 'weierp': 0x2118, # script capital P = power set = Weierstrass p, U+2118 ISOamso
- 'xi': 0x03be, # greek small letter xi, U+03BE ISOgrk3
- 'yacute': 0x00fd, # latin small letter y with acute, U+00FD ISOlat1
- 'yen': 0x00a5, # yen sign = yuan sign, U+00A5 ISOnum
- 'yuml': 0x00ff, # latin small letter y with diaeresis, U+00FF ISOlat1
- 'zeta': 0x03b6, # greek small letter zeta, U+03B6 ISOgrk3
- 'zwj': 0x200d, # zero width joiner, U+200D NEW RFC 2070
- 'zwnj': 0x200c, # zero width non-joiner, U+200C NEW RFC 2070
+ "AElig": 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
+ "Aacute": 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
+ "Acirc": 0x00c2, # latin capital letter A with circumflex, U+00C2 ISOlat1
+ "Agrave": 0x00c0, # latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1
+ "Alpha": 0x0391, # greek capital letter alpha, U+0391
+ "Aring": 0x00c5, # latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
+ "Atilde": 0x00c3, # latin capital letter A with tilde, U+00C3 ISOlat1
+ "Auml": 0x00c4, # latin capital letter A with diaeresis, U+00C4 ISOlat1
+ "Beta": 0x0392, # greek capital letter beta, U+0392
+ "Ccedil": 0x00c7, # latin capital letter C with cedilla, U+00C7 ISOlat1
+ "Chi": 0x03a7, # greek capital letter chi, U+03A7
+ "Dagger": 0x2021, # double dagger, U+2021 ISOpub
+ "Delta": 0x0394, # greek capital letter delta, U+0394 ISOgrk3
+ "ETH": 0x00d0, # latin capital letter ETH, U+00D0 ISOlat1
+ "Eacute": 0x00c9, # latin capital letter E with acute, U+00C9 ISOlat1
+ "Ecirc": 0x00ca, # latin capital letter E with circumflex, U+00CA ISOlat1
+ "Egrave": 0x00c8, # latin capital letter E with grave, U+00C8 ISOlat1
+ "Epsilon": 0x0395, # greek capital letter epsilon, U+0395
+ "Eta": 0x0397, # greek capital letter eta, U+0397
+ "Euml": 0x00cb, # latin capital letter E with diaeresis, U+00CB ISOlat1
+ "Gamma": 0x0393, # greek capital letter gamma, U+0393 ISOgrk3
+ "Iacute": 0x00cd, # latin capital letter I with acute, U+00CD ISOlat1
+ "Icirc": 0x00ce, # latin capital letter I with circumflex, U+00CE ISOlat1
+ "Igrave": 0x00cc, # latin capital letter I with grave, U+00CC ISOlat1
+ "Iota": 0x0399, # greek capital letter iota, U+0399
+ "Iuml": 0x00cf, # latin capital letter I with diaeresis, U+00CF ISOlat1
+ "Kappa": 0x039a, # greek capital letter kappa, U+039A
+ "Lambda": 0x039b, # greek capital letter lambda, U+039B ISOgrk3
+ "Mu": 0x039c, # greek capital letter mu, U+039C
+ "Ntilde": 0x00d1, # latin capital letter N with tilde, U+00D1 ISOlat1
+ "Nu": 0x039d, # greek capital letter nu, U+039D
+ "OElig": 0x0152, # latin capital ligature OE, U+0152 ISOlat2
+ "Oacute": 0x00d3, # latin capital letter O with acute, U+00D3 ISOlat1
+ "Ocirc": 0x00d4, # latin capital letter O with circumflex, U+00D4 ISOlat1
+ "Ograve": 0x00d2, # latin capital letter O with grave, U+00D2 ISOlat1
+ "Omega": 0x03a9, # greek capital letter omega, U+03A9 ISOgrk3
+ "Omicron": 0x039f, # greek capital letter omicron, U+039F
+ "Oslash": 0x00d8, # latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1
+ "Otilde": 0x00d5, # latin capital letter O with tilde, U+00D5 ISOlat1
+ "Ouml": 0x00d6, # latin capital letter O with diaeresis, U+00D6 ISOlat1
+ "Phi": 0x03a6, # greek capital letter phi, U+03A6 ISOgrk3
+ "Pi": 0x03a0, # greek capital letter pi, U+03A0 ISOgrk3
+ "Prime": 0x2033, # double prime = seconds = inches, U+2033 ISOtech
+ "Psi": 0x03a8, # greek capital letter psi, U+03A8 ISOgrk3
+ "Rho": 0x03a1, # greek capital letter rho, U+03A1
+ "Scaron": 0x0160, # latin capital letter S with caron, U+0160 ISOlat2
+ "Sigma": 0x03a3, # greek capital letter sigma, U+03A3 ISOgrk3
+ "THORN": 0x00de, # latin capital letter THORN, U+00DE ISOlat1
+ "Tau": 0x03a4, # greek capital letter tau, U+03A4
+ "Theta": 0x0398, # greek capital letter theta, U+0398 ISOgrk3
+ "Uacute": 0x00da, # latin capital letter U with acute, U+00DA ISOlat1
+ "Ucirc": 0x00db, # latin capital letter U with circumflex, U+00DB ISOlat1
+ "Ugrave": 0x00d9, # latin capital letter U with grave, U+00D9 ISOlat1
+ "Upsilon": 0x03a5, # greek capital letter upsilon, U+03A5 ISOgrk3
+ "Uuml": 0x00dc, # latin capital letter U with diaeresis, U+00DC ISOlat1
+ "Xi": 0x039e, # greek capital letter xi, U+039E ISOgrk3
+ "Yacute": 0x00dd, # latin capital letter Y with acute, U+00DD ISOlat1
+ "Yuml": 0x0178, # latin capital letter Y with diaeresis, U+0178 ISOlat2
+ "Zeta": 0x0396, # greek capital letter zeta, U+0396
+ "aacute": 0x00e1, # latin small letter a with acute, U+00E1 ISOlat1
+ "acirc": 0x00e2, # latin small letter a with circumflex, U+00E2 ISOlat1
+ "acute": 0x00b4, # acute accent = spacing acute, U+00B4 ISOdia
+ "aelig": 0x00e6, # latin small letter ae = latin small ligature ae, U+00E6 ISOlat1
+ "agrave": 0x00e0, # latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1
+ "alefsym": 0x2135, # alef symbol = first transfinite cardinal, U+2135 NEW
+ "alpha": 0x03b1, # greek small letter alpha, U+03B1 ISOgrk3
+ "amp": 0x0026, # ampersand, U+0026 ISOnum
+ "and": 0x2227, # logical and = wedge, U+2227 ISOtech
+ "ang": 0x2220, # angle, U+2220 ISOamso
+ "aring": 0x00e5, # latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1
+ "asymp": 0x2248, # almost equal to = asymptotic to, U+2248 ISOamsr
+ "atilde": 0x00e3, # latin small letter a with tilde, U+00E3 ISOlat1
+ "auml": 0x00e4, # latin small letter a with diaeresis, U+00E4 ISOlat1
+ "bdquo": 0x201e, # double low-9 quotation mark, U+201E NEW
+ "beta": 0x03b2, # greek small letter beta, U+03B2 ISOgrk3
+ "brvbar": 0x00a6, # broken bar = broken vertical bar, U+00A6 ISOnum
+ "bull": 0x2022, # bullet = black small circle, U+2022 ISOpub
+ "cap": 0x2229, # intersection = cap, U+2229 ISOtech
+ "ccedil": 0x00e7, # latin small letter c with cedilla, U+00E7 ISOlat1
+ "cedil": 0x00b8, # cedilla = spacing cedilla, U+00B8 ISOdia
+ "cent": 0x00a2, # cent sign, U+00A2 ISOnum
+ "chi": 0x03c7, # greek small letter chi, U+03C7 ISOgrk3
+ "circ": 0x02c6, # modifier letter circumflex accent, U+02C6 ISOpub
+ "clubs": 0x2663, # black club suit = shamrock, U+2663 ISOpub
+ "cong": 0x2245, # approximately equal to, U+2245 ISOtech
+ "copy": 0x00a9, # copyright sign, U+00A9 ISOnum
+ "crarr": 0x21b5, # downwards arrow with corner leftwards = carriage return, U+21B5 NEW
+ "cup": 0x222a, # union = cup, U+222A ISOtech
+ "curren": 0x00a4, # currency sign, U+00A4 ISOnum
+ "dArr": 0x21d3, # downwards double arrow, U+21D3 ISOamsa
+ "dagger": 0x2020, # dagger, U+2020 ISOpub
+ "darr": 0x2193, # downwards arrow, U+2193 ISOnum
+ "deg": 0x00b0, # degree sign, U+00B0 ISOnum
+ "delta": 0x03b4, # greek small letter delta, U+03B4 ISOgrk3
+ "diams": 0x2666, # black diamond suit, U+2666 ISOpub
+ "divide": 0x00f7, # division sign, U+00F7 ISOnum
+ "eacute": 0x00e9, # latin small letter e with acute, U+00E9 ISOlat1
+ "ecirc": 0x00ea, # latin small letter e with circumflex, U+00EA ISOlat1
+ "egrave": 0x00e8, # latin small letter e with grave, U+00E8 ISOlat1
+ "empty": 0x2205, # empty set = null set = diameter, U+2205 ISOamso
+ "emsp": 0x2003, # em space, U+2003 ISOpub
+ "ensp": 0x2002, # en space, U+2002 ISOpub
+ "epsilon": 0x03b5, # greek small letter epsilon, U+03B5 ISOgrk3
+ "equiv": 0x2261, # identical to, U+2261 ISOtech
+ "eta": 0x03b7, # greek small letter eta, U+03B7 ISOgrk3
+ "eth": 0x00f0, # latin small letter eth, U+00F0 ISOlat1
+ "euml": 0x00eb, # latin small letter e with diaeresis, U+00EB ISOlat1
+ "euro": 0x20ac, # euro sign, U+20AC NEW
+ "exist": 0x2203, # there exists, U+2203 ISOtech
+ "fnof": 0x0192, # latin small f with hook = function = florin, U+0192 ISOtech
+ "forall": 0x2200, # for all, U+2200 ISOtech
+ "frac12": 0x00bd, # vulgar fraction one half = fraction one half, U+00BD ISOnum
+ "frac14": 0x00bc, # vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum
+ "frac34": 0x00be, # vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum
+ "frasl": 0x2044, # fraction slash, U+2044 NEW
+ "gamma": 0x03b3, # greek small letter gamma, U+03B3 ISOgrk3
+ "ge": 0x2265, # greater-than or equal to, U+2265 ISOtech
+ "gt": 0x003e, # greater-than sign, U+003E ISOnum
+ "hArr": 0x21d4, # left right double arrow, U+21D4 ISOamsa
+ "harr": 0x2194, # left right arrow, U+2194 ISOamsa
+ "hearts": 0x2665, # black heart suit = valentine, U+2665 ISOpub
+ "hellip": 0x2026, # horizontal ellipsis = three dot leader, U+2026 ISOpub
+ "iacute": 0x00ed, # latin small letter i with acute, U+00ED ISOlat1
+ "icirc": 0x00ee, # latin small letter i with circumflex, U+00EE ISOlat1
+ "iexcl": 0x00a1, # inverted exclamation mark, U+00A1 ISOnum
+ "igrave": 0x00ec, # latin small letter i with grave, U+00EC ISOlat1
+ "image": 0x2111, # blackletter capital I = imaginary part, U+2111 ISOamso
+ "infin": 0x221e, # infinity, U+221E ISOtech
+ "int": 0x222b, # integral, U+222B ISOtech
+ "iota": 0x03b9, # greek small letter iota, U+03B9 ISOgrk3
+ "iquest": 0x00bf, # inverted question mark = turned question mark, U+00BF ISOnum
+ "isin": 0x2208, # element of, U+2208 ISOtech
+ "iuml": 0x00ef, # latin small letter i with diaeresis, U+00EF ISOlat1
+ "kappa": 0x03ba, # greek small letter kappa, U+03BA ISOgrk3
+ "lArr": 0x21d0, # leftwards double arrow, U+21D0 ISOtech
+ "lambda": 0x03bb, # greek small letter lambda, U+03BB ISOgrk3
+ "lang": 0x2329, # left-pointing angle bracket = bra, U+2329 ISOtech
+ "laquo": 0x00ab, # left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum
+ "larr": 0x2190, # leftwards arrow, U+2190 ISOnum
+ "lceil": 0x2308, # left ceiling = apl upstile, U+2308 ISOamsc
+ "ldquo": 0x201c, # left double quotation mark, U+201C ISOnum
+ "le": 0x2264, # less-than or equal to, U+2264 ISOtech
+ "lfloor": 0x230a, # left floor = apl downstile, U+230A ISOamsc
+ "lowast": 0x2217, # asterisk operator, U+2217 ISOtech
+ "loz": 0x25ca, # lozenge, U+25CA ISOpub
+ "lrm": 0x200e, # left-to-right mark, U+200E NEW RFC 2070
+ "lsaquo": 0x2039, # single left-pointing angle quotation mark, U+2039 ISO proposed
+ "lsquo": 0x2018, # left single quotation mark, U+2018 ISOnum
+ "lt": 0x003c, # less-than sign, U+003C ISOnum
+ "macr": 0x00af, # macron = spacing macron = overline = APL overbar, U+00AF ISOdia
+ "mdash": 0x2014, # em dash, U+2014 ISOpub
+ "micro": 0x00b5, # micro sign, U+00B5 ISOnum
+ "middot": 0x00b7, # middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum
+ "minus": 0x2212, # minus sign, U+2212 ISOtech
+ "mu": 0x03bc, # greek small letter mu, U+03BC ISOgrk3
+ "nabla": 0x2207, # nabla = backward difference, U+2207 ISOtech
+ "nbsp": 0x00a0, # no-break space = non-breaking space, U+00A0 ISOnum
+ "ndash": 0x2013, # en dash, U+2013 ISOpub
+ "ne": 0x2260, # not equal to, U+2260 ISOtech
+ "ni": 0x220b, # contains as member, U+220B ISOtech
+ "not": 0x00ac, # not sign, U+00AC ISOnum
+ "notin": 0x2209, # not an element of, U+2209 ISOtech
+ "nsub": 0x2284, # not a subset of, U+2284 ISOamsn
+ "ntilde": 0x00f1, # latin small letter n with tilde, U+00F1 ISOlat1
+ "nu": 0x03bd, # greek small letter nu, U+03BD ISOgrk3
+ "oacute": 0x00f3, # latin small letter o with acute, U+00F3 ISOlat1
+ "ocirc": 0x00f4, # latin small letter o with circumflex, U+00F4 ISOlat1
+ "oelig": 0x0153, # latin small ligature oe, U+0153 ISOlat2
+ "ograve": 0x00f2, # latin small letter o with grave, U+00F2 ISOlat1
+ "oline": 0x203e, # overline = spacing overscore, U+203E NEW
+ "omega": 0x03c9, # greek small letter omega, U+03C9 ISOgrk3
+ "omicron": 0x03bf, # greek small letter omicron, U+03BF NEW
+ "oplus": 0x2295, # circled plus = direct sum, U+2295 ISOamsb
+ "or": 0x2228, # logical or = vee, U+2228 ISOtech
+ "ordf": 0x00aa, # feminine ordinal indicator, U+00AA ISOnum
+ "ordm": 0x00ba, # masculine ordinal indicator, U+00BA ISOnum
+ "oslash": 0x00f8, # latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1
+ "otilde": 0x00f5, # latin small letter o with tilde, U+00F5 ISOlat1
+ "otimes": 0x2297, # circled times = vector product, U+2297 ISOamsb
+ "ouml": 0x00f6, # latin small letter o with diaeresis, U+00F6 ISOlat1
+ "para": 0x00b6, # pilcrow sign = paragraph sign, U+00B6 ISOnum
+ "part": 0x2202, # partial differential, U+2202 ISOtech
+ "permil": 0x2030, # per mille sign, U+2030 ISOtech
+ "perp": 0x22a5, # up tack = orthogonal to = perpendicular, U+22A5 ISOtech
+ "phi": 0x03c6, # greek small letter phi, U+03C6 ISOgrk3
+ "pi": 0x03c0, # greek small letter pi, U+03C0 ISOgrk3
+ "piv": 0x03d6, # greek pi symbol, U+03D6 ISOgrk3
+ "plusmn": 0x00b1, # plus-minus sign = plus-or-minus sign, U+00B1 ISOnum
+ "pound": 0x00a3, # pound sign, U+00A3 ISOnum
+ "prime": 0x2032, # prime = minutes = feet, U+2032 ISOtech
+ "prod": 0x220f, # n-ary product = product sign, U+220F ISOamsb
+ "prop": 0x221d, # proportional to, U+221D ISOtech
+ "psi": 0x03c8, # greek small letter psi, U+03C8 ISOgrk3
+ "quot": 0x0022, # quotation mark = APL quote, U+0022 ISOnum
+ "rArr": 0x21d2, # rightwards double arrow, U+21D2 ISOtech
+ "radic": 0x221a, # square root = radical sign, U+221A ISOtech
+ "rang": 0x232a, # right-pointing angle bracket = ket, U+232A ISOtech
+ "raquo": 0x00bb, # right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum
+ "rarr": 0x2192, # rightwards arrow, U+2192 ISOnum
+ "rceil": 0x2309, # right ceiling, U+2309 ISOamsc
+ "rdquo": 0x201d, # right double quotation mark, U+201D ISOnum
+ "real": 0x211c, # blackletter capital R = real part symbol, U+211C ISOamso
+ "reg": 0x00ae, # registered sign = registered trade mark sign, U+00AE ISOnum
+ "rfloor": 0x230b, # right floor, U+230B ISOamsc
+ "rho": 0x03c1, # greek small letter rho, U+03C1 ISOgrk3
+ "rlm": 0x200f, # right-to-left mark, U+200F NEW RFC 2070
+ "rsaquo": 0x203a, # single right-pointing angle quotation mark, U+203A ISO proposed
+ "rsquo": 0x2019, # right single quotation mark, U+2019 ISOnum
+ "sbquo": 0x201a, # single low-9 quotation mark, U+201A NEW
+ "scaron": 0x0161, # latin small letter s with caron, U+0161 ISOlat2
+ "sdot": 0x22c5, # dot operator, U+22C5 ISOamsb
+ "sect": 0x00a7, # section sign, U+00A7 ISOnum
+ "shy": 0x00ad, # soft hyphen = discretionary hyphen, U+00AD ISOnum
+ "sigma": 0x03c3, # greek small letter sigma, U+03C3 ISOgrk3
+ "sigmaf": 0x03c2, # greek small letter final sigma, U+03C2 ISOgrk3
+ "sim": 0x223c, # tilde operator = varies with = similar to, U+223C ISOtech
+ "spades": 0x2660, # black spade suit, U+2660 ISOpub
+ "sub": 0x2282, # subset of, U+2282 ISOtech
+ "sube": 0x2286, # subset of or equal to, U+2286 ISOtech
+ "sum": 0x2211, # n-ary summation, U+2211 ISOamsb
+ "sup": 0x2283, # superset of, U+2283 ISOtech
+ "sup1": 0x00b9, # superscript one = superscript digit one, U+00B9 ISOnum
+ "sup2": 0x00b2, # superscript two = superscript digit two = squared, U+00B2 ISOnum
+ "sup3": 0x00b3, # superscript three = superscript digit three = cubed, U+00B3 ISOnum
+ "supe": 0x2287, # superset of or equal to, U+2287 ISOtech
+ "szlig": 0x00df, # latin small letter sharp s = ess-zed, U+00DF ISOlat1
+ "tau": 0x03c4, # greek small letter tau, U+03C4 ISOgrk3
+ "there4": 0x2234, # therefore, U+2234 ISOtech
+ "theta": 0x03b8, # greek small letter theta, U+03B8 ISOgrk3
+ "thetasym": 0x03d1, # greek small letter theta symbol, U+03D1 NEW
+ "thinsp": 0x2009, # thin space, U+2009 ISOpub
+ "thorn": 0x00fe, # latin small letter thorn with, U+00FE ISOlat1
+ "tilde": 0x02dc, # small tilde, U+02DC ISOdia
+ "times": 0x00d7, # multiplication sign, U+00D7 ISOnum
+ "trade": 0x2122, # trade mark sign, U+2122 ISOnum
+ "uArr": 0x21d1, # upwards double arrow, U+21D1 ISOamsa
+ "uacute": 0x00fa, # latin small letter u with acute, U+00FA ISOlat1
+ "uarr": 0x2191, # upwards arrow, U+2191 ISOnum
+ "ucirc": 0x00fb, # latin small letter u with circumflex, U+00FB ISOlat1
+ "ugrave": 0x00f9, # latin small letter u with grave, U+00F9 ISOlat1
+ "uml": 0x00a8, # diaeresis = spacing diaeresis, U+00A8 ISOdia
+ "upsih": 0x03d2, # greek upsilon with hook symbol, U+03D2 NEW
+ "upsilon": 0x03c5, # greek small letter upsilon, U+03C5 ISOgrk3
+ "uuml": 0x00fc, # latin small letter u with diaeresis, U+00FC ISOlat1
+ "weierp": 0x2118, # script capital P = power set = Weierstrass p, U+2118 ISOamso
+ "xi": 0x03be, # greek small letter xi, U+03BE ISOgrk3
+ "yacute": 0x00fd, # latin small letter y with acute, U+00FD ISOlat1
+ "yen": 0x00a5, # yen sign = yuan sign, U+00A5 ISOnum
+ "yuml": 0x00ff, # latin small letter y with diaeresis, U+00FF ISOlat1
+ "zeta": 0x03b6, # greek small letter zeta, U+03B6 ISOgrk3
+ "zwj": 0x200d, # zero width joiner, U+200D NEW RFC 2070
+ "zwnj": 0x200c, # zero width non-joiner, U+200C NEW RFC 2070
}
# maps the HTML5 named character references to the equivalent Unicode character(s)
html5 = {
- 'Aacute': '\xc1',
- 'aacute': '\xe1',
- 'Aacute;': '\xc1',
- 'aacute;': '\xe1',
- 'Abreve;': '\u0102',
- 'abreve;': '\u0103',
- 'ac;': '\u223e',
- 'acd;': '\u223f',
- 'acE;': '\u223e\u0333',
- 'Acirc': '\xc2',
- 'acirc': '\xe2',
- 'Acirc;': '\xc2',
- 'acirc;': '\xe2',
- 'acute': '\xb4',
- 'acute;': '\xb4',
- 'Acy;': '\u0410',
- 'acy;': '\u0430',
- 'AElig': '\xc6',
- 'aelig': '\xe6',
- 'AElig;': '\xc6',
- 'aelig;': '\xe6',
- 'af;': '\u2061',
- 'Afr;': '\U0001d504',
- 'afr;': '\U0001d51e',
- 'Agrave': '\xc0',
- 'agrave': '\xe0',
- 'Agrave;': '\xc0',
- 'agrave;': '\xe0',
- 'alefsym;': '\u2135',
- 'aleph;': '\u2135',
- 'Alpha;': '\u0391',
- 'alpha;': '\u03b1',
- 'Amacr;': '\u0100',
- 'amacr;': '\u0101',
- 'amalg;': '\u2a3f',
- 'AMP': '&',
- 'amp': '&',
- 'AMP;': '&',
- 'amp;': '&',
- 'And;': '\u2a53',
- 'and;': '\u2227',
- 'andand;': '\u2a55',
- 'andd;': '\u2a5c',
- 'andslope;': '\u2a58',
- 'andv;': '\u2a5a',
- 'ang;': '\u2220',
- 'ange;': '\u29a4',
- 'angle;': '\u2220',
- 'angmsd;': '\u2221',
- 'angmsdaa;': '\u29a8',
- 'angmsdab;': '\u29a9',
- 'angmsdac;': '\u29aa',
- 'angmsdad;': '\u29ab',
- 'angmsdae;': '\u29ac',
- 'angmsdaf;': '\u29ad',
- 'angmsdag;': '\u29ae',
- 'angmsdah;': '\u29af',
- 'angrt;': '\u221f',
- 'angrtvb;': '\u22be',
- 'angrtvbd;': '\u299d',
- 'angsph;': '\u2222',
- 'angst;': '\xc5',
- 'angzarr;': '\u237c',
- 'Aogon;': '\u0104',
- 'aogon;': '\u0105',
- 'Aopf;': '\U0001d538',
- 'aopf;': '\U0001d552',
- 'ap;': '\u2248',
- 'apacir;': '\u2a6f',
- 'apE;': '\u2a70',
- 'ape;': '\u224a',
- 'apid;': '\u224b',
- 'apos;': "'",
- 'ApplyFunction;': '\u2061',
- 'approx;': '\u2248',
- 'approxeq;': '\u224a',
- 'Aring': '\xc5',
- 'aring': '\xe5',
- 'Aring;': '\xc5',
- 'aring;': '\xe5',
- 'Ascr;': '\U0001d49c',
- 'ascr;': '\U0001d4b6',
- 'Assign;': '\u2254',
- 'ast;': '*',
- 'asymp;': '\u2248',
- 'asympeq;': '\u224d',
- 'Atilde': '\xc3',
- 'atilde': '\xe3',
- 'Atilde;': '\xc3',
- 'atilde;': '\xe3',
- 'Auml': '\xc4',
- 'auml': '\xe4',
- 'Auml;': '\xc4',
- 'auml;': '\xe4',
- 'awconint;': '\u2233',
- 'awint;': '\u2a11',
- 'backcong;': '\u224c',
- 'backepsilon;': '\u03f6',
- 'backprime;': '\u2035',
- 'backsim;': '\u223d',
- 'backsimeq;': '\u22cd',
- 'Backslash;': '\u2216',
- 'Barv;': '\u2ae7',
- 'barvee;': '\u22bd',
- 'Barwed;': '\u2306',
- 'barwed;': '\u2305',
- 'barwedge;': '\u2305',
- 'bbrk;': '\u23b5',
- 'bbrktbrk;': '\u23b6',
- 'bcong;': '\u224c',
- 'Bcy;': '\u0411',
- 'bcy;': '\u0431',
- 'bdquo;': '\u201e',
- 'becaus;': '\u2235',
- 'Because;': '\u2235',
- 'because;': '\u2235',
- 'bemptyv;': '\u29b0',
- 'bepsi;': '\u03f6',
- 'bernou;': '\u212c',
- 'Bernoullis;': '\u212c',
- 'Beta;': '\u0392',
- 'beta;': '\u03b2',
- 'beth;': '\u2136',
- 'between;': '\u226c',
- 'Bfr;': '\U0001d505',
- 'bfr;': '\U0001d51f',
- 'bigcap;': '\u22c2',
- 'bigcirc;': '\u25ef',
- 'bigcup;': '\u22c3',
- 'bigodot;': '\u2a00',
- 'bigoplus;': '\u2a01',
- 'bigotimes;': '\u2a02',
- 'bigsqcup;': '\u2a06',
- 'bigstar;': '\u2605',
- 'bigtriangledown;': '\u25bd',
- 'bigtriangleup;': '\u25b3',
- 'biguplus;': '\u2a04',
- 'bigvee;': '\u22c1',
- 'bigwedge;': '\u22c0',
- 'bkarow;': '\u290d',
- 'blacklozenge;': '\u29eb',
- 'blacksquare;': '\u25aa',
- 'blacktriangle;': '\u25b4',
- 'blacktriangledown;': '\u25be',
- 'blacktriangleleft;': '\u25c2',
- 'blacktriangleright;': '\u25b8',
- 'blank;': '\u2423',
- 'blk12;': '\u2592',
- 'blk14;': '\u2591',
- 'blk34;': '\u2593',
- 'block;': '\u2588',
- 'bne;': '=\u20e5',
- 'bnequiv;': '\u2261\u20e5',
- 'bNot;': '\u2aed',
- 'bnot;': '\u2310',
- 'Bopf;': '\U0001d539',
- 'bopf;': '\U0001d553',
- 'bot;': '\u22a5',
- 'bottom;': '\u22a5',
- 'bowtie;': '\u22c8',
- 'boxbox;': '\u29c9',
- 'boxDL;': '\u2557',
- 'boxDl;': '\u2556',
- 'boxdL;': '\u2555',
- 'boxdl;': '\u2510',
- 'boxDR;': '\u2554',
- 'boxDr;': '\u2553',
- 'boxdR;': '\u2552',
- 'boxdr;': '\u250c',
- 'boxH;': '\u2550',
- 'boxh;': '\u2500',
- 'boxHD;': '\u2566',
- 'boxHd;': '\u2564',
- 'boxhD;': '\u2565',
- 'boxhd;': '\u252c',
- 'boxHU;': '\u2569',
- 'boxHu;': '\u2567',
- 'boxhU;': '\u2568',
- 'boxhu;': '\u2534',
- 'boxminus;': '\u229f',
- 'boxplus;': '\u229e',
- 'boxtimes;': '\u22a0',
- 'boxUL;': '\u255d',
- 'boxUl;': '\u255c',
- 'boxuL;': '\u255b',
- 'boxul;': '\u2518',
- 'boxUR;': '\u255a',
- 'boxUr;': '\u2559',
- 'boxuR;': '\u2558',
- 'boxur;': '\u2514',
- 'boxV;': '\u2551',
- 'boxv;': '\u2502',
- 'boxVH;': '\u256c',
- 'boxVh;': '\u256b',
- 'boxvH;': '\u256a',
- 'boxvh;': '\u253c',
- 'boxVL;': '\u2563',
- 'boxVl;': '\u2562',
- 'boxvL;': '\u2561',
- 'boxvl;': '\u2524',
- 'boxVR;': '\u2560',
- 'boxVr;': '\u255f',
- 'boxvR;': '\u255e',
- 'boxvr;': '\u251c',
- 'bprime;': '\u2035',
- 'Breve;': '\u02d8',
- 'breve;': '\u02d8',
- 'brvbar': '\xa6',
- 'brvbar;': '\xa6',
- 'Bscr;': '\u212c',
- 'bscr;': '\U0001d4b7',
- 'bsemi;': '\u204f',
- 'bsim;': '\u223d',
- 'bsime;': '\u22cd',
- 'bsol;': '\\',
- 'bsolb;': '\u29c5',
- 'bsolhsub;': '\u27c8',
- 'bull;': '\u2022',
- 'bullet;': '\u2022',
- 'bump;': '\u224e',
- 'bumpE;': '\u2aae',
- 'bumpe;': '\u224f',
- 'Bumpeq;': '\u224e',
- 'bumpeq;': '\u224f',
- 'Cacute;': '\u0106',
- 'cacute;': '\u0107',
- 'Cap;': '\u22d2',
- 'cap;': '\u2229',
- 'capand;': '\u2a44',
- 'capbrcup;': '\u2a49',
- 'capcap;': '\u2a4b',
- 'capcup;': '\u2a47',
- 'capdot;': '\u2a40',
- 'CapitalDifferentialD;': '\u2145',
- 'caps;': '\u2229\ufe00',
- 'caret;': '\u2041',
- 'caron;': '\u02c7',
- 'Cayleys;': '\u212d',
- 'ccaps;': '\u2a4d',
- 'Ccaron;': '\u010c',
- 'ccaron;': '\u010d',
- 'Ccedil': '\xc7',
- 'ccedil': '\xe7',
- 'Ccedil;': '\xc7',
- 'ccedil;': '\xe7',
- 'Ccirc;': '\u0108',
- 'ccirc;': '\u0109',
- 'Cconint;': '\u2230',
- 'ccups;': '\u2a4c',
- 'ccupssm;': '\u2a50',
- 'Cdot;': '\u010a',
- 'cdot;': '\u010b',
- 'cedil': '\xb8',
- 'cedil;': '\xb8',
- 'Cedilla;': '\xb8',
- 'cemptyv;': '\u29b2',
- 'cent': '\xa2',
- 'cent;': '\xa2',
- 'CenterDot;': '\xb7',
- 'centerdot;': '\xb7',
- 'Cfr;': '\u212d',
- 'cfr;': '\U0001d520',
- 'CHcy;': '\u0427',
- 'chcy;': '\u0447',
- 'check;': '\u2713',
- 'checkmark;': '\u2713',
- 'Chi;': '\u03a7',
- 'chi;': '\u03c7',
- 'cir;': '\u25cb',
- 'circ;': '\u02c6',
- 'circeq;': '\u2257',
- 'circlearrowleft;': '\u21ba',
- 'circlearrowright;': '\u21bb',
- 'circledast;': '\u229b',
- 'circledcirc;': '\u229a',
- 'circleddash;': '\u229d',
- 'CircleDot;': '\u2299',
- 'circledR;': '\xae',
- 'circledS;': '\u24c8',
- 'CircleMinus;': '\u2296',
- 'CirclePlus;': '\u2295',
- 'CircleTimes;': '\u2297',
- 'cirE;': '\u29c3',
- 'cire;': '\u2257',
- 'cirfnint;': '\u2a10',
- 'cirmid;': '\u2aef',
- 'cirscir;': '\u29c2',
- 'ClockwiseContourIntegral;': '\u2232',
- 'CloseCurlyDoubleQuote;': '\u201d',
- 'CloseCurlyQuote;': '\u2019',
- 'clubs;': '\u2663',
- 'clubsuit;': '\u2663',
- 'Colon;': '\u2237',
- 'colon;': ':',
- 'Colone;': '\u2a74',
- 'colone;': '\u2254',
- 'coloneq;': '\u2254',
- 'comma;': ',',
- 'commat;': '@',
- 'comp;': '\u2201',
- 'compfn;': '\u2218',
- 'complement;': '\u2201',
- 'complexes;': '\u2102',
- 'cong;': '\u2245',
- 'congdot;': '\u2a6d',
- 'Congruent;': '\u2261',
- 'Conint;': '\u222f',
- 'conint;': '\u222e',
- 'ContourIntegral;': '\u222e',
- 'Copf;': '\u2102',
- 'copf;': '\U0001d554',
- 'coprod;': '\u2210',
- 'Coproduct;': '\u2210',
- 'COPY': '\xa9',
- 'copy': '\xa9',
- 'COPY;': '\xa9',
- 'copy;': '\xa9',
- 'copysr;': '\u2117',
- 'CounterClockwiseContourIntegral;': '\u2233',
- 'crarr;': '\u21b5',
- 'Cross;': '\u2a2f',
- 'cross;': '\u2717',
- 'Cscr;': '\U0001d49e',
- 'cscr;': '\U0001d4b8',
- 'csub;': '\u2acf',
- 'csube;': '\u2ad1',
- 'csup;': '\u2ad0',
- 'csupe;': '\u2ad2',
- 'ctdot;': '\u22ef',
- 'cudarrl;': '\u2938',
- 'cudarrr;': '\u2935',
- 'cuepr;': '\u22de',
- 'cuesc;': '\u22df',
- 'cularr;': '\u21b6',
- 'cularrp;': '\u293d',
- 'Cup;': '\u22d3',
- 'cup;': '\u222a',
- 'cupbrcap;': '\u2a48',
- 'CupCap;': '\u224d',
- 'cupcap;': '\u2a46',
- 'cupcup;': '\u2a4a',
- 'cupdot;': '\u228d',
- 'cupor;': '\u2a45',
- 'cups;': '\u222a\ufe00',
- 'curarr;': '\u21b7',
- 'curarrm;': '\u293c',
- 'curlyeqprec;': '\u22de',
- 'curlyeqsucc;': '\u22df',
- 'curlyvee;': '\u22ce',
- 'curlywedge;': '\u22cf',
- 'curren': '\xa4',
- 'curren;': '\xa4',
- 'curvearrowleft;': '\u21b6',
- 'curvearrowright;': '\u21b7',
- 'cuvee;': '\u22ce',
- 'cuwed;': '\u22cf',
- 'cwconint;': '\u2232',
- 'cwint;': '\u2231',
- 'cylcty;': '\u232d',
- 'Dagger;': '\u2021',
- 'dagger;': '\u2020',
- 'daleth;': '\u2138',
- 'Darr;': '\u21a1',
- 'dArr;': '\u21d3',
- 'darr;': '\u2193',
- 'dash;': '\u2010',
- 'Dashv;': '\u2ae4',
- 'dashv;': '\u22a3',
- 'dbkarow;': '\u290f',
- 'dblac;': '\u02dd',
- 'Dcaron;': '\u010e',
- 'dcaron;': '\u010f',
- 'Dcy;': '\u0414',
- 'dcy;': '\u0434',
- 'DD;': '\u2145',
- 'dd;': '\u2146',
- 'ddagger;': '\u2021',
- 'ddarr;': '\u21ca',
- 'DDotrahd;': '\u2911',
- 'ddotseq;': '\u2a77',
- 'deg': '\xb0',
- 'deg;': '\xb0',
- 'Del;': '\u2207',
- 'Delta;': '\u0394',
- 'delta;': '\u03b4',
- 'demptyv;': '\u29b1',
- 'dfisht;': '\u297f',
- 'Dfr;': '\U0001d507',
- 'dfr;': '\U0001d521',
- 'dHar;': '\u2965',
- 'dharl;': '\u21c3',
- 'dharr;': '\u21c2',
- 'DiacriticalAcute;': '\xb4',
- 'DiacriticalDot;': '\u02d9',
- 'DiacriticalDoubleAcute;': '\u02dd',
- 'DiacriticalGrave;': '`',
- 'DiacriticalTilde;': '\u02dc',
- 'diam;': '\u22c4',
- 'Diamond;': '\u22c4',
- 'diamond;': '\u22c4',
- 'diamondsuit;': '\u2666',
- 'diams;': '\u2666',
- 'die;': '\xa8',
- 'DifferentialD;': '\u2146',
- 'digamma;': '\u03dd',
- 'disin;': '\u22f2',
- 'div;': '\xf7',
- 'divide': '\xf7',
- 'divide;': '\xf7',
- 'divideontimes;': '\u22c7',
- 'divonx;': '\u22c7',
- 'DJcy;': '\u0402',
- 'djcy;': '\u0452',
- 'dlcorn;': '\u231e',
- 'dlcrop;': '\u230d',
- 'dollar;': '$',
- 'Dopf;': '\U0001d53b',
- 'dopf;': '\U0001d555',
- 'Dot;': '\xa8',
- 'dot;': '\u02d9',
- 'DotDot;': '\u20dc',
- 'doteq;': '\u2250',
- 'doteqdot;': '\u2251',
- 'DotEqual;': '\u2250',
- 'dotminus;': '\u2238',
- 'dotplus;': '\u2214',
- 'dotsquare;': '\u22a1',
- 'doublebarwedge;': '\u2306',
- 'DoubleContourIntegral;': '\u222f',
- 'DoubleDot;': '\xa8',
- 'DoubleDownArrow;': '\u21d3',
- 'DoubleLeftArrow;': '\u21d0',
- 'DoubleLeftRightArrow;': '\u21d4',
- 'DoubleLeftTee;': '\u2ae4',
- 'DoubleLongLeftArrow;': '\u27f8',
- 'DoubleLongLeftRightArrow;': '\u27fa',
- 'DoubleLongRightArrow;': '\u27f9',
- 'DoubleRightArrow;': '\u21d2',
- 'DoubleRightTee;': '\u22a8',
- 'DoubleUpArrow;': '\u21d1',
- 'DoubleUpDownArrow;': '\u21d5',
- 'DoubleVerticalBar;': '\u2225',
- 'DownArrow;': '\u2193',
- 'Downarrow;': '\u21d3',
- 'downarrow;': '\u2193',
- 'DownArrowBar;': '\u2913',
- 'DownArrowUpArrow;': '\u21f5',
- 'DownBreve;': '\u0311',
- 'downdownarrows;': '\u21ca',
- 'downharpoonleft;': '\u21c3',
- 'downharpoonright;': '\u21c2',
- 'DownLeftRightVector;': '\u2950',
- 'DownLeftTeeVector;': '\u295e',
- 'DownLeftVector;': '\u21bd',
- 'DownLeftVectorBar;': '\u2956',
- 'DownRightTeeVector;': '\u295f',
- 'DownRightVector;': '\u21c1',
- 'DownRightVectorBar;': '\u2957',
- 'DownTee;': '\u22a4',
- 'DownTeeArrow;': '\u21a7',
- 'drbkarow;': '\u2910',
- 'drcorn;': '\u231f',
- 'drcrop;': '\u230c',
- 'Dscr;': '\U0001d49f',
- 'dscr;': '\U0001d4b9',
- 'DScy;': '\u0405',
- 'dscy;': '\u0455',
- 'dsol;': '\u29f6',
- 'Dstrok;': '\u0110',
- 'dstrok;': '\u0111',
- 'dtdot;': '\u22f1',
- 'dtri;': '\u25bf',
- 'dtrif;': '\u25be',
- 'duarr;': '\u21f5',
- 'duhar;': '\u296f',
- 'dwangle;': '\u29a6',
- 'DZcy;': '\u040f',
- 'dzcy;': '\u045f',
- 'dzigrarr;': '\u27ff',
- 'Eacute': '\xc9',
- 'eacute': '\xe9',
- 'Eacute;': '\xc9',
- 'eacute;': '\xe9',
- 'easter;': '\u2a6e',
- 'Ecaron;': '\u011a',
- 'ecaron;': '\u011b',
- 'ecir;': '\u2256',
- 'Ecirc': '\xca',
- 'ecirc': '\xea',
- 'Ecirc;': '\xca',
- 'ecirc;': '\xea',
- 'ecolon;': '\u2255',
- 'Ecy;': '\u042d',
- 'ecy;': '\u044d',
- 'eDDot;': '\u2a77',
- 'Edot;': '\u0116',
- 'eDot;': '\u2251',
- 'edot;': '\u0117',
- 'ee;': '\u2147',
- 'efDot;': '\u2252',
- 'Efr;': '\U0001d508',
- 'efr;': '\U0001d522',
- 'eg;': '\u2a9a',
- 'Egrave': '\xc8',
- 'egrave': '\xe8',
- 'Egrave;': '\xc8',
- 'egrave;': '\xe8',
- 'egs;': '\u2a96',
- 'egsdot;': '\u2a98',
- 'el;': '\u2a99',
- 'Element;': '\u2208',
- 'elinters;': '\u23e7',
- 'ell;': '\u2113',
- 'els;': '\u2a95',
- 'elsdot;': '\u2a97',
- 'Emacr;': '\u0112',
- 'emacr;': '\u0113',
- 'empty;': '\u2205',
- 'emptyset;': '\u2205',
- 'EmptySmallSquare;': '\u25fb',
- 'emptyv;': '\u2205',
- 'EmptyVerySmallSquare;': '\u25ab',
- 'emsp13;': '\u2004',
- 'emsp14;': '\u2005',
- 'emsp;': '\u2003',
- 'ENG;': '\u014a',
- 'eng;': '\u014b',
- 'ensp;': '\u2002',
- 'Eogon;': '\u0118',
- 'eogon;': '\u0119',
- 'Eopf;': '\U0001d53c',
- 'eopf;': '\U0001d556',
- 'epar;': '\u22d5',
- 'eparsl;': '\u29e3',
- 'eplus;': '\u2a71',
- 'epsi;': '\u03b5',
- 'Epsilon;': '\u0395',
- 'epsilon;': '\u03b5',
- 'epsiv;': '\u03f5',
- 'eqcirc;': '\u2256',
- 'eqcolon;': '\u2255',
- 'eqsim;': '\u2242',
- 'eqslantgtr;': '\u2a96',
- 'eqslantless;': '\u2a95',
- 'Equal;': '\u2a75',
- 'equals;': '=',
- 'EqualTilde;': '\u2242',
- 'equest;': '\u225f',
- 'Equilibrium;': '\u21cc',
- 'equiv;': '\u2261',
- 'equivDD;': '\u2a78',
- 'eqvparsl;': '\u29e5',
- 'erarr;': '\u2971',
- 'erDot;': '\u2253',
- 'Escr;': '\u2130',
- 'escr;': '\u212f',
- 'esdot;': '\u2250',
- 'Esim;': '\u2a73',
- 'esim;': '\u2242',
- 'Eta;': '\u0397',
- 'eta;': '\u03b7',
- 'ETH': '\xd0',
- 'eth': '\xf0',
- 'ETH;': '\xd0',
- 'eth;': '\xf0',
- 'Euml': '\xcb',
- 'euml': '\xeb',
- 'Euml;': '\xcb',
- 'euml;': '\xeb',
- 'euro;': '\u20ac',
- 'excl;': '!',
- 'exist;': '\u2203',
- 'Exists;': '\u2203',
- 'expectation;': '\u2130',
- 'ExponentialE;': '\u2147',
- 'exponentiale;': '\u2147',
- 'fallingdotseq;': '\u2252',
- 'Fcy;': '\u0424',
- 'fcy;': '\u0444',
- 'female;': '\u2640',
- 'ffilig;': '\ufb03',
- 'fflig;': '\ufb00',
- 'ffllig;': '\ufb04',
- 'Ffr;': '\U0001d509',
- 'ffr;': '\U0001d523',
- 'filig;': '\ufb01',
- 'FilledSmallSquare;': '\u25fc',
- 'FilledVerySmallSquare;': '\u25aa',
- 'fjlig;': 'fj',
- 'flat;': '\u266d',
- 'fllig;': '\ufb02',
- 'fltns;': '\u25b1',
- 'fnof;': '\u0192',
- 'Fopf;': '\U0001d53d',
- 'fopf;': '\U0001d557',
- 'ForAll;': '\u2200',
- 'forall;': '\u2200',
- 'fork;': '\u22d4',
- 'forkv;': '\u2ad9',
- 'Fouriertrf;': '\u2131',
- 'fpartint;': '\u2a0d',
- 'frac12': '\xbd',
- 'frac12;': '\xbd',
- 'frac13;': '\u2153',
- 'frac14': '\xbc',
- 'frac14;': '\xbc',
- 'frac15;': '\u2155',
- 'frac16;': '\u2159',
- 'frac18;': '\u215b',
- 'frac23;': '\u2154',
- 'frac25;': '\u2156',
- 'frac34': '\xbe',
- 'frac34;': '\xbe',
- 'frac35;': '\u2157',
- 'frac38;': '\u215c',
- 'frac45;': '\u2158',
- 'frac56;': '\u215a',
- 'frac58;': '\u215d',
- 'frac78;': '\u215e',
- 'frasl;': '\u2044',
- 'frown;': '\u2322',
- 'Fscr;': '\u2131',
- 'fscr;': '\U0001d4bb',
- 'gacute;': '\u01f5',
- 'Gamma;': '\u0393',
- 'gamma;': '\u03b3',
- 'Gammad;': '\u03dc',
- 'gammad;': '\u03dd',
- 'gap;': '\u2a86',
- 'Gbreve;': '\u011e',
- 'gbreve;': '\u011f',
- 'Gcedil;': '\u0122',
- 'Gcirc;': '\u011c',
- 'gcirc;': '\u011d',
- 'Gcy;': '\u0413',
- 'gcy;': '\u0433',
- 'Gdot;': '\u0120',
- 'gdot;': '\u0121',
- 'gE;': '\u2267',
- 'ge;': '\u2265',
- 'gEl;': '\u2a8c',
- 'gel;': '\u22db',
- 'geq;': '\u2265',
- 'geqq;': '\u2267',
- 'geqslant;': '\u2a7e',
- 'ges;': '\u2a7e',
- 'gescc;': '\u2aa9',
- 'gesdot;': '\u2a80',
- 'gesdoto;': '\u2a82',
- 'gesdotol;': '\u2a84',
- 'gesl;': '\u22db\ufe00',
- 'gesles;': '\u2a94',
- 'Gfr;': '\U0001d50a',
- 'gfr;': '\U0001d524',
- 'Gg;': '\u22d9',
- 'gg;': '\u226b',
- 'ggg;': '\u22d9',
- 'gimel;': '\u2137',
- 'GJcy;': '\u0403',
- 'gjcy;': '\u0453',
- 'gl;': '\u2277',
- 'gla;': '\u2aa5',
- 'glE;': '\u2a92',
- 'glj;': '\u2aa4',
- 'gnap;': '\u2a8a',
- 'gnapprox;': '\u2a8a',
- 'gnE;': '\u2269',
- 'gne;': '\u2a88',
- 'gneq;': '\u2a88',
- 'gneqq;': '\u2269',
- 'gnsim;': '\u22e7',
- 'Gopf;': '\U0001d53e',
- 'gopf;': '\U0001d558',
- 'grave;': '`',
- 'GreaterEqual;': '\u2265',
- 'GreaterEqualLess;': '\u22db',
- 'GreaterFullEqual;': '\u2267',
- 'GreaterGreater;': '\u2aa2',
- 'GreaterLess;': '\u2277',
- 'GreaterSlantEqual;': '\u2a7e',
- 'GreaterTilde;': '\u2273',
- 'Gscr;': '\U0001d4a2',
- 'gscr;': '\u210a',
- 'gsim;': '\u2273',
- 'gsime;': '\u2a8e',
- 'gsiml;': '\u2a90',
- 'GT': '>',
- 'gt': '>',
- 'GT;': '>',
- 'Gt;': '\u226b',
- 'gt;': '>',
- 'gtcc;': '\u2aa7',
- 'gtcir;': '\u2a7a',
- 'gtdot;': '\u22d7',
- 'gtlPar;': '\u2995',
- 'gtquest;': '\u2a7c',
- 'gtrapprox;': '\u2a86',
- 'gtrarr;': '\u2978',
- 'gtrdot;': '\u22d7',
- 'gtreqless;': '\u22db',
- 'gtreqqless;': '\u2a8c',
- 'gtrless;': '\u2277',
- 'gtrsim;': '\u2273',
- 'gvertneqq;': '\u2269\ufe00',
- 'gvnE;': '\u2269\ufe00',
- 'Hacek;': '\u02c7',
- 'hairsp;': '\u200a',
- 'half;': '\xbd',
- 'hamilt;': '\u210b',
- 'HARDcy;': '\u042a',
- 'hardcy;': '\u044a',
- 'hArr;': '\u21d4',
- 'harr;': '\u2194',
- 'harrcir;': '\u2948',
- 'harrw;': '\u21ad',
- 'Hat;': '^',
- 'hbar;': '\u210f',
- 'Hcirc;': '\u0124',
- 'hcirc;': '\u0125',
- 'hearts;': '\u2665',
- 'heartsuit;': '\u2665',
- 'hellip;': '\u2026',
- 'hercon;': '\u22b9',
- 'Hfr;': '\u210c',
- 'hfr;': '\U0001d525',
- 'HilbertSpace;': '\u210b',
- 'hksearow;': '\u2925',
- 'hkswarow;': '\u2926',
- 'hoarr;': '\u21ff',
- 'homtht;': '\u223b',
- 'hookleftarrow;': '\u21a9',
- 'hookrightarrow;': '\u21aa',
- 'Hopf;': '\u210d',
- 'hopf;': '\U0001d559',
- 'horbar;': '\u2015',
- 'HorizontalLine;': '\u2500',
- 'Hscr;': '\u210b',
- 'hscr;': '\U0001d4bd',
- 'hslash;': '\u210f',
- 'Hstrok;': '\u0126',
- 'hstrok;': '\u0127',
- 'HumpDownHump;': '\u224e',
- 'HumpEqual;': '\u224f',
- 'hybull;': '\u2043',
- 'hyphen;': '\u2010',
- 'Iacute': '\xcd',
- 'iacute': '\xed',
- 'Iacute;': '\xcd',
- 'iacute;': '\xed',
- 'ic;': '\u2063',
- 'Icirc': '\xce',
- 'icirc': '\xee',
- 'Icirc;': '\xce',
- 'icirc;': '\xee',
- 'Icy;': '\u0418',
- 'icy;': '\u0438',
- 'Idot;': '\u0130',
- 'IEcy;': '\u0415',
- 'iecy;': '\u0435',
- 'iexcl': '\xa1',
- 'iexcl;': '\xa1',
- 'iff;': '\u21d4',
- 'Ifr;': '\u2111',
- 'ifr;': '\U0001d526',
- 'Igrave': '\xcc',
- 'igrave': '\xec',
- 'Igrave;': '\xcc',
- 'igrave;': '\xec',
- 'ii;': '\u2148',
- 'iiiint;': '\u2a0c',
- 'iiint;': '\u222d',
- 'iinfin;': '\u29dc',
- 'iiota;': '\u2129',
- 'IJlig;': '\u0132',
- 'ijlig;': '\u0133',
- 'Im;': '\u2111',
- 'Imacr;': '\u012a',
- 'imacr;': '\u012b',
- 'image;': '\u2111',
- 'ImaginaryI;': '\u2148',
- 'imagline;': '\u2110',
- 'imagpart;': '\u2111',
- 'imath;': '\u0131',
- 'imof;': '\u22b7',
- 'imped;': '\u01b5',
- 'Implies;': '\u21d2',
- 'in;': '\u2208',
- 'incare;': '\u2105',
- 'infin;': '\u221e',
- 'infintie;': '\u29dd',
- 'inodot;': '\u0131',
- 'Int;': '\u222c',
- 'int;': '\u222b',
- 'intcal;': '\u22ba',
- 'integers;': '\u2124',
- 'Integral;': '\u222b',
- 'intercal;': '\u22ba',
- 'Intersection;': '\u22c2',
- 'intlarhk;': '\u2a17',
- 'intprod;': '\u2a3c',
- 'InvisibleComma;': '\u2063',
- 'InvisibleTimes;': '\u2062',
- 'IOcy;': '\u0401',
- 'iocy;': '\u0451',
- 'Iogon;': '\u012e',
- 'iogon;': '\u012f',
- 'Iopf;': '\U0001d540',
- 'iopf;': '\U0001d55a',
- 'Iota;': '\u0399',
- 'iota;': '\u03b9',
- 'iprod;': '\u2a3c',
- 'iquest': '\xbf',
- 'iquest;': '\xbf',
- 'Iscr;': '\u2110',
- 'iscr;': '\U0001d4be',
- 'isin;': '\u2208',
- 'isindot;': '\u22f5',
- 'isinE;': '\u22f9',
- 'isins;': '\u22f4',
- 'isinsv;': '\u22f3',
- 'isinv;': '\u2208',
- 'it;': '\u2062',
- 'Itilde;': '\u0128',
- 'itilde;': '\u0129',
- 'Iukcy;': '\u0406',
- 'iukcy;': '\u0456',
- 'Iuml': '\xcf',
- 'iuml': '\xef',
- 'Iuml;': '\xcf',
- 'iuml;': '\xef',
- 'Jcirc;': '\u0134',
- 'jcirc;': '\u0135',
- 'Jcy;': '\u0419',
- 'jcy;': '\u0439',
- 'Jfr;': '\U0001d50d',
- 'jfr;': '\U0001d527',
- 'jmath;': '\u0237',
- 'Jopf;': '\U0001d541',
- 'jopf;': '\U0001d55b',
- 'Jscr;': '\U0001d4a5',
- 'jscr;': '\U0001d4bf',
- 'Jsercy;': '\u0408',
- 'jsercy;': '\u0458',
- 'Jukcy;': '\u0404',
- 'jukcy;': '\u0454',
- 'Kappa;': '\u039a',
- 'kappa;': '\u03ba',
- 'kappav;': '\u03f0',
- 'Kcedil;': '\u0136',
- 'kcedil;': '\u0137',
- 'Kcy;': '\u041a',
- 'kcy;': '\u043a',
- 'Kfr;': '\U0001d50e',
- 'kfr;': '\U0001d528',
- 'kgreen;': '\u0138',
- 'KHcy;': '\u0425',
- 'khcy;': '\u0445',
- 'KJcy;': '\u040c',
- 'kjcy;': '\u045c',
- 'Kopf;': '\U0001d542',
- 'kopf;': '\U0001d55c',
- 'Kscr;': '\U0001d4a6',
- 'kscr;': '\U0001d4c0',
- 'lAarr;': '\u21da',
- 'Lacute;': '\u0139',
- 'lacute;': '\u013a',
- 'laemptyv;': '\u29b4',
- 'lagran;': '\u2112',
- 'Lambda;': '\u039b',
- 'lambda;': '\u03bb',
- 'Lang;': '\u27ea',
- 'lang;': '\u27e8',
- 'langd;': '\u2991',
- 'langle;': '\u27e8',
- 'lap;': '\u2a85',
- 'Laplacetrf;': '\u2112',
- 'laquo': '\xab',
- 'laquo;': '\xab',
- 'Larr;': '\u219e',
- 'lArr;': '\u21d0',
- 'larr;': '\u2190',
- 'larrb;': '\u21e4',
- 'larrbfs;': '\u291f',
- 'larrfs;': '\u291d',
- 'larrhk;': '\u21a9',
- 'larrlp;': '\u21ab',
- 'larrpl;': '\u2939',
- 'larrsim;': '\u2973',
- 'larrtl;': '\u21a2',
- 'lat;': '\u2aab',
- 'lAtail;': '\u291b',
- 'latail;': '\u2919',
- 'late;': '\u2aad',
- 'lates;': '\u2aad\ufe00',
- 'lBarr;': '\u290e',
- 'lbarr;': '\u290c',
- 'lbbrk;': '\u2772',
- 'lbrace;': '{',
- 'lbrack;': '[',
- 'lbrke;': '\u298b',
- 'lbrksld;': '\u298f',
- 'lbrkslu;': '\u298d',
- 'Lcaron;': '\u013d',
- 'lcaron;': '\u013e',
- 'Lcedil;': '\u013b',
- 'lcedil;': '\u013c',
- 'lceil;': '\u2308',
- 'lcub;': '{',
- 'Lcy;': '\u041b',
- 'lcy;': '\u043b',
- 'ldca;': '\u2936',
- 'ldquo;': '\u201c',
- 'ldquor;': '\u201e',
- 'ldrdhar;': '\u2967',
- 'ldrushar;': '\u294b',
- 'ldsh;': '\u21b2',
- 'lE;': '\u2266',
- 'le;': '\u2264',
- 'LeftAngleBracket;': '\u27e8',
- 'LeftArrow;': '\u2190',
- 'Leftarrow;': '\u21d0',
- 'leftarrow;': '\u2190',
- 'LeftArrowBar;': '\u21e4',
- 'LeftArrowRightArrow;': '\u21c6',
- 'leftarrowtail;': '\u21a2',
- 'LeftCeiling;': '\u2308',
- 'LeftDoubleBracket;': '\u27e6',
- 'LeftDownTeeVector;': '\u2961',
- 'LeftDownVector;': '\u21c3',
- 'LeftDownVectorBar;': '\u2959',
- 'LeftFloor;': '\u230a',
- 'leftharpoondown;': '\u21bd',
- 'leftharpoonup;': '\u21bc',
- 'leftleftarrows;': '\u21c7',
- 'LeftRightArrow;': '\u2194',
- 'Leftrightarrow;': '\u21d4',
- 'leftrightarrow;': '\u2194',
- 'leftrightarrows;': '\u21c6',
- 'leftrightharpoons;': '\u21cb',
- 'leftrightsquigarrow;': '\u21ad',
- 'LeftRightVector;': '\u294e',
- 'LeftTee;': '\u22a3',
- 'LeftTeeArrow;': '\u21a4',
- 'LeftTeeVector;': '\u295a',
- 'leftthreetimes;': '\u22cb',
- 'LeftTriangle;': '\u22b2',
- 'LeftTriangleBar;': '\u29cf',
- 'LeftTriangleEqual;': '\u22b4',
- 'LeftUpDownVector;': '\u2951',
- 'LeftUpTeeVector;': '\u2960',
- 'LeftUpVector;': '\u21bf',
- 'LeftUpVectorBar;': '\u2958',
- 'LeftVector;': '\u21bc',
- 'LeftVectorBar;': '\u2952',
- 'lEg;': '\u2a8b',
- 'leg;': '\u22da',
- 'leq;': '\u2264',
- 'leqq;': '\u2266',
- 'leqslant;': '\u2a7d',
- 'les;': '\u2a7d',
- 'lescc;': '\u2aa8',
- 'lesdot;': '\u2a7f',
- 'lesdoto;': '\u2a81',
- 'lesdotor;': '\u2a83',
- 'lesg;': '\u22da\ufe00',
- 'lesges;': '\u2a93',
- 'lessapprox;': '\u2a85',
- 'lessdot;': '\u22d6',
- 'lesseqgtr;': '\u22da',
- 'lesseqqgtr;': '\u2a8b',
- 'LessEqualGreater;': '\u22da',
- 'LessFullEqual;': '\u2266',
- 'LessGreater;': '\u2276',
- 'lessgtr;': '\u2276',
- 'LessLess;': '\u2aa1',
- 'lesssim;': '\u2272',
- 'LessSlantEqual;': '\u2a7d',
- 'LessTilde;': '\u2272',
- 'lfisht;': '\u297c',
- 'lfloor;': '\u230a',
- 'Lfr;': '\U0001d50f',
- 'lfr;': '\U0001d529',
- 'lg;': '\u2276',
- 'lgE;': '\u2a91',
- 'lHar;': '\u2962',
- 'lhard;': '\u21bd',
- 'lharu;': '\u21bc',
- 'lharul;': '\u296a',
- 'lhblk;': '\u2584',
- 'LJcy;': '\u0409',
- 'ljcy;': '\u0459',
- 'Ll;': '\u22d8',
- 'll;': '\u226a',
- 'llarr;': '\u21c7',
- 'llcorner;': '\u231e',
- 'Lleftarrow;': '\u21da',
- 'llhard;': '\u296b',
- 'lltri;': '\u25fa',
- 'Lmidot;': '\u013f',
- 'lmidot;': '\u0140',
- 'lmoust;': '\u23b0',
- 'lmoustache;': '\u23b0',
- 'lnap;': '\u2a89',
- 'lnapprox;': '\u2a89',
- 'lnE;': '\u2268',
- 'lne;': '\u2a87',
- 'lneq;': '\u2a87',
- 'lneqq;': '\u2268',
- 'lnsim;': '\u22e6',
- 'loang;': '\u27ec',
- 'loarr;': '\u21fd',
- 'lobrk;': '\u27e6',
- 'LongLeftArrow;': '\u27f5',
- 'Longleftarrow;': '\u27f8',
- 'longleftarrow;': '\u27f5',
- 'LongLeftRightArrow;': '\u27f7',
- 'Longleftrightarrow;': '\u27fa',
- 'longleftrightarrow;': '\u27f7',
- 'longmapsto;': '\u27fc',
- 'LongRightArrow;': '\u27f6',
- 'Longrightarrow;': '\u27f9',
- 'longrightarrow;': '\u27f6',
- 'looparrowleft;': '\u21ab',
- 'looparrowright;': '\u21ac',
- 'lopar;': '\u2985',
- 'Lopf;': '\U0001d543',
- 'lopf;': '\U0001d55d',
- 'loplus;': '\u2a2d',
- 'lotimes;': '\u2a34',
- 'lowast;': '\u2217',
- 'lowbar;': '_',
- 'LowerLeftArrow;': '\u2199',
- 'LowerRightArrow;': '\u2198',
- 'loz;': '\u25ca',
- 'lozenge;': '\u25ca',
- 'lozf;': '\u29eb',
- 'lpar;': '(',
- 'lparlt;': '\u2993',
- 'lrarr;': '\u21c6',
- 'lrcorner;': '\u231f',
- 'lrhar;': '\u21cb',
- 'lrhard;': '\u296d',
- 'lrm;': '\u200e',
- 'lrtri;': '\u22bf',
- 'lsaquo;': '\u2039',
- 'Lscr;': '\u2112',
- 'lscr;': '\U0001d4c1',
- 'Lsh;': '\u21b0',
- 'lsh;': '\u21b0',
- 'lsim;': '\u2272',
- 'lsime;': '\u2a8d',
- 'lsimg;': '\u2a8f',
- 'lsqb;': '[',
- 'lsquo;': '\u2018',
- 'lsquor;': '\u201a',
- 'Lstrok;': '\u0141',
- 'lstrok;': '\u0142',
- 'LT': '<',
- 'lt': '<',
- 'LT;': '<',
- 'Lt;': '\u226a',
- 'lt;': '<',
- 'ltcc;': '\u2aa6',
- 'ltcir;': '\u2a79',
- 'ltdot;': '\u22d6',
- 'lthree;': '\u22cb',
- 'ltimes;': '\u22c9',
- 'ltlarr;': '\u2976',
- 'ltquest;': '\u2a7b',
- 'ltri;': '\u25c3',
- 'ltrie;': '\u22b4',
- 'ltrif;': '\u25c2',
- 'ltrPar;': '\u2996',
- 'lurdshar;': '\u294a',
- 'luruhar;': '\u2966',
- 'lvertneqq;': '\u2268\ufe00',
- 'lvnE;': '\u2268\ufe00',
- 'macr': '\xaf',
- 'macr;': '\xaf',
- 'male;': '\u2642',
- 'malt;': '\u2720',
- 'maltese;': '\u2720',
- 'Map;': '\u2905',
- 'map;': '\u21a6',
- 'mapsto;': '\u21a6',
- 'mapstodown;': '\u21a7',
- 'mapstoleft;': '\u21a4',
- 'mapstoup;': '\u21a5',
- 'marker;': '\u25ae',
- 'mcomma;': '\u2a29',
- 'Mcy;': '\u041c',
- 'mcy;': '\u043c',
- 'mdash;': '\u2014',
- 'mDDot;': '\u223a',
- 'measuredangle;': '\u2221',
- 'MediumSpace;': '\u205f',
- 'Mellintrf;': '\u2133',
- 'Mfr;': '\U0001d510',
- 'mfr;': '\U0001d52a',
- 'mho;': '\u2127',
- 'micro': '\xb5',
- 'micro;': '\xb5',
- 'mid;': '\u2223',
- 'midast;': '*',
- 'midcir;': '\u2af0',
- 'middot': '\xb7',
- 'middot;': '\xb7',
- 'minus;': '\u2212',
- 'minusb;': '\u229f',
- 'minusd;': '\u2238',
- 'minusdu;': '\u2a2a',
- 'MinusPlus;': '\u2213',
- 'mlcp;': '\u2adb',
- 'mldr;': '\u2026',
- 'mnplus;': '\u2213',
- 'models;': '\u22a7',
- 'Mopf;': '\U0001d544',
- 'mopf;': '\U0001d55e',
- 'mp;': '\u2213',
- 'Mscr;': '\u2133',
- 'mscr;': '\U0001d4c2',
- 'mstpos;': '\u223e',
- 'Mu;': '\u039c',
- 'mu;': '\u03bc',
- 'multimap;': '\u22b8',
- 'mumap;': '\u22b8',
- 'nabla;': '\u2207',
- 'Nacute;': '\u0143',
- 'nacute;': '\u0144',
- 'nang;': '\u2220\u20d2',
- 'nap;': '\u2249',
- 'napE;': '\u2a70\u0338',
- 'napid;': '\u224b\u0338',
- 'napos;': '\u0149',
- 'napprox;': '\u2249',
- 'natur;': '\u266e',
- 'natural;': '\u266e',
- 'naturals;': '\u2115',
- 'nbsp': '\xa0',
- 'nbsp;': '\xa0',
- 'nbump;': '\u224e\u0338',
- 'nbumpe;': '\u224f\u0338',
- 'ncap;': '\u2a43',
- 'Ncaron;': '\u0147',
- 'ncaron;': '\u0148',
- 'Ncedil;': '\u0145',
- 'ncedil;': '\u0146',
- 'ncong;': '\u2247',
- 'ncongdot;': '\u2a6d\u0338',
- 'ncup;': '\u2a42',
- 'Ncy;': '\u041d',
- 'ncy;': '\u043d',
- 'ndash;': '\u2013',
- 'ne;': '\u2260',
- 'nearhk;': '\u2924',
- 'neArr;': '\u21d7',
- 'nearr;': '\u2197',
- 'nearrow;': '\u2197',
- 'nedot;': '\u2250\u0338',
- 'NegativeMediumSpace;': '\u200b',
- 'NegativeThickSpace;': '\u200b',
- 'NegativeThinSpace;': '\u200b',
- 'NegativeVeryThinSpace;': '\u200b',
- 'nequiv;': '\u2262',
- 'nesear;': '\u2928',
- 'nesim;': '\u2242\u0338',
- 'NestedGreaterGreater;': '\u226b',
- 'NestedLessLess;': '\u226a',
- 'NewLine;': '\n',
- 'nexist;': '\u2204',
- 'nexists;': '\u2204',
- 'Nfr;': '\U0001d511',
- 'nfr;': '\U0001d52b',
- 'ngE;': '\u2267\u0338',
- 'nge;': '\u2271',
- 'ngeq;': '\u2271',
- 'ngeqq;': '\u2267\u0338',
- 'ngeqslant;': '\u2a7e\u0338',
- 'nges;': '\u2a7e\u0338',
- 'nGg;': '\u22d9\u0338',
- 'ngsim;': '\u2275',
- 'nGt;': '\u226b\u20d2',
- 'ngt;': '\u226f',
- 'ngtr;': '\u226f',
- 'nGtv;': '\u226b\u0338',
- 'nhArr;': '\u21ce',
- 'nharr;': '\u21ae',
- 'nhpar;': '\u2af2',
- 'ni;': '\u220b',
- 'nis;': '\u22fc',
- 'nisd;': '\u22fa',
- 'niv;': '\u220b',
- 'NJcy;': '\u040a',
- 'njcy;': '\u045a',
- 'nlArr;': '\u21cd',
- 'nlarr;': '\u219a',
- 'nldr;': '\u2025',
- 'nlE;': '\u2266\u0338',
- 'nle;': '\u2270',
- 'nLeftarrow;': '\u21cd',
- 'nleftarrow;': '\u219a',
- 'nLeftrightarrow;': '\u21ce',
- 'nleftrightarrow;': '\u21ae',
- 'nleq;': '\u2270',
- 'nleqq;': '\u2266\u0338',
- 'nleqslant;': '\u2a7d\u0338',
- 'nles;': '\u2a7d\u0338',
- 'nless;': '\u226e',
- 'nLl;': '\u22d8\u0338',
- 'nlsim;': '\u2274',
- 'nLt;': '\u226a\u20d2',
- 'nlt;': '\u226e',
- 'nltri;': '\u22ea',
- 'nltrie;': '\u22ec',
- 'nLtv;': '\u226a\u0338',
- 'nmid;': '\u2224',
- 'NoBreak;': '\u2060',
- 'NonBreakingSpace;': '\xa0',
- 'Nopf;': '\u2115',
- 'nopf;': '\U0001d55f',
- 'not': '\xac',
- 'Not;': '\u2aec',
- 'not;': '\xac',
- 'NotCongruent;': '\u2262',
- 'NotCupCap;': '\u226d',
- 'NotDoubleVerticalBar;': '\u2226',
- 'NotElement;': '\u2209',
- 'NotEqual;': '\u2260',
- 'NotEqualTilde;': '\u2242\u0338',
- 'NotExists;': '\u2204',
- 'NotGreater;': '\u226f',
- 'NotGreaterEqual;': '\u2271',
- 'NotGreaterFullEqual;': '\u2267\u0338',
- 'NotGreaterGreater;': '\u226b\u0338',
- 'NotGreaterLess;': '\u2279',
- 'NotGreaterSlantEqual;': '\u2a7e\u0338',
- 'NotGreaterTilde;': '\u2275',
- 'NotHumpDownHump;': '\u224e\u0338',
- 'NotHumpEqual;': '\u224f\u0338',
- 'notin;': '\u2209',
- 'notindot;': '\u22f5\u0338',
- 'notinE;': '\u22f9\u0338',
- 'notinva;': '\u2209',
- 'notinvb;': '\u22f7',
- 'notinvc;': '\u22f6',
- 'NotLeftTriangle;': '\u22ea',
- 'NotLeftTriangleBar;': '\u29cf\u0338',
- 'NotLeftTriangleEqual;': '\u22ec',
- 'NotLess;': '\u226e',
- 'NotLessEqual;': '\u2270',
- 'NotLessGreater;': '\u2278',
- 'NotLessLess;': '\u226a\u0338',
- 'NotLessSlantEqual;': '\u2a7d\u0338',
- 'NotLessTilde;': '\u2274',
- 'NotNestedGreaterGreater;': '\u2aa2\u0338',
- 'NotNestedLessLess;': '\u2aa1\u0338',
- 'notni;': '\u220c',
- 'notniva;': '\u220c',
- 'notnivb;': '\u22fe',
- 'notnivc;': '\u22fd',
- 'NotPrecedes;': '\u2280',
- 'NotPrecedesEqual;': '\u2aaf\u0338',
- 'NotPrecedesSlantEqual;': '\u22e0',
- 'NotReverseElement;': '\u220c',
- 'NotRightTriangle;': '\u22eb',
- 'NotRightTriangleBar;': '\u29d0\u0338',
- 'NotRightTriangleEqual;': '\u22ed',
- 'NotSquareSubset;': '\u228f\u0338',
- 'NotSquareSubsetEqual;': '\u22e2',
- 'NotSquareSuperset;': '\u2290\u0338',
- 'NotSquareSupersetEqual;': '\u22e3',
- 'NotSubset;': '\u2282\u20d2',
- 'NotSubsetEqual;': '\u2288',
- 'NotSucceeds;': '\u2281',
- 'NotSucceedsEqual;': '\u2ab0\u0338',
- 'NotSucceedsSlantEqual;': '\u22e1',
- 'NotSucceedsTilde;': '\u227f\u0338',
- 'NotSuperset;': '\u2283\u20d2',
- 'NotSupersetEqual;': '\u2289',
- 'NotTilde;': '\u2241',
- 'NotTildeEqual;': '\u2244',
- 'NotTildeFullEqual;': '\u2247',
- 'NotTildeTilde;': '\u2249',
- 'NotVerticalBar;': '\u2224',
- 'npar;': '\u2226',
- 'nparallel;': '\u2226',
- 'nparsl;': '\u2afd\u20e5',
- 'npart;': '\u2202\u0338',
- 'npolint;': '\u2a14',
- 'npr;': '\u2280',
- 'nprcue;': '\u22e0',
- 'npre;': '\u2aaf\u0338',
- 'nprec;': '\u2280',
- 'npreceq;': '\u2aaf\u0338',
- 'nrArr;': '\u21cf',
- 'nrarr;': '\u219b',
- 'nrarrc;': '\u2933\u0338',
- 'nrarrw;': '\u219d\u0338',
- 'nRightarrow;': '\u21cf',
- 'nrightarrow;': '\u219b',
- 'nrtri;': '\u22eb',
- 'nrtrie;': '\u22ed',
- 'nsc;': '\u2281',
- 'nsccue;': '\u22e1',
- 'nsce;': '\u2ab0\u0338',
- 'Nscr;': '\U0001d4a9',
- 'nscr;': '\U0001d4c3',
- 'nshortmid;': '\u2224',
- 'nshortparallel;': '\u2226',
- 'nsim;': '\u2241',
- 'nsime;': '\u2244',
- 'nsimeq;': '\u2244',
- 'nsmid;': '\u2224',
- 'nspar;': '\u2226',
- 'nsqsube;': '\u22e2',
- 'nsqsupe;': '\u22e3',
- 'nsub;': '\u2284',
- 'nsubE;': '\u2ac5\u0338',
- 'nsube;': '\u2288',
- 'nsubset;': '\u2282\u20d2',
- 'nsubseteq;': '\u2288',
- 'nsubseteqq;': '\u2ac5\u0338',
- 'nsucc;': '\u2281',
- 'nsucceq;': '\u2ab0\u0338',
- 'nsup;': '\u2285',
- 'nsupE;': '\u2ac6\u0338',
- 'nsupe;': '\u2289',
- 'nsupset;': '\u2283\u20d2',
- 'nsupseteq;': '\u2289',
- 'nsupseteqq;': '\u2ac6\u0338',
- 'ntgl;': '\u2279',
- 'Ntilde': '\xd1',
- 'ntilde': '\xf1',
- 'Ntilde;': '\xd1',
- 'ntilde;': '\xf1',
- 'ntlg;': '\u2278',
- 'ntriangleleft;': '\u22ea',
- 'ntrianglelefteq;': '\u22ec',
- 'ntriangleright;': '\u22eb',
- 'ntrianglerighteq;': '\u22ed',
- 'Nu;': '\u039d',
- 'nu;': '\u03bd',
- 'num;': '#',
- 'numero;': '\u2116',
- 'numsp;': '\u2007',
- 'nvap;': '\u224d\u20d2',
- 'nVDash;': '\u22af',
- 'nVdash;': '\u22ae',
- 'nvDash;': '\u22ad',
- 'nvdash;': '\u22ac',
- 'nvge;': '\u2265\u20d2',
- 'nvgt;': '>\u20d2',
- 'nvHarr;': '\u2904',
- 'nvinfin;': '\u29de',
- 'nvlArr;': '\u2902',
- 'nvle;': '\u2264\u20d2',
- 'nvlt;': '<\u20d2',
- 'nvltrie;': '\u22b4\u20d2',
- 'nvrArr;': '\u2903',
- 'nvrtrie;': '\u22b5\u20d2',
- 'nvsim;': '\u223c\u20d2',
- 'nwarhk;': '\u2923',
- 'nwArr;': '\u21d6',
- 'nwarr;': '\u2196',
- 'nwarrow;': '\u2196',
- 'nwnear;': '\u2927',
- 'Oacute': '\xd3',
- 'oacute': '\xf3',
- 'Oacute;': '\xd3',
- 'oacute;': '\xf3',
- 'oast;': '\u229b',
- 'ocir;': '\u229a',
- 'Ocirc': '\xd4',
- 'ocirc': '\xf4',
- 'Ocirc;': '\xd4',
- 'ocirc;': '\xf4',
- 'Ocy;': '\u041e',
- 'ocy;': '\u043e',
- 'odash;': '\u229d',
- 'Odblac;': '\u0150',
- 'odblac;': '\u0151',
- 'odiv;': '\u2a38',
- 'odot;': '\u2299',
- 'odsold;': '\u29bc',
- 'OElig;': '\u0152',
- 'oelig;': '\u0153',
- 'ofcir;': '\u29bf',
- 'Ofr;': '\U0001d512',
- 'ofr;': '\U0001d52c',
- 'ogon;': '\u02db',
- 'Ograve': '\xd2',
- 'ograve': '\xf2',
- 'Ograve;': '\xd2',
- 'ograve;': '\xf2',
- 'ogt;': '\u29c1',
- 'ohbar;': '\u29b5',
- 'ohm;': '\u03a9',
- 'oint;': '\u222e',
- 'olarr;': '\u21ba',
- 'olcir;': '\u29be',
- 'olcross;': '\u29bb',
- 'oline;': '\u203e',
- 'olt;': '\u29c0',
- 'Omacr;': '\u014c',
- 'omacr;': '\u014d',
- 'Omega;': '\u03a9',
- 'omega;': '\u03c9',
- 'Omicron;': '\u039f',
- 'omicron;': '\u03bf',
- 'omid;': '\u29b6',
- 'ominus;': '\u2296',
- 'Oopf;': '\U0001d546',
- 'oopf;': '\U0001d560',
- 'opar;': '\u29b7',
- 'OpenCurlyDoubleQuote;': '\u201c',
- 'OpenCurlyQuote;': '\u2018',
- 'operp;': '\u29b9',
- 'oplus;': '\u2295',
- 'Or;': '\u2a54',
- 'or;': '\u2228',
- 'orarr;': '\u21bb',
- 'ord;': '\u2a5d',
- 'order;': '\u2134',
- 'orderof;': '\u2134',
- 'ordf': '\xaa',
- 'ordf;': '\xaa',
- 'ordm': '\xba',
- 'ordm;': '\xba',
- 'origof;': '\u22b6',
- 'oror;': '\u2a56',
- 'orslope;': '\u2a57',
- 'orv;': '\u2a5b',
- 'oS;': '\u24c8',
- 'Oscr;': '\U0001d4aa',
- 'oscr;': '\u2134',
- 'Oslash': '\xd8',
- 'oslash': '\xf8',
- 'Oslash;': '\xd8',
- 'oslash;': '\xf8',
- 'osol;': '\u2298',
- 'Otilde': '\xd5',
- 'otilde': '\xf5',
- 'Otilde;': '\xd5',
- 'otilde;': '\xf5',
- 'Otimes;': '\u2a37',
- 'otimes;': '\u2297',
- 'otimesas;': '\u2a36',
- 'Ouml': '\xd6',
- 'ouml': '\xf6',
- 'Ouml;': '\xd6',
- 'ouml;': '\xf6',
- 'ovbar;': '\u233d',
- 'OverBar;': '\u203e',
- 'OverBrace;': '\u23de',
- 'OverBracket;': '\u23b4',
- 'OverParenthesis;': '\u23dc',
- 'par;': '\u2225',
- 'para': '\xb6',
- 'para;': '\xb6',
- 'parallel;': '\u2225',
- 'parsim;': '\u2af3',
- 'parsl;': '\u2afd',
- 'part;': '\u2202',
- 'PartialD;': '\u2202',
- 'Pcy;': '\u041f',
- 'pcy;': '\u043f',
- 'percnt;': '%',
- 'period;': '.',
- 'permil;': '\u2030',
- 'perp;': '\u22a5',
- 'pertenk;': '\u2031',
- 'Pfr;': '\U0001d513',
- 'pfr;': '\U0001d52d',
- 'Phi;': '\u03a6',
- 'phi;': '\u03c6',
- 'phiv;': '\u03d5',
- 'phmmat;': '\u2133',
- 'phone;': '\u260e',
- 'Pi;': '\u03a0',
- 'pi;': '\u03c0',
- 'pitchfork;': '\u22d4',
- 'piv;': '\u03d6',
- 'planck;': '\u210f',
- 'planckh;': '\u210e',
- 'plankv;': '\u210f',
- 'plus;': '+',
- 'plusacir;': '\u2a23',
- 'plusb;': '\u229e',
- 'pluscir;': '\u2a22',
- 'plusdo;': '\u2214',
- 'plusdu;': '\u2a25',
- 'pluse;': '\u2a72',
- 'PlusMinus;': '\xb1',
- 'plusmn': '\xb1',
- 'plusmn;': '\xb1',
- 'plussim;': '\u2a26',
- 'plustwo;': '\u2a27',
- 'pm;': '\xb1',
- 'Poincareplane;': '\u210c',
- 'pointint;': '\u2a15',
- 'Popf;': '\u2119',
- 'popf;': '\U0001d561',
- 'pound': '\xa3',
- 'pound;': '\xa3',
- 'Pr;': '\u2abb',
- 'pr;': '\u227a',
- 'prap;': '\u2ab7',
- 'prcue;': '\u227c',
- 'prE;': '\u2ab3',
- 'pre;': '\u2aaf',
- 'prec;': '\u227a',
- 'precapprox;': '\u2ab7',
- 'preccurlyeq;': '\u227c',
- 'Precedes;': '\u227a',
- 'PrecedesEqual;': '\u2aaf',
- 'PrecedesSlantEqual;': '\u227c',
- 'PrecedesTilde;': '\u227e',
- 'preceq;': '\u2aaf',
- 'precnapprox;': '\u2ab9',
- 'precneqq;': '\u2ab5',
- 'precnsim;': '\u22e8',
- 'precsim;': '\u227e',
- 'Prime;': '\u2033',
- 'prime;': '\u2032',
- 'primes;': '\u2119',
- 'prnap;': '\u2ab9',
- 'prnE;': '\u2ab5',
- 'prnsim;': '\u22e8',
- 'prod;': '\u220f',
- 'Product;': '\u220f',
- 'profalar;': '\u232e',
- 'profline;': '\u2312',
- 'profsurf;': '\u2313',
- 'prop;': '\u221d',
- 'Proportion;': '\u2237',
- 'Proportional;': '\u221d',
- 'propto;': '\u221d',
- 'prsim;': '\u227e',
- 'prurel;': '\u22b0',
- 'Pscr;': '\U0001d4ab',
- 'pscr;': '\U0001d4c5',
- 'Psi;': '\u03a8',
- 'psi;': '\u03c8',
- 'puncsp;': '\u2008',
- 'Qfr;': '\U0001d514',
- 'qfr;': '\U0001d52e',
- 'qint;': '\u2a0c',
- 'Qopf;': '\u211a',
- 'qopf;': '\U0001d562',
- 'qprime;': '\u2057',
- 'Qscr;': '\U0001d4ac',
- 'qscr;': '\U0001d4c6',
- 'quaternions;': '\u210d',
- 'quatint;': '\u2a16',
- 'quest;': '?',
- 'questeq;': '\u225f',
- 'QUOT': '"',
- 'quot': '"',
- 'QUOT;': '"',
- 'quot;': '"',
- 'rAarr;': '\u21db',
- 'race;': '\u223d\u0331',
- 'Racute;': '\u0154',
- 'racute;': '\u0155',
- 'radic;': '\u221a',
- 'raemptyv;': '\u29b3',
- 'Rang;': '\u27eb',
- 'rang;': '\u27e9',
- 'rangd;': '\u2992',
- 'range;': '\u29a5',
- 'rangle;': '\u27e9',
- 'raquo': '\xbb',
- 'raquo;': '\xbb',
- 'Rarr;': '\u21a0',
- 'rArr;': '\u21d2',
- 'rarr;': '\u2192',
- 'rarrap;': '\u2975',
- 'rarrb;': '\u21e5',
- 'rarrbfs;': '\u2920',
- 'rarrc;': '\u2933',
- 'rarrfs;': '\u291e',
- 'rarrhk;': '\u21aa',
- 'rarrlp;': '\u21ac',
- 'rarrpl;': '\u2945',
- 'rarrsim;': '\u2974',
- 'Rarrtl;': '\u2916',
- 'rarrtl;': '\u21a3',
- 'rarrw;': '\u219d',
- 'rAtail;': '\u291c',
- 'ratail;': '\u291a',
- 'ratio;': '\u2236',
- 'rationals;': '\u211a',
- 'RBarr;': '\u2910',
- 'rBarr;': '\u290f',
- 'rbarr;': '\u290d',
- 'rbbrk;': '\u2773',
- 'rbrace;': '}',
- 'rbrack;': ']',
- 'rbrke;': '\u298c',
- 'rbrksld;': '\u298e',
- 'rbrkslu;': '\u2990',
- 'Rcaron;': '\u0158',
- 'rcaron;': '\u0159',
- 'Rcedil;': '\u0156',
- 'rcedil;': '\u0157',
- 'rceil;': '\u2309',
- 'rcub;': '}',
- 'Rcy;': '\u0420',
- 'rcy;': '\u0440',
- 'rdca;': '\u2937',
- 'rdldhar;': '\u2969',
- 'rdquo;': '\u201d',
- 'rdquor;': '\u201d',
- 'rdsh;': '\u21b3',
- 'Re;': '\u211c',
- 'real;': '\u211c',
- 'realine;': '\u211b',
- 'realpart;': '\u211c',
- 'reals;': '\u211d',
- 'rect;': '\u25ad',
- 'REG': '\xae',
- 'reg': '\xae',
- 'REG;': '\xae',
- 'reg;': '\xae',
- 'ReverseElement;': '\u220b',
- 'ReverseEquilibrium;': '\u21cb',
- 'ReverseUpEquilibrium;': '\u296f',
- 'rfisht;': '\u297d',
- 'rfloor;': '\u230b',
- 'Rfr;': '\u211c',
- 'rfr;': '\U0001d52f',
- 'rHar;': '\u2964',
- 'rhard;': '\u21c1',
- 'rharu;': '\u21c0',
- 'rharul;': '\u296c',
- 'Rho;': '\u03a1',
- 'rho;': '\u03c1',
- 'rhov;': '\u03f1',
- 'RightAngleBracket;': '\u27e9',
- 'RightArrow;': '\u2192',
- 'Rightarrow;': '\u21d2',
- 'rightarrow;': '\u2192',
- 'RightArrowBar;': '\u21e5',
- 'RightArrowLeftArrow;': '\u21c4',
- 'rightarrowtail;': '\u21a3',
- 'RightCeiling;': '\u2309',
- 'RightDoubleBracket;': '\u27e7',
- 'RightDownTeeVector;': '\u295d',
- 'RightDownVector;': '\u21c2',
- 'RightDownVectorBar;': '\u2955',
- 'RightFloor;': '\u230b',
- 'rightharpoondown;': '\u21c1',
- 'rightharpoonup;': '\u21c0',
- 'rightleftarrows;': '\u21c4',
- 'rightleftharpoons;': '\u21cc',
- 'rightrightarrows;': '\u21c9',
- 'rightsquigarrow;': '\u219d',
- 'RightTee;': '\u22a2',
- 'RightTeeArrow;': '\u21a6',
- 'RightTeeVector;': '\u295b',
- 'rightthreetimes;': '\u22cc',
- 'RightTriangle;': '\u22b3',
- 'RightTriangleBar;': '\u29d0',
- 'RightTriangleEqual;': '\u22b5',
- 'RightUpDownVector;': '\u294f',
- 'RightUpTeeVector;': '\u295c',
- 'RightUpVector;': '\u21be',
- 'RightUpVectorBar;': '\u2954',
- 'RightVector;': '\u21c0',
- 'RightVectorBar;': '\u2953',
- 'ring;': '\u02da',
- 'risingdotseq;': '\u2253',
- 'rlarr;': '\u21c4',
- 'rlhar;': '\u21cc',
- 'rlm;': '\u200f',
- 'rmoust;': '\u23b1',
- 'rmoustache;': '\u23b1',
- 'rnmid;': '\u2aee',
- 'roang;': '\u27ed',
- 'roarr;': '\u21fe',
- 'robrk;': '\u27e7',
- 'ropar;': '\u2986',
- 'Ropf;': '\u211d',
- 'ropf;': '\U0001d563',
- 'roplus;': '\u2a2e',
- 'rotimes;': '\u2a35',
- 'RoundImplies;': '\u2970',
- 'rpar;': ')',
- 'rpargt;': '\u2994',
- 'rppolint;': '\u2a12',
- 'rrarr;': '\u21c9',
- 'Rrightarrow;': '\u21db',
- 'rsaquo;': '\u203a',
- 'Rscr;': '\u211b',
- 'rscr;': '\U0001d4c7',
- 'Rsh;': '\u21b1',
- 'rsh;': '\u21b1',
- 'rsqb;': ']',
- 'rsquo;': '\u2019',
- 'rsquor;': '\u2019',
- 'rthree;': '\u22cc',
- 'rtimes;': '\u22ca',
- 'rtri;': '\u25b9',
- 'rtrie;': '\u22b5',
- 'rtrif;': '\u25b8',
- 'rtriltri;': '\u29ce',
- 'RuleDelayed;': '\u29f4',
- 'ruluhar;': '\u2968',
- 'rx;': '\u211e',
- 'Sacute;': '\u015a',
- 'sacute;': '\u015b',
- 'sbquo;': '\u201a',
- 'Sc;': '\u2abc',
- 'sc;': '\u227b',
- 'scap;': '\u2ab8',
- 'Scaron;': '\u0160',
- 'scaron;': '\u0161',
- 'sccue;': '\u227d',
- 'scE;': '\u2ab4',
- 'sce;': '\u2ab0',
- 'Scedil;': '\u015e',
- 'scedil;': '\u015f',
- 'Scirc;': '\u015c',
- 'scirc;': '\u015d',
- 'scnap;': '\u2aba',
- 'scnE;': '\u2ab6',
- 'scnsim;': '\u22e9',
- 'scpolint;': '\u2a13',
- 'scsim;': '\u227f',
- 'Scy;': '\u0421',
- 'scy;': '\u0441',
- 'sdot;': '\u22c5',
- 'sdotb;': '\u22a1',
- 'sdote;': '\u2a66',
- 'searhk;': '\u2925',
- 'seArr;': '\u21d8',
- 'searr;': '\u2198',
- 'searrow;': '\u2198',
- 'sect': '\xa7',
- 'sect;': '\xa7',
- 'semi;': ';',
- 'seswar;': '\u2929',
- 'setminus;': '\u2216',
- 'setmn;': '\u2216',
- 'sext;': '\u2736',
- 'Sfr;': '\U0001d516',
- 'sfr;': '\U0001d530',
- 'sfrown;': '\u2322',
- 'sharp;': '\u266f',
- 'SHCHcy;': '\u0429',
- 'shchcy;': '\u0449',
- 'SHcy;': '\u0428',
- 'shcy;': '\u0448',
- 'ShortDownArrow;': '\u2193',
- 'ShortLeftArrow;': '\u2190',
- 'shortmid;': '\u2223',
- 'shortparallel;': '\u2225',
- 'ShortRightArrow;': '\u2192',
- 'ShortUpArrow;': '\u2191',
- 'shy': '\xad',
- 'shy;': '\xad',
- 'Sigma;': '\u03a3',
- 'sigma;': '\u03c3',
- 'sigmaf;': '\u03c2',
- 'sigmav;': '\u03c2',
- 'sim;': '\u223c',
- 'simdot;': '\u2a6a',
- 'sime;': '\u2243',
- 'simeq;': '\u2243',
- 'simg;': '\u2a9e',
- 'simgE;': '\u2aa0',
- 'siml;': '\u2a9d',
- 'simlE;': '\u2a9f',
- 'simne;': '\u2246',
- 'simplus;': '\u2a24',
- 'simrarr;': '\u2972',
- 'slarr;': '\u2190',
- 'SmallCircle;': '\u2218',
- 'smallsetminus;': '\u2216',
- 'smashp;': '\u2a33',
- 'smeparsl;': '\u29e4',
- 'smid;': '\u2223',
- 'smile;': '\u2323',
- 'smt;': '\u2aaa',
- 'smte;': '\u2aac',
- 'smtes;': '\u2aac\ufe00',
- 'SOFTcy;': '\u042c',
- 'softcy;': '\u044c',
- 'sol;': '/',
- 'solb;': '\u29c4',
- 'solbar;': '\u233f',
- 'Sopf;': '\U0001d54a',
- 'sopf;': '\U0001d564',
- 'spades;': '\u2660',
- 'spadesuit;': '\u2660',
- 'spar;': '\u2225',
- 'sqcap;': '\u2293',
- 'sqcaps;': '\u2293\ufe00',
- 'sqcup;': '\u2294',
- 'sqcups;': '\u2294\ufe00',
- 'Sqrt;': '\u221a',
- 'sqsub;': '\u228f',
- 'sqsube;': '\u2291',
- 'sqsubset;': '\u228f',
- 'sqsubseteq;': '\u2291',
- 'sqsup;': '\u2290',
- 'sqsupe;': '\u2292',
- 'sqsupset;': '\u2290',
- 'sqsupseteq;': '\u2292',
- 'squ;': '\u25a1',
- 'Square;': '\u25a1',
- 'square;': '\u25a1',
- 'SquareIntersection;': '\u2293',
- 'SquareSubset;': '\u228f',
- 'SquareSubsetEqual;': '\u2291',
- 'SquareSuperset;': '\u2290',
- 'SquareSupersetEqual;': '\u2292',
- 'SquareUnion;': '\u2294',
- 'squarf;': '\u25aa',
- 'squf;': '\u25aa',
- 'srarr;': '\u2192',
- 'Sscr;': '\U0001d4ae',
- 'sscr;': '\U0001d4c8',
- 'ssetmn;': '\u2216',
- 'ssmile;': '\u2323',
- 'sstarf;': '\u22c6',
- 'Star;': '\u22c6',
- 'star;': '\u2606',
- 'starf;': '\u2605',
- 'straightepsilon;': '\u03f5',
- 'straightphi;': '\u03d5',
- 'strns;': '\xaf',
- 'Sub;': '\u22d0',
- 'sub;': '\u2282',
- 'subdot;': '\u2abd',
- 'subE;': '\u2ac5',
- 'sube;': '\u2286',
- 'subedot;': '\u2ac3',
- 'submult;': '\u2ac1',
- 'subnE;': '\u2acb',
- 'subne;': '\u228a',
- 'subplus;': '\u2abf',
- 'subrarr;': '\u2979',
- 'Subset;': '\u22d0',
- 'subset;': '\u2282',
- 'subseteq;': '\u2286',
- 'subseteqq;': '\u2ac5',
- 'SubsetEqual;': '\u2286',
- 'subsetneq;': '\u228a',
- 'subsetneqq;': '\u2acb',
- 'subsim;': '\u2ac7',
- 'subsub;': '\u2ad5',
- 'subsup;': '\u2ad3',
- 'succ;': '\u227b',
- 'succapprox;': '\u2ab8',
- 'succcurlyeq;': '\u227d',
- 'Succeeds;': '\u227b',
- 'SucceedsEqual;': '\u2ab0',
- 'SucceedsSlantEqual;': '\u227d',
- 'SucceedsTilde;': '\u227f',
- 'succeq;': '\u2ab0',
- 'succnapprox;': '\u2aba',
- 'succneqq;': '\u2ab6',
- 'succnsim;': '\u22e9',
- 'succsim;': '\u227f',
- 'SuchThat;': '\u220b',
- 'Sum;': '\u2211',
- 'sum;': '\u2211',
- 'sung;': '\u266a',
- 'sup1': '\xb9',
- 'sup1;': '\xb9',
- 'sup2': '\xb2',
- 'sup2;': '\xb2',
- 'sup3': '\xb3',
- 'sup3;': '\xb3',
- 'Sup;': '\u22d1',
- 'sup;': '\u2283',
- 'supdot;': '\u2abe',
- 'supdsub;': '\u2ad8',
- 'supE;': '\u2ac6',
- 'supe;': '\u2287',
- 'supedot;': '\u2ac4',
- 'Superset;': '\u2283',
- 'SupersetEqual;': '\u2287',
- 'suphsol;': '\u27c9',
- 'suphsub;': '\u2ad7',
- 'suplarr;': '\u297b',
- 'supmult;': '\u2ac2',
- 'supnE;': '\u2acc',
- 'supne;': '\u228b',
- 'supplus;': '\u2ac0',
- 'Supset;': '\u22d1',
- 'supset;': '\u2283',
- 'supseteq;': '\u2287',
- 'supseteqq;': '\u2ac6',
- 'supsetneq;': '\u228b',
- 'supsetneqq;': '\u2acc',
- 'supsim;': '\u2ac8',
- 'supsub;': '\u2ad4',
- 'supsup;': '\u2ad6',
- 'swarhk;': '\u2926',
- 'swArr;': '\u21d9',
- 'swarr;': '\u2199',
- 'swarrow;': '\u2199',
- 'swnwar;': '\u292a',
- 'szlig': '\xdf',
- 'szlig;': '\xdf',
- 'Tab;': '\t',
- 'target;': '\u2316',
- 'Tau;': '\u03a4',
- 'tau;': '\u03c4',
- 'tbrk;': '\u23b4',
- 'Tcaron;': '\u0164',
- 'tcaron;': '\u0165',
- 'Tcedil;': '\u0162',
- 'tcedil;': '\u0163',
- 'Tcy;': '\u0422',
- 'tcy;': '\u0442',
- 'tdot;': '\u20db',
- 'telrec;': '\u2315',
- 'Tfr;': '\U0001d517',
- 'tfr;': '\U0001d531',
- 'there4;': '\u2234',
- 'Therefore;': '\u2234',
- 'therefore;': '\u2234',
- 'Theta;': '\u0398',
- 'theta;': '\u03b8',
- 'thetasym;': '\u03d1',
- 'thetav;': '\u03d1',
- 'thickapprox;': '\u2248',
- 'thicksim;': '\u223c',
- 'ThickSpace;': '\u205f\u200a',
- 'thinsp;': '\u2009',
- 'ThinSpace;': '\u2009',
- 'thkap;': '\u2248',
- 'thksim;': '\u223c',
- 'THORN': '\xde',
- 'thorn': '\xfe',
- 'THORN;': '\xde',
- 'thorn;': '\xfe',
- 'Tilde;': '\u223c',
- 'tilde;': '\u02dc',
- 'TildeEqual;': '\u2243',
- 'TildeFullEqual;': '\u2245',
- 'TildeTilde;': '\u2248',
- 'times': '\xd7',
- 'times;': '\xd7',
- 'timesb;': '\u22a0',
- 'timesbar;': '\u2a31',
- 'timesd;': '\u2a30',
- 'tint;': '\u222d',
- 'toea;': '\u2928',
- 'top;': '\u22a4',
- 'topbot;': '\u2336',
- 'topcir;': '\u2af1',
- 'Topf;': '\U0001d54b',
- 'topf;': '\U0001d565',
- 'topfork;': '\u2ada',
- 'tosa;': '\u2929',
- 'tprime;': '\u2034',
- 'TRADE;': '\u2122',
- 'trade;': '\u2122',
- 'triangle;': '\u25b5',
- 'triangledown;': '\u25bf',
- 'triangleleft;': '\u25c3',
- 'trianglelefteq;': '\u22b4',
- 'triangleq;': '\u225c',
- 'triangleright;': '\u25b9',
- 'trianglerighteq;': '\u22b5',
- 'tridot;': '\u25ec',
- 'trie;': '\u225c',
- 'triminus;': '\u2a3a',
- 'TripleDot;': '\u20db',
- 'triplus;': '\u2a39',
- 'trisb;': '\u29cd',
- 'tritime;': '\u2a3b',
- 'trpezium;': '\u23e2',
- 'Tscr;': '\U0001d4af',
- 'tscr;': '\U0001d4c9',
- 'TScy;': '\u0426',
- 'tscy;': '\u0446',
- 'TSHcy;': '\u040b',
- 'tshcy;': '\u045b',
- 'Tstrok;': '\u0166',
- 'tstrok;': '\u0167',
- 'twixt;': '\u226c',
- 'twoheadleftarrow;': '\u219e',
- 'twoheadrightarrow;': '\u21a0',
- 'Uacute': '\xda',
- 'uacute': '\xfa',
- 'Uacute;': '\xda',
- 'uacute;': '\xfa',
- 'Uarr;': '\u219f',
- 'uArr;': '\u21d1',
- 'uarr;': '\u2191',
- 'Uarrocir;': '\u2949',
- 'Ubrcy;': '\u040e',
- 'ubrcy;': '\u045e',
- 'Ubreve;': '\u016c',
- 'ubreve;': '\u016d',
- 'Ucirc': '\xdb',
- 'ucirc': '\xfb',
- 'Ucirc;': '\xdb',
- 'ucirc;': '\xfb',
- 'Ucy;': '\u0423',
- 'ucy;': '\u0443',
- 'udarr;': '\u21c5',
- 'Udblac;': '\u0170',
- 'udblac;': '\u0171',
- 'udhar;': '\u296e',
- 'ufisht;': '\u297e',
- 'Ufr;': '\U0001d518',
- 'ufr;': '\U0001d532',
- 'Ugrave': '\xd9',
- 'ugrave': '\xf9',
- 'Ugrave;': '\xd9',
- 'ugrave;': '\xf9',
- 'uHar;': '\u2963',
- 'uharl;': '\u21bf',
- 'uharr;': '\u21be',
- 'uhblk;': '\u2580',
- 'ulcorn;': '\u231c',
- 'ulcorner;': '\u231c',
- 'ulcrop;': '\u230f',
- 'ultri;': '\u25f8',
- 'Umacr;': '\u016a',
- 'umacr;': '\u016b',
- 'uml': '\xa8',
- 'uml;': '\xa8',
- 'UnderBar;': '_',
- 'UnderBrace;': '\u23df',
- 'UnderBracket;': '\u23b5',
- 'UnderParenthesis;': '\u23dd',
- 'Union;': '\u22c3',
- 'UnionPlus;': '\u228e',
- 'Uogon;': '\u0172',
- 'uogon;': '\u0173',
- 'Uopf;': '\U0001d54c',
- 'uopf;': '\U0001d566',
- 'UpArrow;': '\u2191',
- 'Uparrow;': '\u21d1',
- 'uparrow;': '\u2191',
- 'UpArrowBar;': '\u2912',
- 'UpArrowDownArrow;': '\u21c5',
- 'UpDownArrow;': '\u2195',
- 'Updownarrow;': '\u21d5',
- 'updownarrow;': '\u2195',
- 'UpEquilibrium;': '\u296e',
- 'upharpoonleft;': '\u21bf',
- 'upharpoonright;': '\u21be',
- 'uplus;': '\u228e',
- 'UpperLeftArrow;': '\u2196',
- 'UpperRightArrow;': '\u2197',
- 'Upsi;': '\u03d2',
- 'upsi;': '\u03c5',
- 'upsih;': '\u03d2',
- 'Upsilon;': '\u03a5',
- 'upsilon;': '\u03c5',
- 'UpTee;': '\u22a5',
- 'UpTeeArrow;': '\u21a5',
- 'upuparrows;': '\u21c8',
- 'urcorn;': '\u231d',
- 'urcorner;': '\u231d',
- 'urcrop;': '\u230e',
- 'Uring;': '\u016e',
- 'uring;': '\u016f',
- 'urtri;': '\u25f9',
- 'Uscr;': '\U0001d4b0',
- 'uscr;': '\U0001d4ca',
- 'utdot;': '\u22f0',
- 'Utilde;': '\u0168',
- 'utilde;': '\u0169',
- 'utri;': '\u25b5',
- 'utrif;': '\u25b4',
- 'uuarr;': '\u21c8',
- 'Uuml': '\xdc',
- 'uuml': '\xfc',
- 'Uuml;': '\xdc',
- 'uuml;': '\xfc',
- 'uwangle;': '\u29a7',
- 'vangrt;': '\u299c',
- 'varepsilon;': '\u03f5',
- 'varkappa;': '\u03f0',
- 'varnothing;': '\u2205',
- 'varphi;': '\u03d5',
- 'varpi;': '\u03d6',
- 'varpropto;': '\u221d',
- 'vArr;': '\u21d5',
- 'varr;': '\u2195',
- 'varrho;': '\u03f1',
- 'varsigma;': '\u03c2',
- 'varsubsetneq;': '\u228a\ufe00',
- 'varsubsetneqq;': '\u2acb\ufe00',
- 'varsupsetneq;': '\u228b\ufe00',
- 'varsupsetneqq;': '\u2acc\ufe00',
- 'vartheta;': '\u03d1',
- 'vartriangleleft;': '\u22b2',
- 'vartriangleright;': '\u22b3',
- 'Vbar;': '\u2aeb',
- 'vBar;': '\u2ae8',
- 'vBarv;': '\u2ae9',
- 'Vcy;': '\u0412',
- 'vcy;': '\u0432',
- 'VDash;': '\u22ab',
- 'Vdash;': '\u22a9',
- 'vDash;': '\u22a8',
- 'vdash;': '\u22a2',
- 'Vdashl;': '\u2ae6',
- 'Vee;': '\u22c1',
- 'vee;': '\u2228',
- 'veebar;': '\u22bb',
- 'veeeq;': '\u225a',
- 'vellip;': '\u22ee',
- 'Verbar;': '\u2016',
- 'verbar;': '|',
- 'Vert;': '\u2016',
- 'vert;': '|',
- 'VerticalBar;': '\u2223',
- 'VerticalLine;': '|',
- 'VerticalSeparator;': '\u2758',
- 'VerticalTilde;': '\u2240',
- 'VeryThinSpace;': '\u200a',
- 'Vfr;': '\U0001d519',
- 'vfr;': '\U0001d533',
- 'vltri;': '\u22b2',
- 'vnsub;': '\u2282\u20d2',
- 'vnsup;': '\u2283\u20d2',
- 'Vopf;': '\U0001d54d',
- 'vopf;': '\U0001d567',
- 'vprop;': '\u221d',
- 'vrtri;': '\u22b3',
- 'Vscr;': '\U0001d4b1',
- 'vscr;': '\U0001d4cb',
- 'vsubnE;': '\u2acb\ufe00',
- 'vsubne;': '\u228a\ufe00',
- 'vsupnE;': '\u2acc\ufe00',
- 'vsupne;': '\u228b\ufe00',
- 'Vvdash;': '\u22aa',
- 'vzigzag;': '\u299a',
- 'Wcirc;': '\u0174',
- 'wcirc;': '\u0175',
- 'wedbar;': '\u2a5f',
- 'Wedge;': '\u22c0',
- 'wedge;': '\u2227',
- 'wedgeq;': '\u2259',
- 'weierp;': '\u2118',
- 'Wfr;': '\U0001d51a',
- 'wfr;': '\U0001d534',
- 'Wopf;': '\U0001d54e',
- 'wopf;': '\U0001d568',
- 'wp;': '\u2118',
- 'wr;': '\u2240',
- 'wreath;': '\u2240',
- 'Wscr;': '\U0001d4b2',
- 'wscr;': '\U0001d4cc',
- 'xcap;': '\u22c2',
- 'xcirc;': '\u25ef',
- 'xcup;': '\u22c3',
- 'xdtri;': '\u25bd',
- 'Xfr;': '\U0001d51b',
- 'xfr;': '\U0001d535',
- 'xhArr;': '\u27fa',
- 'xharr;': '\u27f7',
- 'Xi;': '\u039e',
- 'xi;': '\u03be',
- 'xlArr;': '\u27f8',
- 'xlarr;': '\u27f5',
- 'xmap;': '\u27fc',
- 'xnis;': '\u22fb',
- 'xodot;': '\u2a00',
- 'Xopf;': '\U0001d54f',
- 'xopf;': '\U0001d569',
- 'xoplus;': '\u2a01',
- 'xotime;': '\u2a02',
- 'xrArr;': '\u27f9',
- 'xrarr;': '\u27f6',
- 'Xscr;': '\U0001d4b3',
- 'xscr;': '\U0001d4cd',
- 'xsqcup;': '\u2a06',
- 'xuplus;': '\u2a04',
- 'xutri;': '\u25b3',
- 'xvee;': '\u22c1',
- 'xwedge;': '\u22c0',
- 'Yacute': '\xdd',
- 'yacute': '\xfd',
- 'Yacute;': '\xdd',
- 'yacute;': '\xfd',
- 'YAcy;': '\u042f',
- 'yacy;': '\u044f',
- 'Ycirc;': '\u0176',
- 'ycirc;': '\u0177',
- 'Ycy;': '\u042b',
- 'ycy;': '\u044b',
- 'yen': '\xa5',
- 'yen;': '\xa5',
- 'Yfr;': '\U0001d51c',
- 'yfr;': '\U0001d536',
- 'YIcy;': '\u0407',
- 'yicy;': '\u0457',
- 'Yopf;': '\U0001d550',
- 'yopf;': '\U0001d56a',
- 'Yscr;': '\U0001d4b4',
- 'yscr;': '\U0001d4ce',
- 'YUcy;': '\u042e',
- 'yucy;': '\u044e',
- 'yuml': '\xff',
- 'Yuml;': '\u0178',
- 'yuml;': '\xff',
- 'Zacute;': '\u0179',
- 'zacute;': '\u017a',
- 'Zcaron;': '\u017d',
- 'zcaron;': '\u017e',
- 'Zcy;': '\u0417',
- 'zcy;': '\u0437',
- 'Zdot;': '\u017b',
- 'zdot;': '\u017c',
- 'zeetrf;': '\u2128',
- 'ZeroWidthSpace;': '\u200b',
- 'Zeta;': '\u0396',
- 'zeta;': '\u03b6',
- 'Zfr;': '\u2128',
- 'zfr;': '\U0001d537',
- 'ZHcy;': '\u0416',
- 'zhcy;': '\u0436',
- 'zigrarr;': '\u21dd',
- 'Zopf;': '\u2124',
- 'zopf;': '\U0001d56b',
- 'Zscr;': '\U0001d4b5',
- 'zscr;': '\U0001d4cf',
- 'zwj;': '\u200d',
- 'zwnj;': '\u200c',
+ "Aacute": "\xc1",
+ "aacute": "\xe1",
+ "Aacute;": "\xc1",
+ "aacute;": "\xe1",
+ "Abreve;": "\u0102",
+ "abreve;": "\u0103",
+ "ac;": "\u223e",
+ "acd;": "\u223f",
+ "acE;": "\u223e\u0333",
+ "Acirc": "\xc2",
+ "acirc": "\xe2",
+ "Acirc;": "\xc2",
+ "acirc;": "\xe2",
+ "acute": "\xb4",
+ "acute;": "\xb4",
+ "Acy;": "\u0410",
+ "acy;": "\u0430",
+ "AElig": "\xc6",
+ "aelig": "\xe6",
+ "AElig;": "\xc6",
+ "aelig;": "\xe6",
+ "af;": "\u2061",
+ "Afr;": "\U0001d504",
+ "afr;": "\U0001d51e",
+ "Agrave": "\xc0",
+ "agrave": "\xe0",
+ "Agrave;": "\xc0",
+ "agrave;": "\xe0",
+ "alefsym;": "\u2135",
+ "aleph;": "\u2135",
+ "Alpha;": "\u0391",
+ "alpha;": "\u03b1",
+ "Amacr;": "\u0100",
+ "amacr;": "\u0101",
+ "amalg;": "\u2a3f",
+ "AMP": "&",
+ "amp": "&",
+ "AMP;": "&",
+ "amp;": "&",
+ "And;": "\u2a53",
+ "and;": "\u2227",
+ "andand;": "\u2a55",
+ "andd;": "\u2a5c",
+ "andslope;": "\u2a58",
+ "andv;": "\u2a5a",
+ "ang;": "\u2220",
+ "ange;": "\u29a4",
+ "angle;": "\u2220",
+ "angmsd;": "\u2221",
+ "angmsdaa;": "\u29a8",
+ "angmsdab;": "\u29a9",
+ "angmsdac;": "\u29aa",
+ "angmsdad;": "\u29ab",
+ "angmsdae;": "\u29ac",
+ "angmsdaf;": "\u29ad",
+ "angmsdag;": "\u29ae",
+ "angmsdah;": "\u29af",
+ "angrt;": "\u221f",
+ "angrtvb;": "\u22be",
+ "angrtvbd;": "\u299d",
+ "angsph;": "\u2222",
+ "angst;": "\xc5",
+ "angzarr;": "\u237c",
+ "Aogon;": "\u0104",
+ "aogon;": "\u0105",
+ "Aopf;": "\U0001d538",
+ "aopf;": "\U0001d552",
+ "ap;": "\u2248",
+ "apacir;": "\u2a6f",
+ "apE;": "\u2a70",
+ "ape;": "\u224a",
+ "apid;": "\u224b",
+ "apos;": "'",
+ "ApplyFunction;": "\u2061",
+ "approx;": "\u2248",
+ "approxeq;": "\u224a",
+ "Aring": "\xc5",
+ "aring": "\xe5",
+ "Aring;": "\xc5",
+ "aring;": "\xe5",
+ "Ascr;": "\U0001d49c",
+ "ascr;": "\U0001d4b6",
+ "Assign;": "\u2254",
+ "ast;": "*",
+ "asymp;": "\u2248",
+ "asympeq;": "\u224d",
+ "Atilde": "\xc3",
+ "atilde": "\xe3",
+ "Atilde;": "\xc3",
+ "atilde;": "\xe3",
+ "Auml": "\xc4",
+ "auml": "\xe4",
+ "Auml;": "\xc4",
+ "auml;": "\xe4",
+ "awconint;": "\u2233",
+ "awint;": "\u2a11",
+ "backcong;": "\u224c",
+ "backepsilon;": "\u03f6",
+ "backprime;": "\u2035",
+ "backsim;": "\u223d",
+ "backsimeq;": "\u22cd",
+ "Backslash;": "\u2216",
+ "Barv;": "\u2ae7",
+ "barvee;": "\u22bd",
+ "Barwed;": "\u2306",
+ "barwed;": "\u2305",
+ "barwedge;": "\u2305",
+ "bbrk;": "\u23b5",
+ "bbrktbrk;": "\u23b6",
+ "bcong;": "\u224c",
+ "Bcy;": "\u0411",
+ "bcy;": "\u0431",
+ "bdquo;": "\u201e",
+ "becaus;": "\u2235",
+ "Because;": "\u2235",
+ "because;": "\u2235",
+ "bemptyv;": "\u29b0",
+ "bepsi;": "\u03f6",
+ "bernou;": "\u212c",
+ "Bernoullis;": "\u212c",
+ "Beta;": "\u0392",
+ "beta;": "\u03b2",
+ "beth;": "\u2136",
+ "between;": "\u226c",
+ "Bfr;": "\U0001d505",
+ "bfr;": "\U0001d51f",
+ "bigcap;": "\u22c2",
+ "bigcirc;": "\u25ef",
+ "bigcup;": "\u22c3",
+ "bigodot;": "\u2a00",
+ "bigoplus;": "\u2a01",
+ "bigotimes;": "\u2a02",
+ "bigsqcup;": "\u2a06",
+ "bigstar;": "\u2605",
+ "bigtriangledown;": "\u25bd",
+ "bigtriangleup;": "\u25b3",
+ "biguplus;": "\u2a04",
+ "bigvee;": "\u22c1",
+ "bigwedge;": "\u22c0",
+ "bkarow;": "\u290d",
+ "blacklozenge;": "\u29eb",
+ "blacksquare;": "\u25aa",
+ "blacktriangle;": "\u25b4",
+ "blacktriangledown;": "\u25be",
+ "blacktriangleleft;": "\u25c2",
+ "blacktriangleright;": "\u25b8",
+ "blank;": "\u2423",
+ "blk12;": "\u2592",
+ "blk14;": "\u2591",
+ "blk34;": "\u2593",
+ "block;": "\u2588",
+ "bne;": "=\u20e5",
+ "bnequiv;": "\u2261\u20e5",
+ "bNot;": "\u2aed",
+ "bnot;": "\u2310",
+ "Bopf;": "\U0001d539",
+ "bopf;": "\U0001d553",
+ "bot;": "\u22a5",
+ "bottom;": "\u22a5",
+ "bowtie;": "\u22c8",
+ "boxbox;": "\u29c9",
+ "boxDL;": "\u2557",
+ "boxDl;": "\u2556",
+ "boxdL;": "\u2555",
+ "boxdl;": "\u2510",
+ "boxDR;": "\u2554",
+ "boxDr;": "\u2553",
+ "boxdR;": "\u2552",
+ "boxdr;": "\u250c",
+ "boxH;": "\u2550",
+ "boxh;": "\u2500",
+ "boxHD;": "\u2566",
+ "boxHd;": "\u2564",
+ "boxhD;": "\u2565",
+ "boxhd;": "\u252c",
+ "boxHU;": "\u2569",
+ "boxHu;": "\u2567",
+ "boxhU;": "\u2568",
+ "boxhu;": "\u2534",
+ "boxminus;": "\u229f",
+ "boxplus;": "\u229e",
+ "boxtimes;": "\u22a0",
+ "boxUL;": "\u255d",
+ "boxUl;": "\u255c",
+ "boxuL;": "\u255b",
+ "boxul;": "\u2518",
+ "boxUR;": "\u255a",
+ "boxUr;": "\u2559",
+ "boxuR;": "\u2558",
+ "boxur;": "\u2514",
+ "boxV;": "\u2551",
+ "boxv;": "\u2502",
+ "boxVH;": "\u256c",
+ "boxVh;": "\u256b",
+ "boxvH;": "\u256a",
+ "boxvh;": "\u253c",
+ "boxVL;": "\u2563",
+ "boxVl;": "\u2562",
+ "boxvL;": "\u2561",
+ "boxvl;": "\u2524",
+ "boxVR;": "\u2560",
+ "boxVr;": "\u255f",
+ "boxvR;": "\u255e",
+ "boxvr;": "\u251c",
+ "bprime;": "\u2035",
+ "Breve;": "\u02d8",
+ "breve;": "\u02d8",
+ "brvbar": "\xa6",
+ "brvbar;": "\xa6",
+ "Bscr;": "\u212c",
+ "bscr;": "\U0001d4b7",
+ "bsemi;": "\u204f",
+ "bsim;": "\u223d",
+ "bsime;": "\u22cd",
+ "bsol;": "\\",
+ "bsolb;": "\u29c5",
+ "bsolhsub;": "\u27c8",
+ "bull;": "\u2022",
+ "bullet;": "\u2022",
+ "bump;": "\u224e",
+ "bumpE;": "\u2aae",
+ "bumpe;": "\u224f",
+ "Bumpeq;": "\u224e",
+ "bumpeq;": "\u224f",
+ "Cacute;": "\u0106",
+ "cacute;": "\u0107",
+ "Cap;": "\u22d2",
+ "cap;": "\u2229",
+ "capand;": "\u2a44",
+ "capbrcup;": "\u2a49",
+ "capcap;": "\u2a4b",
+ "capcup;": "\u2a47",
+ "capdot;": "\u2a40",
+ "CapitalDifferentialD;": "\u2145",
+ "caps;": "\u2229\ufe00",
+ "caret;": "\u2041",
+ "caron;": "\u02c7",
+ "Cayleys;": "\u212d",
+ "ccaps;": "\u2a4d",
+ "Ccaron;": "\u010c",
+ "ccaron;": "\u010d",
+ "Ccedil": "\xc7",
+ "ccedil": "\xe7",
+ "Ccedil;": "\xc7",
+ "ccedil;": "\xe7",
+ "Ccirc;": "\u0108",
+ "ccirc;": "\u0109",
+ "Cconint;": "\u2230",
+ "ccups;": "\u2a4c",
+ "ccupssm;": "\u2a50",
+ "Cdot;": "\u010a",
+ "cdot;": "\u010b",
+ "cedil": "\xb8",
+ "cedil;": "\xb8",
+ "Cedilla;": "\xb8",
+ "cemptyv;": "\u29b2",
+ "cent": "\xa2",
+ "cent;": "\xa2",
+ "CenterDot;": "\xb7",
+ "centerdot;": "\xb7",
+ "Cfr;": "\u212d",
+ "cfr;": "\U0001d520",
+ "CHcy;": "\u0427",
+ "chcy;": "\u0447",
+ "check;": "\u2713",
+ "checkmark;": "\u2713",
+ "Chi;": "\u03a7",
+ "chi;": "\u03c7",
+ "cir;": "\u25cb",
+ "circ;": "\u02c6",
+ "circeq;": "\u2257",
+ "circlearrowleft;": "\u21ba",
+ "circlearrowright;": "\u21bb",
+ "circledast;": "\u229b",
+ "circledcirc;": "\u229a",
+ "circleddash;": "\u229d",
+ "CircleDot;": "\u2299",
+ "circledR;": "\xae",
+ "circledS;": "\u24c8",
+ "CircleMinus;": "\u2296",
+ "CirclePlus;": "\u2295",
+ "CircleTimes;": "\u2297",
+ "cirE;": "\u29c3",
+ "cire;": "\u2257",
+ "cirfnint;": "\u2a10",
+ "cirmid;": "\u2aef",
+ "cirscir;": "\u29c2",
+ "ClockwiseContourIntegral;": "\u2232",
+ "CloseCurlyDoubleQuote;": "\u201d",
+ "CloseCurlyQuote;": "\u2019",
+ "clubs;": "\u2663",
+ "clubsuit;": "\u2663",
+ "Colon;": "\u2237",
+ "colon;": ":",
+ "Colone;": "\u2a74",
+ "colone;": "\u2254",
+ "coloneq;": "\u2254",
+ "comma;": ",",
+ "commat;": "@",
+ "comp;": "\u2201",
+ "compfn;": "\u2218",
+ "complement;": "\u2201",
+ "complexes;": "\u2102",
+ "cong;": "\u2245",
+ "congdot;": "\u2a6d",
+ "Congruent;": "\u2261",
+ "Conint;": "\u222f",
+ "conint;": "\u222e",
+ "ContourIntegral;": "\u222e",
+ "Copf;": "\u2102",
+ "copf;": "\U0001d554",
+ "coprod;": "\u2210",
+ "Coproduct;": "\u2210",
+ "COPY": "\xa9",
+ "copy": "\xa9",
+ "COPY;": "\xa9",
+ "copy;": "\xa9",
+ "copysr;": "\u2117",
+ "CounterClockwiseContourIntegral;": "\u2233",
+ "crarr;": "\u21b5",
+ "Cross;": "\u2a2f",
+ "cross;": "\u2717",
+ "Cscr;": "\U0001d49e",
+ "cscr;": "\U0001d4b8",
+ "csub;": "\u2acf",
+ "csube;": "\u2ad1",
+ "csup;": "\u2ad0",
+ "csupe;": "\u2ad2",
+ "ctdot;": "\u22ef",
+ "cudarrl;": "\u2938",
+ "cudarrr;": "\u2935",
+ "cuepr;": "\u22de",
+ "cuesc;": "\u22df",
+ "cularr;": "\u21b6",
+ "cularrp;": "\u293d",
+ "Cup;": "\u22d3",
+ "cup;": "\u222a",
+ "cupbrcap;": "\u2a48",
+ "CupCap;": "\u224d",
+ "cupcap;": "\u2a46",
+ "cupcup;": "\u2a4a",
+ "cupdot;": "\u228d",
+ "cupor;": "\u2a45",
+ "cups;": "\u222a\ufe00",
+ "curarr;": "\u21b7",
+ "curarrm;": "\u293c",
+ "curlyeqprec;": "\u22de",
+ "curlyeqsucc;": "\u22df",
+ "curlyvee;": "\u22ce",
+ "curlywedge;": "\u22cf",
+ "curren": "\xa4",
+ "curren;": "\xa4",
+ "curvearrowleft;": "\u21b6",
+ "curvearrowright;": "\u21b7",
+ "cuvee;": "\u22ce",
+ "cuwed;": "\u22cf",
+ "cwconint;": "\u2232",
+ "cwint;": "\u2231",
+ "cylcty;": "\u232d",
+ "Dagger;": "\u2021",
+ "dagger;": "\u2020",
+ "daleth;": "\u2138",
+ "Darr;": "\u21a1",
+ "dArr;": "\u21d3",
+ "darr;": "\u2193",
+ "dash;": "\u2010",
+ "Dashv;": "\u2ae4",
+ "dashv;": "\u22a3",
+ "dbkarow;": "\u290f",
+ "dblac;": "\u02dd",
+ "Dcaron;": "\u010e",
+ "dcaron;": "\u010f",
+ "Dcy;": "\u0414",
+ "dcy;": "\u0434",
+ "DD;": "\u2145",
+ "dd;": "\u2146",
+ "ddagger;": "\u2021",
+ "ddarr;": "\u21ca",
+ "DDotrahd;": "\u2911",
+ "ddotseq;": "\u2a77",
+ "deg": "\xb0",
+ "deg;": "\xb0",
+ "Del;": "\u2207",
+ "Delta;": "\u0394",
+ "delta;": "\u03b4",
+ "demptyv;": "\u29b1",
+ "dfisht;": "\u297f",
+ "Dfr;": "\U0001d507",
+ "dfr;": "\U0001d521",
+ "dHar;": "\u2965",
+ "dharl;": "\u21c3",
+ "dharr;": "\u21c2",
+ "DiacriticalAcute;": "\xb4",
+ "DiacriticalDot;": "\u02d9",
+ "DiacriticalDoubleAcute;": "\u02dd",
+ "DiacriticalGrave;": "`",
+ "DiacriticalTilde;": "\u02dc",
+ "diam;": "\u22c4",
+ "Diamond;": "\u22c4",
+ "diamond;": "\u22c4",
+ "diamondsuit;": "\u2666",
+ "diams;": "\u2666",
+ "die;": "\xa8",
+ "DifferentialD;": "\u2146",
+ "digamma;": "\u03dd",
+ "disin;": "\u22f2",
+ "div;": "\xf7",
+ "divide": "\xf7",
+ "divide;": "\xf7",
+ "divideontimes;": "\u22c7",
+ "divonx;": "\u22c7",
+ "DJcy;": "\u0402",
+ "djcy;": "\u0452",
+ "dlcorn;": "\u231e",
+ "dlcrop;": "\u230d",
+ "dollar;": "$",
+ "Dopf;": "\U0001d53b",
+ "dopf;": "\U0001d555",
+ "Dot;": "\xa8",
+ "dot;": "\u02d9",
+ "DotDot;": "\u20dc",
+ "doteq;": "\u2250",
+ "doteqdot;": "\u2251",
+ "DotEqual;": "\u2250",
+ "dotminus;": "\u2238",
+ "dotplus;": "\u2214",
+ "dotsquare;": "\u22a1",
+ "doublebarwedge;": "\u2306",
+ "DoubleContourIntegral;": "\u222f",
+ "DoubleDot;": "\xa8",
+ "DoubleDownArrow;": "\u21d3",
+ "DoubleLeftArrow;": "\u21d0",
+ "DoubleLeftRightArrow;": "\u21d4",
+ "DoubleLeftTee;": "\u2ae4",
+ "DoubleLongLeftArrow;": "\u27f8",
+ "DoubleLongLeftRightArrow;": "\u27fa",
+ "DoubleLongRightArrow;": "\u27f9",
+ "DoubleRightArrow;": "\u21d2",
+ "DoubleRightTee;": "\u22a8",
+ "DoubleUpArrow;": "\u21d1",
+ "DoubleUpDownArrow;": "\u21d5",
+ "DoubleVerticalBar;": "\u2225",
+ "DownArrow;": "\u2193",
+ "Downarrow;": "\u21d3",
+ "downarrow;": "\u2193",
+ "DownArrowBar;": "\u2913",
+ "DownArrowUpArrow;": "\u21f5",
+ "DownBreve;": "\u0311",
+ "downdownarrows;": "\u21ca",
+ "downharpoonleft;": "\u21c3",
+ "downharpoonright;": "\u21c2",
+ "DownLeftRightVector;": "\u2950",
+ "DownLeftTeeVector;": "\u295e",
+ "DownLeftVector;": "\u21bd",
+ "DownLeftVectorBar;": "\u2956",
+ "DownRightTeeVector;": "\u295f",
+ "DownRightVector;": "\u21c1",
+ "DownRightVectorBar;": "\u2957",
+ "DownTee;": "\u22a4",
+ "DownTeeArrow;": "\u21a7",
+ "drbkarow;": "\u2910",
+ "drcorn;": "\u231f",
+ "drcrop;": "\u230c",
+ "Dscr;": "\U0001d49f",
+ "dscr;": "\U0001d4b9",
+ "DScy;": "\u0405",
+ "dscy;": "\u0455",
+ "dsol;": "\u29f6",
+ "Dstrok;": "\u0110",
+ "dstrok;": "\u0111",
+ "dtdot;": "\u22f1",
+ "dtri;": "\u25bf",
+ "dtrif;": "\u25be",
+ "duarr;": "\u21f5",
+ "duhar;": "\u296f",
+ "dwangle;": "\u29a6",
+ "DZcy;": "\u040f",
+ "dzcy;": "\u045f",
+ "dzigrarr;": "\u27ff",
+ "Eacute": "\xc9",
+ "eacute": "\xe9",
+ "Eacute;": "\xc9",
+ "eacute;": "\xe9",
+ "easter;": "\u2a6e",
+ "Ecaron;": "\u011a",
+ "ecaron;": "\u011b",
+ "ecir;": "\u2256",
+ "Ecirc": "\xca",
+ "ecirc": "\xea",
+ "Ecirc;": "\xca",
+ "ecirc;": "\xea",
+ "ecolon;": "\u2255",
+ "Ecy;": "\u042d",
+ "ecy;": "\u044d",
+ "eDDot;": "\u2a77",
+ "Edot;": "\u0116",
+ "eDot;": "\u2251",
+ "edot;": "\u0117",
+ "ee;": "\u2147",
+ "efDot;": "\u2252",
+ "Efr;": "\U0001d508",
+ "efr;": "\U0001d522",
+ "eg;": "\u2a9a",
+ "Egrave": "\xc8",
+ "egrave": "\xe8",
+ "Egrave;": "\xc8",
+ "egrave;": "\xe8",
+ "egs;": "\u2a96",
+ "egsdot;": "\u2a98",
+ "el;": "\u2a99",
+ "Element;": "\u2208",
+ "elinters;": "\u23e7",
+ "ell;": "\u2113",
+ "els;": "\u2a95",
+ "elsdot;": "\u2a97",
+ "Emacr;": "\u0112",
+ "emacr;": "\u0113",
+ "empty;": "\u2205",
+ "emptyset;": "\u2205",
+ "EmptySmallSquare;": "\u25fb",
+ "emptyv;": "\u2205",
+ "EmptyVerySmallSquare;": "\u25ab",
+ "emsp13;": "\u2004",
+ "emsp14;": "\u2005",
+ "emsp;": "\u2003",
+ "ENG;": "\u014a",
+ "eng;": "\u014b",
+ "ensp;": "\u2002",
+ "Eogon;": "\u0118",
+ "eogon;": "\u0119",
+ "Eopf;": "\U0001d53c",
+ "eopf;": "\U0001d556",
+ "epar;": "\u22d5",
+ "eparsl;": "\u29e3",
+ "eplus;": "\u2a71",
+ "epsi;": "\u03b5",
+ "Epsilon;": "\u0395",
+ "epsilon;": "\u03b5",
+ "epsiv;": "\u03f5",
+ "eqcirc;": "\u2256",
+ "eqcolon;": "\u2255",
+ "eqsim;": "\u2242",
+ "eqslantgtr;": "\u2a96",
+ "eqslantless;": "\u2a95",
+ "Equal;": "\u2a75",
+ "equals;": "=",
+ "EqualTilde;": "\u2242",
+ "equest;": "\u225f",
+ "Equilibrium;": "\u21cc",
+ "equiv;": "\u2261",
+ "equivDD;": "\u2a78",
+ "eqvparsl;": "\u29e5",
+ "erarr;": "\u2971",
+ "erDot;": "\u2253",
+ "Escr;": "\u2130",
+ "escr;": "\u212f",
+ "esdot;": "\u2250",
+ "Esim;": "\u2a73",
+ "esim;": "\u2242",
+ "Eta;": "\u0397",
+ "eta;": "\u03b7",
+ "ETH": "\xd0",
+ "eth": "\xf0",
+ "ETH;": "\xd0",
+ "eth;": "\xf0",
+ "Euml": "\xcb",
+ "euml": "\xeb",
+ "Euml;": "\xcb",
+ "euml;": "\xeb",
+ "euro;": "\u20ac",
+ "excl;": "!",
+ "exist;": "\u2203",
+ "Exists;": "\u2203",
+ "expectation;": "\u2130",
+ "ExponentialE;": "\u2147",
+ "exponentiale;": "\u2147",
+ "fallingdotseq;": "\u2252",
+ "Fcy;": "\u0424",
+ "fcy;": "\u0444",
+ "female;": "\u2640",
+ "ffilig;": "\ufb03",
+ "fflig;": "\ufb00",
+ "ffllig;": "\ufb04",
+ "Ffr;": "\U0001d509",
+ "ffr;": "\U0001d523",
+ "filig;": "\ufb01",
+ "FilledSmallSquare;": "\u25fc",
+ "FilledVerySmallSquare;": "\u25aa",
+ "fjlig;": "fj",
+ "flat;": "\u266d",
+ "fllig;": "\ufb02",
+ "fltns;": "\u25b1",
+ "fnof;": "\u0192",
+ "Fopf;": "\U0001d53d",
+ "fopf;": "\U0001d557",
+ "ForAll;": "\u2200",
+ "forall;": "\u2200",
+ "fork;": "\u22d4",
+ "forkv;": "\u2ad9",
+ "Fouriertrf;": "\u2131",
+ "fpartint;": "\u2a0d",
+ "frac12": "\xbd",
+ "frac12;": "\xbd",
+ "frac13;": "\u2153",
+ "frac14": "\xbc",
+ "frac14;": "\xbc",
+ "frac15;": "\u2155",
+ "frac16;": "\u2159",
+ "frac18;": "\u215b",
+ "frac23;": "\u2154",
+ "frac25;": "\u2156",
+ "frac34": "\xbe",
+ "frac34;": "\xbe",
+ "frac35;": "\u2157",
+ "frac38;": "\u215c",
+ "frac45;": "\u2158",
+ "frac56;": "\u215a",
+ "frac58;": "\u215d",
+ "frac78;": "\u215e",
+ "frasl;": "\u2044",
+ "frown;": "\u2322",
+ "Fscr;": "\u2131",
+ "fscr;": "\U0001d4bb",
+ "gacute;": "\u01f5",
+ "Gamma;": "\u0393",
+ "gamma;": "\u03b3",
+ "Gammad;": "\u03dc",
+ "gammad;": "\u03dd",
+ "gap;": "\u2a86",
+ "Gbreve;": "\u011e",
+ "gbreve;": "\u011f",
+ "Gcedil;": "\u0122",
+ "Gcirc;": "\u011c",
+ "gcirc;": "\u011d",
+ "Gcy;": "\u0413",
+ "gcy;": "\u0433",
+ "Gdot;": "\u0120",
+ "gdot;": "\u0121",
+ "gE;": "\u2267",
+ "ge;": "\u2265",
+ "gEl;": "\u2a8c",
+ "gel;": "\u22db",
+ "geq;": "\u2265",
+ "geqq;": "\u2267",
+ "geqslant;": "\u2a7e",
+ "ges;": "\u2a7e",
+ "gescc;": "\u2aa9",
+ "gesdot;": "\u2a80",
+ "gesdoto;": "\u2a82",
+ "gesdotol;": "\u2a84",
+ "gesl;": "\u22db\ufe00",
+ "gesles;": "\u2a94",
+ "Gfr;": "\U0001d50a",
+ "gfr;": "\U0001d524",
+ "Gg;": "\u22d9",
+ "gg;": "\u226b",
+ "ggg;": "\u22d9",
+ "gimel;": "\u2137",
+ "GJcy;": "\u0403",
+ "gjcy;": "\u0453",
+ "gl;": "\u2277",
+ "gla;": "\u2aa5",
+ "glE;": "\u2a92",
+ "glj;": "\u2aa4",
+ "gnap;": "\u2a8a",
+ "gnapprox;": "\u2a8a",
+ "gnE;": "\u2269",
+ "gne;": "\u2a88",
+ "gneq;": "\u2a88",
+ "gneqq;": "\u2269",
+ "gnsim;": "\u22e7",
+ "Gopf;": "\U0001d53e",
+ "gopf;": "\U0001d558",
+ "grave;": "`",
+ "GreaterEqual;": "\u2265",
+ "GreaterEqualLess;": "\u22db",
+ "GreaterFullEqual;": "\u2267",
+ "GreaterGreater;": "\u2aa2",
+ "GreaterLess;": "\u2277",
+ "GreaterSlantEqual;": "\u2a7e",
+ "GreaterTilde;": "\u2273",
+ "Gscr;": "\U0001d4a2",
+ "gscr;": "\u210a",
+ "gsim;": "\u2273",
+ "gsime;": "\u2a8e",
+ "gsiml;": "\u2a90",
+ "GT": ">",
+ "gt": ">",
+ "GT;": ">",
+ "Gt;": "\u226b",
+ "gt;": ">",
+ "gtcc;": "\u2aa7",
+ "gtcir;": "\u2a7a",
+ "gtdot;": "\u22d7",
+ "gtlPar;": "\u2995",
+ "gtquest;": "\u2a7c",
+ "gtrapprox;": "\u2a86",
+ "gtrarr;": "\u2978",
+ "gtrdot;": "\u22d7",
+ "gtreqless;": "\u22db",
+ "gtreqqless;": "\u2a8c",
+ "gtrless;": "\u2277",
+ "gtrsim;": "\u2273",
+ "gvertneqq;": "\u2269\ufe00",
+ "gvnE;": "\u2269\ufe00",
+ "Hacek;": "\u02c7",
+ "hairsp;": "\u200a",
+ "half;": "\xbd",
+ "hamilt;": "\u210b",
+ "HARDcy;": "\u042a",
+ "hardcy;": "\u044a",
+ "hArr;": "\u21d4",
+ "harr;": "\u2194",
+ "harrcir;": "\u2948",
+ "harrw;": "\u21ad",
+ "Hat;": "^",
+ "hbar;": "\u210f",
+ "Hcirc;": "\u0124",
+ "hcirc;": "\u0125",
+ "hearts;": "\u2665",
+ "heartsuit;": "\u2665",
+ "hellip;": "\u2026",
+ "hercon;": "\u22b9",
+ "Hfr;": "\u210c",
+ "hfr;": "\U0001d525",
+ "HilbertSpace;": "\u210b",
+ "hksearow;": "\u2925",
+ "hkswarow;": "\u2926",
+ "hoarr;": "\u21ff",
+ "homtht;": "\u223b",
+ "hookleftarrow;": "\u21a9",
+ "hookrightarrow;": "\u21aa",
+ "Hopf;": "\u210d",
+ "hopf;": "\U0001d559",
+ "horbar;": "\u2015",
+ "HorizontalLine;": "\u2500",
+ "Hscr;": "\u210b",
+ "hscr;": "\U0001d4bd",
+ "hslash;": "\u210f",
+ "Hstrok;": "\u0126",
+ "hstrok;": "\u0127",
+ "HumpDownHump;": "\u224e",
+ "HumpEqual;": "\u224f",
+ "hybull;": "\u2043",
+ "hyphen;": "\u2010",
+ "Iacute": "\xcd",
+ "iacute": "\xed",
+ "Iacute;": "\xcd",
+ "iacute;": "\xed",
+ "ic;": "\u2063",
+ "Icirc": "\xce",
+ "icirc": "\xee",
+ "Icirc;": "\xce",
+ "icirc;": "\xee",
+ "Icy;": "\u0418",
+ "icy;": "\u0438",
+ "Idot;": "\u0130",
+ "IEcy;": "\u0415",
+ "iecy;": "\u0435",
+ "iexcl": "\xa1",
+ "iexcl;": "\xa1",
+ "iff;": "\u21d4",
+ "Ifr;": "\u2111",
+ "ifr;": "\U0001d526",
+ "Igrave": "\xcc",
+ "igrave": "\xec",
+ "Igrave;": "\xcc",
+ "igrave;": "\xec",
+ "ii;": "\u2148",
+ "iiiint;": "\u2a0c",
+ "iiint;": "\u222d",
+ "iinfin;": "\u29dc",
+ "iiota;": "\u2129",
+ "IJlig;": "\u0132",
+ "ijlig;": "\u0133",
+ "Im;": "\u2111",
+ "Imacr;": "\u012a",
+ "imacr;": "\u012b",
+ "image;": "\u2111",
+ "ImaginaryI;": "\u2148",
+ "imagline;": "\u2110",
+ "imagpart;": "\u2111",
+ "imath;": "\u0131",
+ "imof;": "\u22b7",
+ "imped;": "\u01b5",
+ "Implies;": "\u21d2",
+ "in;": "\u2208",
+ "incare;": "\u2105",
+ "infin;": "\u221e",
+ "infintie;": "\u29dd",
+ "inodot;": "\u0131",
+ "Int;": "\u222c",
+ "int;": "\u222b",
+ "intcal;": "\u22ba",
+ "integers;": "\u2124",
+ "Integral;": "\u222b",
+ "intercal;": "\u22ba",
+ "Intersection;": "\u22c2",
+ "intlarhk;": "\u2a17",
+ "intprod;": "\u2a3c",
+ "InvisibleComma;": "\u2063",
+ "InvisibleTimes;": "\u2062",
+ "IOcy;": "\u0401",
+ "iocy;": "\u0451",
+ "Iogon;": "\u012e",
+ "iogon;": "\u012f",
+ "Iopf;": "\U0001d540",
+ "iopf;": "\U0001d55a",
+ "Iota;": "\u0399",
+ "iota;": "\u03b9",
+ "iprod;": "\u2a3c",
+ "iquest": "\xbf",
+ "iquest;": "\xbf",
+ "Iscr;": "\u2110",
+ "iscr;": "\U0001d4be",
+ "isin;": "\u2208",
+ "isindot;": "\u22f5",
+ "isinE;": "\u22f9",
+ "isins;": "\u22f4",
+ "isinsv;": "\u22f3",
+ "isinv;": "\u2208",
+ "it;": "\u2062",
+ "Itilde;": "\u0128",
+ "itilde;": "\u0129",
+ "Iukcy;": "\u0406",
+ "iukcy;": "\u0456",
+ "Iuml": "\xcf",
+ "iuml": "\xef",
+ "Iuml;": "\xcf",
+ "iuml;": "\xef",
+ "Jcirc;": "\u0134",
+ "jcirc;": "\u0135",
+ "Jcy;": "\u0419",
+ "jcy;": "\u0439",
+ "Jfr;": "\U0001d50d",
+ "jfr;": "\U0001d527",
+ "jmath;": "\u0237",
+ "Jopf;": "\U0001d541",
+ "jopf;": "\U0001d55b",
+ "Jscr;": "\U0001d4a5",
+ "jscr;": "\U0001d4bf",
+ "Jsercy;": "\u0408",
+ "jsercy;": "\u0458",
+ "Jukcy;": "\u0404",
+ "jukcy;": "\u0454",
+ "Kappa;": "\u039a",
+ "kappa;": "\u03ba",
+ "kappav;": "\u03f0",
+ "Kcedil;": "\u0136",
+ "kcedil;": "\u0137",
+ "Kcy;": "\u041a",
+ "kcy;": "\u043a",
+ "Kfr;": "\U0001d50e",
+ "kfr;": "\U0001d528",
+ "kgreen;": "\u0138",
+ "KHcy;": "\u0425",
+ "khcy;": "\u0445",
+ "KJcy;": "\u040c",
+ "kjcy;": "\u045c",
+ "Kopf;": "\U0001d542",
+ "kopf;": "\U0001d55c",
+ "Kscr;": "\U0001d4a6",
+ "kscr;": "\U0001d4c0",
+ "lAarr;": "\u21da",
+ "Lacute;": "\u0139",
+ "lacute;": "\u013a",
+ "laemptyv;": "\u29b4",
+ "lagran;": "\u2112",
+ "Lambda;": "\u039b",
+ "lambda;": "\u03bb",
+ "Lang;": "\u27ea",
+ "lang;": "\u27e8",
+ "langd;": "\u2991",
+ "langle;": "\u27e8",
+ "lap;": "\u2a85",
+ "Laplacetrf;": "\u2112",
+ "laquo": "\xab",
+ "laquo;": "\xab",
+ "Larr;": "\u219e",
+ "lArr;": "\u21d0",
+ "larr;": "\u2190",
+ "larrb;": "\u21e4",
+ "larrbfs;": "\u291f",
+ "larrfs;": "\u291d",
+ "larrhk;": "\u21a9",
+ "larrlp;": "\u21ab",
+ "larrpl;": "\u2939",
+ "larrsim;": "\u2973",
+ "larrtl;": "\u21a2",
+ "lat;": "\u2aab",
+ "lAtail;": "\u291b",
+ "latail;": "\u2919",
+ "late;": "\u2aad",
+ "lates;": "\u2aad\ufe00",
+ "lBarr;": "\u290e",
+ "lbarr;": "\u290c",
+ "lbbrk;": "\u2772",
+ "lbrace;": "{",
+ "lbrack;": "[",
+ "lbrke;": "\u298b",
+ "lbrksld;": "\u298f",
+ "lbrkslu;": "\u298d",
+ "Lcaron;": "\u013d",
+ "lcaron;": "\u013e",
+ "Lcedil;": "\u013b",
+ "lcedil;": "\u013c",
+ "lceil;": "\u2308",
+ "lcub;": "{",
+ "Lcy;": "\u041b",
+ "lcy;": "\u043b",
+ "ldca;": "\u2936",
+ "ldquo;": "\u201c",
+ "ldquor;": "\u201e",
+ "ldrdhar;": "\u2967",
+ "ldrushar;": "\u294b",
+ "ldsh;": "\u21b2",
+ "lE;": "\u2266",
+ "le;": "\u2264",
+ "LeftAngleBracket;": "\u27e8",
+ "LeftArrow;": "\u2190",
+ "Leftarrow;": "\u21d0",
+ "leftarrow;": "\u2190",
+ "LeftArrowBar;": "\u21e4",
+ "LeftArrowRightArrow;": "\u21c6",
+ "leftarrowtail;": "\u21a2",
+ "LeftCeiling;": "\u2308",
+ "LeftDoubleBracket;": "\u27e6",
+ "LeftDownTeeVector;": "\u2961",
+ "LeftDownVector;": "\u21c3",
+ "LeftDownVectorBar;": "\u2959",
+ "LeftFloor;": "\u230a",
+ "leftharpoondown;": "\u21bd",
+ "leftharpoonup;": "\u21bc",
+ "leftleftarrows;": "\u21c7",
+ "LeftRightArrow;": "\u2194",
+ "Leftrightarrow;": "\u21d4",
+ "leftrightarrow;": "\u2194",
+ "leftrightarrows;": "\u21c6",
+ "leftrightharpoons;": "\u21cb",
+ "leftrightsquigarrow;": "\u21ad",
+ "LeftRightVector;": "\u294e",
+ "LeftTee;": "\u22a3",
+ "LeftTeeArrow;": "\u21a4",
+ "LeftTeeVector;": "\u295a",
+ "leftthreetimes;": "\u22cb",
+ "LeftTriangle;": "\u22b2",
+ "LeftTriangleBar;": "\u29cf",
+ "LeftTriangleEqual;": "\u22b4",
+ "LeftUpDownVector;": "\u2951",
+ "LeftUpTeeVector;": "\u2960",
+ "LeftUpVector;": "\u21bf",
+ "LeftUpVectorBar;": "\u2958",
+ "LeftVector;": "\u21bc",
+ "LeftVectorBar;": "\u2952",
+ "lEg;": "\u2a8b",
+ "leg;": "\u22da",
+ "leq;": "\u2264",
+ "leqq;": "\u2266",
+ "leqslant;": "\u2a7d",
+ "les;": "\u2a7d",
+ "lescc;": "\u2aa8",
+ "lesdot;": "\u2a7f",
+ "lesdoto;": "\u2a81",
+ "lesdotor;": "\u2a83",
+ "lesg;": "\u22da\ufe00",
+ "lesges;": "\u2a93",
+ "lessapprox;": "\u2a85",
+ "lessdot;": "\u22d6",
+ "lesseqgtr;": "\u22da",
+ "lesseqqgtr;": "\u2a8b",
+ "LessEqualGreater;": "\u22da",
+ "LessFullEqual;": "\u2266",
+ "LessGreater;": "\u2276",
+ "lessgtr;": "\u2276",
+ "LessLess;": "\u2aa1",
+ "lesssim;": "\u2272",
+ "LessSlantEqual;": "\u2a7d",
+ "LessTilde;": "\u2272",
+ "lfisht;": "\u297c",
+ "lfloor;": "\u230a",
+ "Lfr;": "\U0001d50f",
+ "lfr;": "\U0001d529",
+ "lg;": "\u2276",
+ "lgE;": "\u2a91",
+ "lHar;": "\u2962",
+ "lhard;": "\u21bd",
+ "lharu;": "\u21bc",
+ "lharul;": "\u296a",
+ "lhblk;": "\u2584",
+ "LJcy;": "\u0409",
+ "ljcy;": "\u0459",
+ "Ll;": "\u22d8",
+ "ll;": "\u226a",
+ "llarr;": "\u21c7",
+ "llcorner;": "\u231e",
+ "Lleftarrow;": "\u21da",
+ "llhard;": "\u296b",
+ "lltri;": "\u25fa",
+ "Lmidot;": "\u013f",
+ "lmidot;": "\u0140",
+ "lmoust;": "\u23b0",
+ "lmoustache;": "\u23b0",
+ "lnap;": "\u2a89",
+ "lnapprox;": "\u2a89",
+ "lnE;": "\u2268",
+ "lne;": "\u2a87",
+ "lneq;": "\u2a87",
+ "lneqq;": "\u2268",
+ "lnsim;": "\u22e6",
+ "loang;": "\u27ec",
+ "loarr;": "\u21fd",
+ "lobrk;": "\u27e6",
+ "LongLeftArrow;": "\u27f5",
+ "Longleftarrow;": "\u27f8",
+ "longleftarrow;": "\u27f5",
+ "LongLeftRightArrow;": "\u27f7",
+ "Longleftrightarrow;": "\u27fa",
+ "longleftrightarrow;": "\u27f7",
+ "longmapsto;": "\u27fc",
+ "LongRightArrow;": "\u27f6",
+ "Longrightarrow;": "\u27f9",
+ "longrightarrow;": "\u27f6",
+ "looparrowleft;": "\u21ab",
+ "looparrowright;": "\u21ac",
+ "lopar;": "\u2985",
+ "Lopf;": "\U0001d543",
+ "lopf;": "\U0001d55d",
+ "loplus;": "\u2a2d",
+ "lotimes;": "\u2a34",
+ "lowast;": "\u2217",
+ "lowbar;": "_",
+ "LowerLeftArrow;": "\u2199",
+ "LowerRightArrow;": "\u2198",
+ "loz;": "\u25ca",
+ "lozenge;": "\u25ca",
+ "lozf;": "\u29eb",
+ "lpar;": "(",
+ "lparlt;": "\u2993",
+ "lrarr;": "\u21c6",
+ "lrcorner;": "\u231f",
+ "lrhar;": "\u21cb",
+ "lrhard;": "\u296d",
+ "lrm;": "\u200e",
+ "lrtri;": "\u22bf",
+ "lsaquo;": "\u2039",
+ "Lscr;": "\u2112",
+ "lscr;": "\U0001d4c1",
+ "Lsh;": "\u21b0",
+ "lsh;": "\u21b0",
+ "lsim;": "\u2272",
+ "lsime;": "\u2a8d",
+ "lsimg;": "\u2a8f",
+ "lsqb;": "[",
+ "lsquo;": "\u2018",
+ "lsquor;": "\u201a",
+ "Lstrok;": "\u0141",
+ "lstrok;": "\u0142",
+ "LT": "<",
+ "lt": "<",
+ "LT;": "<",
+ "Lt;": "\u226a",
+ "lt;": "<",
+ "ltcc;": "\u2aa6",
+ "ltcir;": "\u2a79",
+ "ltdot;": "\u22d6",
+ "lthree;": "\u22cb",
+ "ltimes;": "\u22c9",
+ "ltlarr;": "\u2976",
+ "ltquest;": "\u2a7b",
+ "ltri;": "\u25c3",
+ "ltrie;": "\u22b4",
+ "ltrif;": "\u25c2",
+ "ltrPar;": "\u2996",
+ "lurdshar;": "\u294a",
+ "luruhar;": "\u2966",
+ "lvertneqq;": "\u2268\ufe00",
+ "lvnE;": "\u2268\ufe00",
+ "macr": "\xaf",
+ "macr;": "\xaf",
+ "male;": "\u2642",
+ "malt;": "\u2720",
+ "maltese;": "\u2720",
+ "Map;": "\u2905",
+ "map;": "\u21a6",
+ "mapsto;": "\u21a6",
+ "mapstodown;": "\u21a7",
+ "mapstoleft;": "\u21a4",
+ "mapstoup;": "\u21a5",
+ "marker;": "\u25ae",
+ "mcomma;": "\u2a29",
+ "Mcy;": "\u041c",
+ "mcy;": "\u043c",
+ "mdash;": "\u2014",
+ "mDDot;": "\u223a",
+ "measuredangle;": "\u2221",
+ "MediumSpace;": "\u205f",
+ "Mellintrf;": "\u2133",
+ "Mfr;": "\U0001d510",
+ "mfr;": "\U0001d52a",
+ "mho;": "\u2127",
+ "micro": "\xb5",
+ "micro;": "\xb5",
+ "mid;": "\u2223",
+ "midast;": "*",
+ "midcir;": "\u2af0",
+ "middot": "\xb7",
+ "middot;": "\xb7",
+ "minus;": "\u2212",
+ "minusb;": "\u229f",
+ "minusd;": "\u2238",
+ "minusdu;": "\u2a2a",
+ "MinusPlus;": "\u2213",
+ "mlcp;": "\u2adb",
+ "mldr;": "\u2026",
+ "mnplus;": "\u2213",
+ "models;": "\u22a7",
+ "Mopf;": "\U0001d544",
+ "mopf;": "\U0001d55e",
+ "mp;": "\u2213",
+ "Mscr;": "\u2133",
+ "mscr;": "\U0001d4c2",
+ "mstpos;": "\u223e",
+ "Mu;": "\u039c",
+ "mu;": "\u03bc",
+ "multimap;": "\u22b8",
+ "mumap;": "\u22b8",
+ "nabla;": "\u2207",
+ "Nacute;": "\u0143",
+ "nacute;": "\u0144",
+ "nang;": "\u2220\u20d2",
+ "nap;": "\u2249",
+ "napE;": "\u2a70\u0338",
+ "napid;": "\u224b\u0338",
+ "napos;": "\u0149",
+ "napprox;": "\u2249",
+ "natur;": "\u266e",
+ "natural;": "\u266e",
+ "naturals;": "\u2115",
+ "nbsp": "\xa0",
+ "nbsp;": "\xa0",
+ "nbump;": "\u224e\u0338",
+ "nbumpe;": "\u224f\u0338",
+ "ncap;": "\u2a43",
+ "Ncaron;": "\u0147",
+ "ncaron;": "\u0148",
+ "Ncedil;": "\u0145",
+ "ncedil;": "\u0146",
+ "ncong;": "\u2247",
+ "ncongdot;": "\u2a6d\u0338",
+ "ncup;": "\u2a42",
+ "Ncy;": "\u041d",
+ "ncy;": "\u043d",
+ "ndash;": "\u2013",
+ "ne;": "\u2260",
+ "nearhk;": "\u2924",
+ "neArr;": "\u21d7",
+ "nearr;": "\u2197",
+ "nearrow;": "\u2197",
+ "nedot;": "\u2250\u0338",
+ "NegativeMediumSpace;": "\u200b",
+ "NegativeThickSpace;": "\u200b",
+ "NegativeThinSpace;": "\u200b",
+ "NegativeVeryThinSpace;": "\u200b",
+ "nequiv;": "\u2262",
+ "nesear;": "\u2928",
+ "nesim;": "\u2242\u0338",
+ "NestedGreaterGreater;": "\u226b",
+ "NestedLessLess;": "\u226a",
+ "NewLine;": "\n",
+ "nexist;": "\u2204",
+ "nexists;": "\u2204",
+ "Nfr;": "\U0001d511",
+ "nfr;": "\U0001d52b",
+ "ngE;": "\u2267\u0338",
+ "nge;": "\u2271",
+ "ngeq;": "\u2271",
+ "ngeqq;": "\u2267\u0338",
+ "ngeqslant;": "\u2a7e\u0338",
+ "nges;": "\u2a7e\u0338",
+ "nGg;": "\u22d9\u0338",
+ "ngsim;": "\u2275",
+ "nGt;": "\u226b\u20d2",
+ "ngt;": "\u226f",
+ "ngtr;": "\u226f",
+ "nGtv;": "\u226b\u0338",
+ "nhArr;": "\u21ce",
+ "nharr;": "\u21ae",
+ "nhpar;": "\u2af2",
+ "ni;": "\u220b",
+ "nis;": "\u22fc",
+ "nisd;": "\u22fa",
+ "niv;": "\u220b",
+ "NJcy;": "\u040a",
+ "njcy;": "\u045a",
+ "nlArr;": "\u21cd",
+ "nlarr;": "\u219a",
+ "nldr;": "\u2025",
+ "nlE;": "\u2266\u0338",
+ "nle;": "\u2270",
+ "nLeftarrow;": "\u21cd",
+ "nleftarrow;": "\u219a",
+ "nLeftrightarrow;": "\u21ce",
+ "nleftrightarrow;": "\u21ae",
+ "nleq;": "\u2270",
+ "nleqq;": "\u2266\u0338",
+ "nleqslant;": "\u2a7d\u0338",
+ "nles;": "\u2a7d\u0338",
+ "nless;": "\u226e",
+ "nLl;": "\u22d8\u0338",
+ "nlsim;": "\u2274",
+ "nLt;": "\u226a\u20d2",
+ "nlt;": "\u226e",
+ "nltri;": "\u22ea",
+ "nltrie;": "\u22ec",
+ "nLtv;": "\u226a\u0338",
+ "nmid;": "\u2224",
+ "NoBreak;": "\u2060",
+ "NonBreakingSpace;": "\xa0",
+ "Nopf;": "\u2115",
+ "nopf;": "\U0001d55f",
+ "not": "\xac",
+ "Not;": "\u2aec",
+ "not;": "\xac",
+ "NotCongruent;": "\u2262",
+ "NotCupCap;": "\u226d",
+ "NotDoubleVerticalBar;": "\u2226",
+ "NotElement;": "\u2209",
+ "NotEqual;": "\u2260",
+ "NotEqualTilde;": "\u2242\u0338",
+ "NotExists;": "\u2204",
+ "NotGreater;": "\u226f",
+ "NotGreaterEqual;": "\u2271",
+ "NotGreaterFullEqual;": "\u2267\u0338",
+ "NotGreaterGreater;": "\u226b\u0338",
+ "NotGreaterLess;": "\u2279",
+ "NotGreaterSlantEqual;": "\u2a7e\u0338",
+ "NotGreaterTilde;": "\u2275",
+ "NotHumpDownHump;": "\u224e\u0338",
+ "NotHumpEqual;": "\u224f\u0338",
+ "notin;": "\u2209",
+ "notindot;": "\u22f5\u0338",
+ "notinE;": "\u22f9\u0338",
+ "notinva;": "\u2209",
+ "notinvb;": "\u22f7",
+ "notinvc;": "\u22f6",
+ "NotLeftTriangle;": "\u22ea",
+ "NotLeftTriangleBar;": "\u29cf\u0338",
+ "NotLeftTriangleEqual;": "\u22ec",
+ "NotLess;": "\u226e",
+ "NotLessEqual;": "\u2270",
+ "NotLessGreater;": "\u2278",
+ "NotLessLess;": "\u226a\u0338",
+ "NotLessSlantEqual;": "\u2a7d\u0338",
+ "NotLessTilde;": "\u2274",
+ "NotNestedGreaterGreater;": "\u2aa2\u0338",
+ "NotNestedLessLess;": "\u2aa1\u0338",
+ "notni;": "\u220c",
+ "notniva;": "\u220c",
+ "notnivb;": "\u22fe",
+ "notnivc;": "\u22fd",
+ "NotPrecedes;": "\u2280",
+ "NotPrecedesEqual;": "\u2aaf\u0338",
+ "NotPrecedesSlantEqual;": "\u22e0",
+ "NotReverseElement;": "\u220c",
+ "NotRightTriangle;": "\u22eb",
+ "NotRightTriangleBar;": "\u29d0\u0338",
+ "NotRightTriangleEqual;": "\u22ed",
+ "NotSquareSubset;": "\u228f\u0338",
+ "NotSquareSubsetEqual;": "\u22e2",
+ "NotSquareSuperset;": "\u2290\u0338",
+ "NotSquareSupersetEqual;": "\u22e3",
+ "NotSubset;": "\u2282\u20d2",
+ "NotSubsetEqual;": "\u2288",
+ "NotSucceeds;": "\u2281",
+ "NotSucceedsEqual;": "\u2ab0\u0338",
+ "NotSucceedsSlantEqual;": "\u22e1",
+ "NotSucceedsTilde;": "\u227f\u0338",
+ "NotSuperset;": "\u2283\u20d2",
+ "NotSupersetEqual;": "\u2289",
+ "NotTilde;": "\u2241",
+ "NotTildeEqual;": "\u2244",
+ "NotTildeFullEqual;": "\u2247",
+ "NotTildeTilde;": "\u2249",
+ "NotVerticalBar;": "\u2224",
+ "npar;": "\u2226",
+ "nparallel;": "\u2226",
+ "nparsl;": "\u2afd\u20e5",
+ "npart;": "\u2202\u0338",
+ "npolint;": "\u2a14",
+ "npr;": "\u2280",
+ "nprcue;": "\u22e0",
+ "npre;": "\u2aaf\u0338",
+ "nprec;": "\u2280",
+ "npreceq;": "\u2aaf\u0338",
+ "nrArr;": "\u21cf",
+ "nrarr;": "\u219b",
+ "nrarrc;": "\u2933\u0338",
+ "nrarrw;": "\u219d\u0338",
+ "nRightarrow;": "\u21cf",
+ "nrightarrow;": "\u219b",
+ "nrtri;": "\u22eb",
+ "nrtrie;": "\u22ed",
+ "nsc;": "\u2281",
+ "nsccue;": "\u22e1",
+ "nsce;": "\u2ab0\u0338",
+ "Nscr;": "\U0001d4a9",
+ "nscr;": "\U0001d4c3",
+ "nshortmid;": "\u2224",
+ "nshortparallel;": "\u2226",
+ "nsim;": "\u2241",
+ "nsime;": "\u2244",
+ "nsimeq;": "\u2244",
+ "nsmid;": "\u2224",
+ "nspar;": "\u2226",
+ "nsqsube;": "\u22e2",
+ "nsqsupe;": "\u22e3",
+ "nsub;": "\u2284",
+ "nsubE;": "\u2ac5\u0338",
+ "nsube;": "\u2288",
+ "nsubset;": "\u2282\u20d2",
+ "nsubseteq;": "\u2288",
+ "nsubseteqq;": "\u2ac5\u0338",
+ "nsucc;": "\u2281",
+ "nsucceq;": "\u2ab0\u0338",
+ "nsup;": "\u2285",
+ "nsupE;": "\u2ac6\u0338",
+ "nsupe;": "\u2289",
+ "nsupset;": "\u2283\u20d2",
+ "nsupseteq;": "\u2289",
+ "nsupseteqq;": "\u2ac6\u0338",
+ "ntgl;": "\u2279",
+ "Ntilde": "\xd1",
+ "ntilde": "\xf1",
+ "Ntilde;": "\xd1",
+ "ntilde;": "\xf1",
+ "ntlg;": "\u2278",
+ "ntriangleleft;": "\u22ea",
+ "ntrianglelefteq;": "\u22ec",
+ "ntriangleright;": "\u22eb",
+ "ntrianglerighteq;": "\u22ed",
+ "Nu;": "\u039d",
+ "nu;": "\u03bd",
+ "num;": "#",
+ "numero;": "\u2116",
+ "numsp;": "\u2007",
+ "nvap;": "\u224d\u20d2",
+ "nVDash;": "\u22af",
+ "nVdash;": "\u22ae",
+ "nvDash;": "\u22ad",
+ "nvdash;": "\u22ac",
+ "nvge;": "\u2265\u20d2",
+ "nvgt;": ">\u20d2",
+ "nvHarr;": "\u2904",
+ "nvinfin;": "\u29de",
+ "nvlArr;": "\u2902",
+ "nvle;": "\u2264\u20d2",
+ "nvlt;": "<\u20d2",
+ "nvltrie;": "\u22b4\u20d2",
+ "nvrArr;": "\u2903",
+ "nvrtrie;": "\u22b5\u20d2",
+ "nvsim;": "\u223c\u20d2",
+ "nwarhk;": "\u2923",
+ "nwArr;": "\u21d6",
+ "nwarr;": "\u2196",
+ "nwarrow;": "\u2196",
+ "nwnear;": "\u2927",
+ "Oacute": "\xd3",
+ "oacute": "\xf3",
+ "Oacute;": "\xd3",
+ "oacute;": "\xf3",
+ "oast;": "\u229b",
+ "ocir;": "\u229a",
+ "Ocirc": "\xd4",
+ "ocirc": "\xf4",
+ "Ocirc;": "\xd4",
+ "ocirc;": "\xf4",
+ "Ocy;": "\u041e",
+ "ocy;": "\u043e",
+ "odash;": "\u229d",
+ "Odblac;": "\u0150",
+ "odblac;": "\u0151",
+ "odiv;": "\u2a38",
+ "odot;": "\u2299",
+ "odsold;": "\u29bc",
+ "OElig;": "\u0152",
+ "oelig;": "\u0153",
+ "ofcir;": "\u29bf",
+ "Ofr;": "\U0001d512",
+ "ofr;": "\U0001d52c",
+ "ogon;": "\u02db",
+ "Ograve": "\xd2",
+ "ograve": "\xf2",
+ "Ograve;": "\xd2",
+ "ograve;": "\xf2",
+ "ogt;": "\u29c1",
+ "ohbar;": "\u29b5",
+ "ohm;": "\u03a9",
+ "oint;": "\u222e",
+ "olarr;": "\u21ba",
+ "olcir;": "\u29be",
+ "olcross;": "\u29bb",
+ "oline;": "\u203e",
+ "olt;": "\u29c0",
+ "Omacr;": "\u014c",
+ "omacr;": "\u014d",
+ "Omega;": "\u03a9",
+ "omega;": "\u03c9",
+ "Omicron;": "\u039f",
+ "omicron;": "\u03bf",
+ "omid;": "\u29b6",
+ "ominus;": "\u2296",
+ "Oopf;": "\U0001d546",
+ "oopf;": "\U0001d560",
+ "opar;": "\u29b7",
+ "OpenCurlyDoubleQuote;": "\u201c",
+ "OpenCurlyQuote;": "\u2018",
+ "operp;": "\u29b9",
+ "oplus;": "\u2295",
+ "Or;": "\u2a54",
+ "or;": "\u2228",
+ "orarr;": "\u21bb",
+ "ord;": "\u2a5d",
+ "order;": "\u2134",
+ "orderof;": "\u2134",
+ "ordf": "\xaa",
+ "ordf;": "\xaa",
+ "ordm": "\xba",
+ "ordm;": "\xba",
+ "origof;": "\u22b6",
+ "oror;": "\u2a56",
+ "orslope;": "\u2a57",
+ "orv;": "\u2a5b",
+ "oS;": "\u24c8",
+ "Oscr;": "\U0001d4aa",
+ "oscr;": "\u2134",
+ "Oslash": "\xd8",
+ "oslash": "\xf8",
+ "Oslash;": "\xd8",
+ "oslash;": "\xf8",
+ "osol;": "\u2298",
+ "Otilde": "\xd5",
+ "otilde": "\xf5",
+ "Otilde;": "\xd5",
+ "otilde;": "\xf5",
+ "Otimes;": "\u2a37",
+ "otimes;": "\u2297",
+ "otimesas;": "\u2a36",
+ "Ouml": "\xd6",
+ "ouml": "\xf6",
+ "Ouml;": "\xd6",
+ "ouml;": "\xf6",
+ "ovbar;": "\u233d",
+ "OverBar;": "\u203e",
+ "OverBrace;": "\u23de",
+ "OverBracket;": "\u23b4",
+ "OverParenthesis;": "\u23dc",
+ "par;": "\u2225",
+ "para": "\xb6",
+ "para;": "\xb6",
+ "parallel;": "\u2225",
+ "parsim;": "\u2af3",
+ "parsl;": "\u2afd",
+ "part;": "\u2202",
+ "PartialD;": "\u2202",
+ "Pcy;": "\u041f",
+ "pcy;": "\u043f",
+ "percnt;": "%",
+ "period;": ".",
+ "permil;": "\u2030",
+ "perp;": "\u22a5",
+ "pertenk;": "\u2031",
+ "Pfr;": "\U0001d513",
+ "pfr;": "\U0001d52d",
+ "Phi;": "\u03a6",
+ "phi;": "\u03c6",
+ "phiv;": "\u03d5",
+ "phmmat;": "\u2133",
+ "phone;": "\u260e",
+ "Pi;": "\u03a0",
+ "pi;": "\u03c0",
+ "pitchfork;": "\u22d4",
+ "piv;": "\u03d6",
+ "planck;": "\u210f",
+ "planckh;": "\u210e",
+ "plankv;": "\u210f",
+ "plus;": "+",
+ "plusacir;": "\u2a23",
+ "plusb;": "\u229e",
+ "pluscir;": "\u2a22",
+ "plusdo;": "\u2214",
+ "plusdu;": "\u2a25",
+ "pluse;": "\u2a72",
+ "PlusMinus;": "\xb1",
+ "plusmn": "\xb1",
+ "plusmn;": "\xb1",
+ "plussim;": "\u2a26",
+ "plustwo;": "\u2a27",
+ "pm;": "\xb1",
+ "Poincareplane;": "\u210c",
+ "pointint;": "\u2a15",
+ "Popf;": "\u2119",
+ "popf;": "\U0001d561",
+ "pound": "\xa3",
+ "pound;": "\xa3",
+ "Pr;": "\u2abb",
+ "pr;": "\u227a",
+ "prap;": "\u2ab7",
+ "prcue;": "\u227c",
+ "prE;": "\u2ab3",
+ "pre;": "\u2aaf",
+ "prec;": "\u227a",
+ "precapprox;": "\u2ab7",
+ "preccurlyeq;": "\u227c",
+ "Precedes;": "\u227a",
+ "PrecedesEqual;": "\u2aaf",
+ "PrecedesSlantEqual;": "\u227c",
+ "PrecedesTilde;": "\u227e",
+ "preceq;": "\u2aaf",
+ "precnapprox;": "\u2ab9",
+ "precneqq;": "\u2ab5",
+ "precnsim;": "\u22e8",
+ "precsim;": "\u227e",
+ "Prime;": "\u2033",
+ "prime;": "\u2032",
+ "primes;": "\u2119",
+ "prnap;": "\u2ab9",
+ "prnE;": "\u2ab5",
+ "prnsim;": "\u22e8",
+ "prod;": "\u220f",
+ "Product;": "\u220f",
+ "profalar;": "\u232e",
+ "profline;": "\u2312",
+ "profsurf;": "\u2313",
+ "prop;": "\u221d",
+ "Proportion;": "\u2237",
+ "Proportional;": "\u221d",
+ "propto;": "\u221d",
+ "prsim;": "\u227e",
+ "prurel;": "\u22b0",
+ "Pscr;": "\U0001d4ab",
+ "pscr;": "\U0001d4c5",
+ "Psi;": "\u03a8",
+ "psi;": "\u03c8",
+ "puncsp;": "\u2008",
+ "Qfr;": "\U0001d514",
+ "qfr;": "\U0001d52e",
+ "qint;": "\u2a0c",
+ "Qopf;": "\u211a",
+ "qopf;": "\U0001d562",
+ "qprime;": "\u2057",
+ "Qscr;": "\U0001d4ac",
+ "qscr;": "\U0001d4c6",
+ "quaternions;": "\u210d",
+ "quatint;": "\u2a16",
+ "quest;": "?",
+ "questeq;": "\u225f",
+ "QUOT": '"',
+ "quot": '"',
+ "QUOT;": '"',
+ "quot;": '"',
+ "rAarr;": "\u21db",
+ "race;": "\u223d\u0331",
+ "Racute;": "\u0154",
+ "racute;": "\u0155",
+ "radic;": "\u221a",
+ "raemptyv;": "\u29b3",
+ "Rang;": "\u27eb",
+ "rang;": "\u27e9",
+ "rangd;": "\u2992",
+ "range;": "\u29a5",
+ "rangle;": "\u27e9",
+ "raquo": "\xbb",
+ "raquo;": "\xbb",
+ "Rarr;": "\u21a0",
+ "rArr;": "\u21d2",
+ "rarr;": "\u2192",
+ "rarrap;": "\u2975",
+ "rarrb;": "\u21e5",
+ "rarrbfs;": "\u2920",
+ "rarrc;": "\u2933",
+ "rarrfs;": "\u291e",
+ "rarrhk;": "\u21aa",
+ "rarrlp;": "\u21ac",
+ "rarrpl;": "\u2945",
+ "rarrsim;": "\u2974",
+ "Rarrtl;": "\u2916",
+ "rarrtl;": "\u21a3",
+ "rarrw;": "\u219d",
+ "rAtail;": "\u291c",
+ "ratail;": "\u291a",
+ "ratio;": "\u2236",
+ "rationals;": "\u211a",
+ "RBarr;": "\u2910",
+ "rBarr;": "\u290f",
+ "rbarr;": "\u290d",
+ "rbbrk;": "\u2773",
+ "rbrace;": "}",
+ "rbrack;": "]",
+ "rbrke;": "\u298c",
+ "rbrksld;": "\u298e",
+ "rbrkslu;": "\u2990",
+ "Rcaron;": "\u0158",
+ "rcaron;": "\u0159",
+ "Rcedil;": "\u0156",
+ "rcedil;": "\u0157",
+ "rceil;": "\u2309",
+ "rcub;": "}",
+ "Rcy;": "\u0420",
+ "rcy;": "\u0440",
+ "rdca;": "\u2937",
+ "rdldhar;": "\u2969",
+ "rdquo;": "\u201d",
+ "rdquor;": "\u201d",
+ "rdsh;": "\u21b3",
+ "Re;": "\u211c",
+ "real;": "\u211c",
+ "realine;": "\u211b",
+ "realpart;": "\u211c",
+ "reals;": "\u211d",
+ "rect;": "\u25ad",
+ "REG": "\xae",
+ "reg": "\xae",
+ "REG;": "\xae",
+ "reg;": "\xae",
+ "ReverseElement;": "\u220b",
+ "ReverseEquilibrium;": "\u21cb",
+ "ReverseUpEquilibrium;": "\u296f",
+ "rfisht;": "\u297d",
+ "rfloor;": "\u230b",
+ "Rfr;": "\u211c",
+ "rfr;": "\U0001d52f",
+ "rHar;": "\u2964",
+ "rhard;": "\u21c1",
+ "rharu;": "\u21c0",
+ "rharul;": "\u296c",
+ "Rho;": "\u03a1",
+ "rho;": "\u03c1",
+ "rhov;": "\u03f1",
+ "RightAngleBracket;": "\u27e9",
+ "RightArrow;": "\u2192",
+ "Rightarrow;": "\u21d2",
+ "rightarrow;": "\u2192",
+ "RightArrowBar;": "\u21e5",
+ "RightArrowLeftArrow;": "\u21c4",
+ "rightarrowtail;": "\u21a3",
+ "RightCeiling;": "\u2309",
+ "RightDoubleBracket;": "\u27e7",
+ "RightDownTeeVector;": "\u295d",
+ "RightDownVector;": "\u21c2",
+ "RightDownVectorBar;": "\u2955",
+ "RightFloor;": "\u230b",
+ "rightharpoondown;": "\u21c1",
+ "rightharpoonup;": "\u21c0",
+ "rightleftarrows;": "\u21c4",
+ "rightleftharpoons;": "\u21cc",
+ "rightrightarrows;": "\u21c9",
+ "rightsquigarrow;": "\u219d",
+ "RightTee;": "\u22a2",
+ "RightTeeArrow;": "\u21a6",
+ "RightTeeVector;": "\u295b",
+ "rightthreetimes;": "\u22cc",
+ "RightTriangle;": "\u22b3",
+ "RightTriangleBar;": "\u29d0",
+ "RightTriangleEqual;": "\u22b5",
+ "RightUpDownVector;": "\u294f",
+ "RightUpTeeVector;": "\u295c",
+ "RightUpVector;": "\u21be",
+ "RightUpVectorBar;": "\u2954",
+ "RightVector;": "\u21c0",
+ "RightVectorBar;": "\u2953",
+ "ring;": "\u02da",
+ "risingdotseq;": "\u2253",
+ "rlarr;": "\u21c4",
+ "rlhar;": "\u21cc",
+ "rlm;": "\u200f",
+ "rmoust;": "\u23b1",
+ "rmoustache;": "\u23b1",
+ "rnmid;": "\u2aee",
+ "roang;": "\u27ed",
+ "roarr;": "\u21fe",
+ "robrk;": "\u27e7",
+ "ropar;": "\u2986",
+ "Ropf;": "\u211d",
+ "ropf;": "\U0001d563",
+ "roplus;": "\u2a2e",
+ "rotimes;": "\u2a35",
+ "RoundImplies;": "\u2970",
+ "rpar;": ")",
+ "rpargt;": "\u2994",
+ "rppolint;": "\u2a12",
+ "rrarr;": "\u21c9",
+ "Rrightarrow;": "\u21db",
+ "rsaquo;": "\u203a",
+ "Rscr;": "\u211b",
+ "rscr;": "\U0001d4c7",
+ "Rsh;": "\u21b1",
+ "rsh;": "\u21b1",
+ "rsqb;": "]",
+ "rsquo;": "\u2019",
+ "rsquor;": "\u2019",
+ "rthree;": "\u22cc",
+ "rtimes;": "\u22ca",
+ "rtri;": "\u25b9",
+ "rtrie;": "\u22b5",
+ "rtrif;": "\u25b8",
+ "rtriltri;": "\u29ce",
+ "RuleDelayed;": "\u29f4",
+ "ruluhar;": "\u2968",
+ "rx;": "\u211e",
+ "Sacute;": "\u015a",
+ "sacute;": "\u015b",
+ "sbquo;": "\u201a",
+ "Sc;": "\u2abc",
+ "sc;": "\u227b",
+ "scap;": "\u2ab8",
+ "Scaron;": "\u0160",
+ "scaron;": "\u0161",
+ "sccue;": "\u227d",
+ "scE;": "\u2ab4",
+ "sce;": "\u2ab0",
+ "Scedil;": "\u015e",
+ "scedil;": "\u015f",
+ "Scirc;": "\u015c",
+ "scirc;": "\u015d",
+ "scnap;": "\u2aba",
+ "scnE;": "\u2ab6",
+ "scnsim;": "\u22e9",
+ "scpolint;": "\u2a13",
+ "scsim;": "\u227f",
+ "Scy;": "\u0421",
+ "scy;": "\u0441",
+ "sdot;": "\u22c5",
+ "sdotb;": "\u22a1",
+ "sdote;": "\u2a66",
+ "searhk;": "\u2925",
+ "seArr;": "\u21d8",
+ "searr;": "\u2198",
+ "searrow;": "\u2198",
+ "sect": "\xa7",
+ "sect;": "\xa7",
+ "semi;": ";",
+ "seswar;": "\u2929",
+ "setminus;": "\u2216",
+ "setmn;": "\u2216",
+ "sext;": "\u2736",
+ "Sfr;": "\U0001d516",
+ "sfr;": "\U0001d530",
+ "sfrown;": "\u2322",
+ "sharp;": "\u266f",
+ "SHCHcy;": "\u0429",
+ "shchcy;": "\u0449",
+ "SHcy;": "\u0428",
+ "shcy;": "\u0448",
+ "ShortDownArrow;": "\u2193",
+ "ShortLeftArrow;": "\u2190",
+ "shortmid;": "\u2223",
+ "shortparallel;": "\u2225",
+ "ShortRightArrow;": "\u2192",
+ "ShortUpArrow;": "\u2191",
+ "shy": "\xad",
+ "shy;": "\xad",
+ "Sigma;": "\u03a3",
+ "sigma;": "\u03c3",
+ "sigmaf;": "\u03c2",
+ "sigmav;": "\u03c2",
+ "sim;": "\u223c",
+ "simdot;": "\u2a6a",
+ "sime;": "\u2243",
+ "simeq;": "\u2243",
+ "simg;": "\u2a9e",
+ "simgE;": "\u2aa0",
+ "siml;": "\u2a9d",
+ "simlE;": "\u2a9f",
+ "simne;": "\u2246",
+ "simplus;": "\u2a24",
+ "simrarr;": "\u2972",
+ "slarr;": "\u2190",
+ "SmallCircle;": "\u2218",
+ "smallsetminus;": "\u2216",
+ "smashp;": "\u2a33",
+ "smeparsl;": "\u29e4",
+ "smid;": "\u2223",
+ "smile;": "\u2323",
+ "smt;": "\u2aaa",
+ "smte;": "\u2aac",
+ "smtes;": "\u2aac\ufe00",
+ "SOFTcy;": "\u042c",
+ "softcy;": "\u044c",
+ "sol;": "/",
+ "solb;": "\u29c4",
+ "solbar;": "\u233f",
+ "Sopf;": "\U0001d54a",
+ "sopf;": "\U0001d564",
+ "spades;": "\u2660",
+ "spadesuit;": "\u2660",
+ "spar;": "\u2225",
+ "sqcap;": "\u2293",
+ "sqcaps;": "\u2293\ufe00",
+ "sqcup;": "\u2294",
+ "sqcups;": "\u2294\ufe00",
+ "Sqrt;": "\u221a",
+ "sqsub;": "\u228f",
+ "sqsube;": "\u2291",
+ "sqsubset;": "\u228f",
+ "sqsubseteq;": "\u2291",
+ "sqsup;": "\u2290",
+ "sqsupe;": "\u2292",
+ "sqsupset;": "\u2290",
+ "sqsupseteq;": "\u2292",
+ "squ;": "\u25a1",
+ "Square;": "\u25a1",
+ "square;": "\u25a1",
+ "SquareIntersection;": "\u2293",
+ "SquareSubset;": "\u228f",
+ "SquareSubsetEqual;": "\u2291",
+ "SquareSuperset;": "\u2290",
+ "SquareSupersetEqual;": "\u2292",
+ "SquareUnion;": "\u2294",
+ "squarf;": "\u25aa",
+ "squf;": "\u25aa",
+ "srarr;": "\u2192",
+ "Sscr;": "\U0001d4ae",
+ "sscr;": "\U0001d4c8",
+ "ssetmn;": "\u2216",
+ "ssmile;": "\u2323",
+ "sstarf;": "\u22c6",
+ "Star;": "\u22c6",
+ "star;": "\u2606",
+ "starf;": "\u2605",
+ "straightepsilon;": "\u03f5",
+ "straightphi;": "\u03d5",
+ "strns;": "\xaf",
+ "Sub;": "\u22d0",
+ "sub;": "\u2282",
+ "subdot;": "\u2abd",
+ "subE;": "\u2ac5",
+ "sube;": "\u2286",
+ "subedot;": "\u2ac3",
+ "submult;": "\u2ac1",
+ "subnE;": "\u2acb",
+ "subne;": "\u228a",
+ "subplus;": "\u2abf",
+ "subrarr;": "\u2979",
+ "Subset;": "\u22d0",
+ "subset;": "\u2282",
+ "subseteq;": "\u2286",
+ "subseteqq;": "\u2ac5",
+ "SubsetEqual;": "\u2286",
+ "subsetneq;": "\u228a",
+ "subsetneqq;": "\u2acb",
+ "subsim;": "\u2ac7",
+ "subsub;": "\u2ad5",
+ "subsup;": "\u2ad3",
+ "succ;": "\u227b",
+ "succapprox;": "\u2ab8",
+ "succcurlyeq;": "\u227d",
+ "Succeeds;": "\u227b",
+ "SucceedsEqual;": "\u2ab0",
+ "SucceedsSlantEqual;": "\u227d",
+ "SucceedsTilde;": "\u227f",
+ "succeq;": "\u2ab0",
+ "succnapprox;": "\u2aba",
+ "succneqq;": "\u2ab6",
+ "succnsim;": "\u22e9",
+ "succsim;": "\u227f",
+ "SuchThat;": "\u220b",
+ "Sum;": "\u2211",
+ "sum;": "\u2211",
+ "sung;": "\u266a",
+ "sup1": "\xb9",
+ "sup1;": "\xb9",
+ "sup2": "\xb2",
+ "sup2;": "\xb2",
+ "sup3": "\xb3",
+ "sup3;": "\xb3",
+ "Sup;": "\u22d1",
+ "sup;": "\u2283",
+ "supdot;": "\u2abe",
+ "supdsub;": "\u2ad8",
+ "supE;": "\u2ac6",
+ "supe;": "\u2287",
+ "supedot;": "\u2ac4",
+ "Superset;": "\u2283",
+ "SupersetEqual;": "\u2287",
+ "suphsol;": "\u27c9",
+ "suphsub;": "\u2ad7",
+ "suplarr;": "\u297b",
+ "supmult;": "\u2ac2",
+ "supnE;": "\u2acc",
+ "supne;": "\u228b",
+ "supplus;": "\u2ac0",
+ "Supset;": "\u22d1",
+ "supset;": "\u2283",
+ "supseteq;": "\u2287",
+ "supseteqq;": "\u2ac6",
+ "supsetneq;": "\u228b",
+ "supsetneqq;": "\u2acc",
+ "supsim;": "\u2ac8",
+ "supsub;": "\u2ad4",
+ "supsup;": "\u2ad6",
+ "swarhk;": "\u2926",
+ "swArr;": "\u21d9",
+ "swarr;": "\u2199",
+ "swarrow;": "\u2199",
+ "swnwar;": "\u292a",
+ "szlig": "\xdf",
+ "szlig;": "\xdf",
+ "Tab;": "\t",
+ "target;": "\u2316",
+ "Tau;": "\u03a4",
+ "tau;": "\u03c4",
+ "tbrk;": "\u23b4",
+ "Tcaron;": "\u0164",
+ "tcaron;": "\u0165",
+ "Tcedil;": "\u0162",
+ "tcedil;": "\u0163",
+ "Tcy;": "\u0422",
+ "tcy;": "\u0442",
+ "tdot;": "\u20db",
+ "telrec;": "\u2315",
+ "Tfr;": "\U0001d517",
+ "tfr;": "\U0001d531",
+ "there4;": "\u2234",
+ "Therefore;": "\u2234",
+ "therefore;": "\u2234",
+ "Theta;": "\u0398",
+ "theta;": "\u03b8",
+ "thetasym;": "\u03d1",
+ "thetav;": "\u03d1",
+ "thickapprox;": "\u2248",
+ "thicksim;": "\u223c",
+ "ThickSpace;": "\u205f\u200a",
+ "thinsp;": "\u2009",
+ "ThinSpace;": "\u2009",
+ "thkap;": "\u2248",
+ "thksim;": "\u223c",
+ "THORN": "\xde",
+ "thorn": "\xfe",
+ "THORN;": "\xde",
+ "thorn;": "\xfe",
+ "Tilde;": "\u223c",
+ "tilde;": "\u02dc",
+ "TildeEqual;": "\u2243",
+ "TildeFullEqual;": "\u2245",
+ "TildeTilde;": "\u2248",
+ "times": "\xd7",
+ "times;": "\xd7",
+ "timesb;": "\u22a0",
+ "timesbar;": "\u2a31",
+ "timesd;": "\u2a30",
+ "tint;": "\u222d",
+ "toea;": "\u2928",
+ "top;": "\u22a4",
+ "topbot;": "\u2336",
+ "topcir;": "\u2af1",
+ "Topf;": "\U0001d54b",
+ "topf;": "\U0001d565",
+ "topfork;": "\u2ada",
+ "tosa;": "\u2929",
+ "tprime;": "\u2034",
+ "TRADE;": "\u2122",
+ "trade;": "\u2122",
+ "triangle;": "\u25b5",
+ "triangledown;": "\u25bf",
+ "triangleleft;": "\u25c3",
+ "trianglelefteq;": "\u22b4",
+ "triangleq;": "\u225c",
+ "triangleright;": "\u25b9",
+ "trianglerighteq;": "\u22b5",
+ "tridot;": "\u25ec",
+ "trie;": "\u225c",
+ "triminus;": "\u2a3a",
+ "TripleDot;": "\u20db",
+ "triplus;": "\u2a39",
+ "trisb;": "\u29cd",
+ "tritime;": "\u2a3b",
+ "trpezium;": "\u23e2",
+ "Tscr;": "\U0001d4af",
+ "tscr;": "\U0001d4c9",
+ "TScy;": "\u0426",
+ "tscy;": "\u0446",
+ "TSHcy;": "\u040b",
+ "tshcy;": "\u045b",
+ "Tstrok;": "\u0166",
+ "tstrok;": "\u0167",
+ "twixt;": "\u226c",
+ "twoheadleftarrow;": "\u219e",
+ "twoheadrightarrow;": "\u21a0",
+ "Uacute": "\xda",
+ "uacute": "\xfa",
+ "Uacute;": "\xda",
+ "uacute;": "\xfa",
+ "Uarr;": "\u219f",
+ "uArr;": "\u21d1",
+ "uarr;": "\u2191",
+ "Uarrocir;": "\u2949",
+ "Ubrcy;": "\u040e",
+ "ubrcy;": "\u045e",
+ "Ubreve;": "\u016c",
+ "ubreve;": "\u016d",
+ "Ucirc": "\xdb",
+ "ucirc": "\xfb",
+ "Ucirc;": "\xdb",
+ "ucirc;": "\xfb",
+ "Ucy;": "\u0423",
+ "ucy;": "\u0443",
+ "udarr;": "\u21c5",
+ "Udblac;": "\u0170",
+ "udblac;": "\u0171",
+ "udhar;": "\u296e",
+ "ufisht;": "\u297e",
+ "Ufr;": "\U0001d518",
+ "ufr;": "\U0001d532",
+ "Ugrave": "\xd9",
+ "ugrave": "\xf9",
+ "Ugrave;": "\xd9",
+ "ugrave;": "\xf9",
+ "uHar;": "\u2963",
+ "uharl;": "\u21bf",
+ "uharr;": "\u21be",
+ "uhblk;": "\u2580",
+ "ulcorn;": "\u231c",
+ "ulcorner;": "\u231c",
+ "ulcrop;": "\u230f",
+ "ultri;": "\u25f8",
+ "Umacr;": "\u016a",
+ "umacr;": "\u016b",
+ "uml": "\xa8",
+ "uml;": "\xa8",
+ "UnderBar;": "_",
+ "UnderBrace;": "\u23df",
+ "UnderBracket;": "\u23b5",
+ "UnderParenthesis;": "\u23dd",
+ "Union;": "\u22c3",
+ "UnionPlus;": "\u228e",
+ "Uogon;": "\u0172",
+ "uogon;": "\u0173",
+ "Uopf;": "\U0001d54c",
+ "uopf;": "\U0001d566",
+ "UpArrow;": "\u2191",
+ "Uparrow;": "\u21d1",
+ "uparrow;": "\u2191",
+ "UpArrowBar;": "\u2912",
+ "UpArrowDownArrow;": "\u21c5",
+ "UpDownArrow;": "\u2195",
+ "Updownarrow;": "\u21d5",
+ "updownarrow;": "\u2195",
+ "UpEquilibrium;": "\u296e",
+ "upharpoonleft;": "\u21bf",
+ "upharpoonright;": "\u21be",
+ "uplus;": "\u228e",
+ "UpperLeftArrow;": "\u2196",
+ "UpperRightArrow;": "\u2197",
+ "Upsi;": "\u03d2",
+ "upsi;": "\u03c5",
+ "upsih;": "\u03d2",
+ "Upsilon;": "\u03a5",
+ "upsilon;": "\u03c5",
+ "UpTee;": "\u22a5",
+ "UpTeeArrow;": "\u21a5",
+ "upuparrows;": "\u21c8",
+ "urcorn;": "\u231d",
+ "urcorner;": "\u231d",
+ "urcrop;": "\u230e",
+ "Uring;": "\u016e",
+ "uring;": "\u016f",
+ "urtri;": "\u25f9",
+ "Uscr;": "\U0001d4b0",
+ "uscr;": "\U0001d4ca",
+ "utdot;": "\u22f0",
+ "Utilde;": "\u0168",
+ "utilde;": "\u0169",
+ "utri;": "\u25b5",
+ "utrif;": "\u25b4",
+ "uuarr;": "\u21c8",
+ "Uuml": "\xdc",
+ "uuml": "\xfc",
+ "Uuml;": "\xdc",
+ "uuml;": "\xfc",
+ "uwangle;": "\u29a7",
+ "vangrt;": "\u299c",
+ "varepsilon;": "\u03f5",
+ "varkappa;": "\u03f0",
+ "varnothing;": "\u2205",
+ "varphi;": "\u03d5",
+ "varpi;": "\u03d6",
+ "varpropto;": "\u221d",
+ "vArr;": "\u21d5",
+ "varr;": "\u2195",
+ "varrho;": "\u03f1",
+ "varsigma;": "\u03c2",
+ "varsubsetneq;": "\u228a\ufe00",
+ "varsubsetneqq;": "\u2acb\ufe00",
+ "varsupsetneq;": "\u228b\ufe00",
+ "varsupsetneqq;": "\u2acc\ufe00",
+ "vartheta;": "\u03d1",
+ "vartriangleleft;": "\u22b2",
+ "vartriangleright;": "\u22b3",
+ "Vbar;": "\u2aeb",
+ "vBar;": "\u2ae8",
+ "vBarv;": "\u2ae9",
+ "Vcy;": "\u0412",
+ "vcy;": "\u0432",
+ "VDash;": "\u22ab",
+ "Vdash;": "\u22a9",
+ "vDash;": "\u22a8",
+ "vdash;": "\u22a2",
+ "Vdashl;": "\u2ae6",
+ "Vee;": "\u22c1",
+ "vee;": "\u2228",
+ "veebar;": "\u22bb",
+ "veeeq;": "\u225a",
+ "vellip;": "\u22ee",
+ "Verbar;": "\u2016",
+ "verbar;": "|",
+ "Vert;": "\u2016",
+ "vert;": "|",
+ "VerticalBar;": "\u2223",
+ "VerticalLine;": "|",
+ "VerticalSeparator;": "\u2758",
+ "VerticalTilde;": "\u2240",
+ "VeryThinSpace;": "\u200a",
+ "Vfr;": "\U0001d519",
+ "vfr;": "\U0001d533",
+ "vltri;": "\u22b2",
+ "vnsub;": "\u2282\u20d2",
+ "vnsup;": "\u2283\u20d2",
+ "Vopf;": "\U0001d54d",
+ "vopf;": "\U0001d567",
+ "vprop;": "\u221d",
+ "vrtri;": "\u22b3",
+ "Vscr;": "\U0001d4b1",
+ "vscr;": "\U0001d4cb",
+ "vsubnE;": "\u2acb\ufe00",
+ "vsubne;": "\u228a\ufe00",
+ "vsupnE;": "\u2acc\ufe00",
+ "vsupne;": "\u228b\ufe00",
+ "Vvdash;": "\u22aa",
+ "vzigzag;": "\u299a",
+ "Wcirc;": "\u0174",
+ "wcirc;": "\u0175",
+ "wedbar;": "\u2a5f",
+ "Wedge;": "\u22c0",
+ "wedge;": "\u2227",
+ "wedgeq;": "\u2259",
+ "weierp;": "\u2118",
+ "Wfr;": "\U0001d51a",
+ "wfr;": "\U0001d534",
+ "Wopf;": "\U0001d54e",
+ "wopf;": "\U0001d568",
+ "wp;": "\u2118",
+ "wr;": "\u2240",
+ "wreath;": "\u2240",
+ "Wscr;": "\U0001d4b2",
+ "wscr;": "\U0001d4cc",
+ "xcap;": "\u22c2",
+ "xcirc;": "\u25ef",
+ "xcup;": "\u22c3",
+ "xdtri;": "\u25bd",
+ "Xfr;": "\U0001d51b",
+ "xfr;": "\U0001d535",
+ "xhArr;": "\u27fa",
+ "xharr;": "\u27f7",
+ "Xi;": "\u039e",
+ "xi;": "\u03be",
+ "xlArr;": "\u27f8",
+ "xlarr;": "\u27f5",
+ "xmap;": "\u27fc",
+ "xnis;": "\u22fb",
+ "xodot;": "\u2a00",
+ "Xopf;": "\U0001d54f",
+ "xopf;": "\U0001d569",
+ "xoplus;": "\u2a01",
+ "xotime;": "\u2a02",
+ "xrArr;": "\u27f9",
+ "xrarr;": "\u27f6",
+ "Xscr;": "\U0001d4b3",
+ "xscr;": "\U0001d4cd",
+ "xsqcup;": "\u2a06",
+ "xuplus;": "\u2a04",
+ "xutri;": "\u25b3",
+ "xvee;": "\u22c1",
+ "xwedge;": "\u22c0",
+ "Yacute": "\xdd",
+ "yacute": "\xfd",
+ "Yacute;": "\xdd",
+ "yacute;": "\xfd",
+ "YAcy;": "\u042f",
+ "yacy;": "\u044f",
+ "Ycirc;": "\u0176",
+ "ycirc;": "\u0177",
+ "Ycy;": "\u042b",
+ "ycy;": "\u044b",
+ "yen": "\xa5",
+ "yen;": "\xa5",
+ "Yfr;": "\U0001d51c",
+ "yfr;": "\U0001d536",
+ "YIcy;": "\u0407",
+ "yicy;": "\u0457",
+ "Yopf;": "\U0001d550",
+ "yopf;": "\U0001d56a",
+ "Yscr;": "\U0001d4b4",
+ "yscr;": "\U0001d4ce",
+ "YUcy;": "\u042e",
+ "yucy;": "\u044e",
+ "yuml": "\xff",
+ "Yuml;": "\u0178",
+ "yuml;": "\xff",
+ "Zacute;": "\u0179",
+ "zacute;": "\u017a",
+ "Zcaron;": "\u017d",
+ "zcaron;": "\u017e",
+ "Zcy;": "\u0417",
+ "zcy;": "\u0437",
+ "Zdot;": "\u017b",
+ "zdot;": "\u017c",
+ "zeetrf;": "\u2128",
+ "ZeroWidthSpace;": "\u200b",
+ "Zeta;": "\u0396",
+ "zeta;": "\u03b6",
+ "Zfr;": "\u2128",
+ "zfr;": "\U0001d537",
+ "ZHcy;": "\u0416",
+ "zhcy;": "\u0436",
+ "zigrarr;": "\u21dd",
+ "Zopf;": "\u2124",
+ "zopf;": "\U0001d56b",
+ "Zscr;": "\U0001d4b5",
+ "zscr;": "\U0001d4cf",
+ "zwj;": "\u200d",
+ "zwnj;": "\u200c",
}
# maps the Unicode code point to the HTML entity name
diff --git a/.venv3.10/Lib/html/parser.py b/.venv3.10/Lib/html/parser.py
index 8724c22f..bc6d181e 100644
--- a/.venv3.10/Lib/html/parser.py
+++ b/.venv3.10/Lib/html/parser.py
@@ -14,21 +14,21 @@
from html import unescape
-__all__ = ['HTMLParser']
+__all__ = ["HTMLParser"]
# Regular expressions used for parsing
-interesting_normal = re.compile('[&<]')
-incomplete = re.compile('&[a-zA-Z#]')
+interesting_normal = re.compile("[&<]")
+incomplete = re.compile("&[a-zA-Z#]")
-entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]')
-charref = re.compile('(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]')
+entityref = re.compile("&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]")
+charref = re.compile("(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]")
-starttagopen = re.compile('<[a-zA-Z]')
-endtagopen = re.compile('[a-zA-Z]')
-piclose = re.compile('>')
-commentclose = re.compile(r'--!?>')
-commentabruptclose = re.compile(r'-?>')
+starttagopen = re.compile("<[a-zA-Z]")
+endtagopen = re.compile("[a-zA-Z]")
+piclose = re.compile(">")
+commentclose = re.compile(r"--!?>")
+commentabruptclose = re.compile(r"-?>")
# Note:
# 1) if you change tagfind/attrfind remember to update locatetagend too;
# 2) if you change tagfind/attrfind and/or locatetagend the parser will
@@ -38,7 +38,7 @@
# https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
# https://html.spec.whatwg.org/multipage/parsing.html#tag-name-state
# https://html.spec.whatwg.org/multipage/parsing.html#attribute-name-state
-tagfind_tolerant = re.compile(r'([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*')
+tagfind_tolerant = re.compile(r"([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*")
attrfind_tolerant = re.compile(r"""
(
(?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]* # attribute name
@@ -82,8 +82,8 @@
)?
\s* # trailing whitespace
""", re.VERBOSE)
-endendtag = re.compile('>')
-endtagfind = re.compile(r'\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>')
+endendtag = re.compile(">")
+endtagfind = re.compile(r"\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>")
@@ -123,8 +123,8 @@ def __init__(self, *, convert_charrefs=True):
def reset(self):
"""Reset this instance. Loses all unprocessed data."""
- self.rawdata = ''
- self.lasttag = '???'
+ self.rawdata = ""
+ self.lasttag = "???"
self.interesting = interesting_normal
self.cdata_elem = None
self._support_cdata = True
@@ -154,10 +154,10 @@ def set_cdata_mode(self, elem, *, escapable=False):
self.cdata_elem = elem.lower()
self._escapable = escapable
if escapable and not self.convert_charrefs:
- self.interesting = re.compile(r'&|%s(?=[\t\n\r\f />])' % self.cdata_elem,
+ self.interesting = re.compile(r"&|%s(?=[\t\n\r\f />])" % self.cdata_elem,
re.IGNORECASE|re.ASCII)
else:
- self.interesting = re.compile(r'%s(?=[\t\n\r\f />])' % self.cdata_elem,
+ self.interesting = re.compile(r"%s(?=[\t\n\r\f />])" % self.cdata_elem,
re.IGNORECASE|re.ASCII)
def clear_cdata_mode(self):
@@ -187,7 +187,7 @@ def goahead(self, end):
n = len(rawdata)
while i < n:
if self.convert_charrefs and not self.cdata_elem:
- j = rawdata.find('<', i)
+ j = rawdata.find("<", i)
if j < 0:
# if we can't find the next <, either we are at the end
# or there's more text incoming. If the latter is True,
@@ -195,9 +195,9 @@ def goahead(self, end):
# a charref cut in half at end. Try to determine if
# this is the case before proceeding by looking for an
# & near the end and see if it's followed by a space or ;.
- amppos = rawdata.rfind('&', max(i, n-34))
+ amppos = rawdata.rfind("&", max(i, n-34))
if (amppos >= 0 and
- not re.compile(r'[\t\n\r\f ;]').search(rawdata, amppos)):
+ not re.compile(r"[\t\n\r\f ;]").search(rawdata, amppos)):
break # wait till we get all the text
j = n
else:
@@ -216,7 +216,7 @@ def goahead(self, end):
i = self.updatepos(i, j)
if i == n: break
startswith = rawdata.startswith
- if startswith('<', i):
+ if startswith("<", i):
if starttagopen.match(rawdata, i): # < + letter
k = self.parse_starttag(i)
elif startswith("", i):
@@ -254,7 +254,7 @@ def goahead(self, end):
self.handle_comment(rawdata[i+4:j])
elif startswith("', i+9)
+ elif rawdata[i:i+9] == "", i+9)
if j < 0:
return -1
self.unknown_decl(rawdata[i+3: j])
return j + 3
- elif rawdata[i:i+9].lower() == '
- gtpos = rawdata.find('>', i+9)
+ gtpos = rawdata.find(">", i+9)
if gtpos == -1:
return -1
self.handle_decl(rawdata[i+2:gtpos])
return gtpos+1
- elif rawdata[i:i+3] == '', i+3)
+ elif rawdata[i:i+3] == "", i+3)
if j < 0:
return -1
- if rawdata[j-1] == ']':
+ if rawdata[j-1] == "]":
self.unknown_decl(rawdata[i+3: j-1])
else:
self.handle_comment(rawdata[i+2: j])
@@ -357,7 +357,7 @@ def parse_html_declaration(self, i):
# see https://html.spec.whatwg.org/multipage/parsing.html#comment-start-state
def parse_comment(self, i, report=True):
rawdata = self.rawdata
- assert rawdata.startswith(')|(<[^>]*>)|([^<]+)', re.DOTALL)
- texts = (match.group(3) or '' for match in html_stripper.finditer(s))
- return ''.join(texts)
+ html_stripper = re.compile("()|(<[^>]*>)|([^<]+)", re.DOTALL)
+ texts = (match.group(3) or "" for match in html_stripper.finditer(s))
+ return "".join(texts)
class SeparatedValues(str):
@@ -424,7 +424,7 @@ class SeparatedValues(str):
['a', 'b', 'c']
"""
- separator = ','
+ separator = ","
def __iter__(self):
parts = self.split(self.separator)
@@ -524,13 +524,13 @@ def normalize_newlines(text):
>>> normalize_newlines('Lorem Ipsum\x85')
'Lorem Ipsum\n'
"""
- newlines = ['\r\n', '\r', '\n', '\u0085', '\u2028', '\u2029']
- pattern = '|'.join(newlines)
- return re.sub(pattern, '\n', text)
+ newlines = ["\r\n", "\r", "\n", "\u0085", "\u2028", "\u2029"]
+ pattern = "|".join(newlines)
+ return re.sub(pattern, "\n", text)
def _nonblank(str):
- return str and not str.startswith('#')
+ return str and not str.startswith("#")
@functools.singledispatch
@@ -569,7 +569,7 @@ def drop_comment(line):
>>> drop_comment('http://example.com/foo#bar')
'http://example.com/foo#bar'
"""
- return line.partition(' #')[0]
+ return line.partition(" #")[0]
def join_continuation(lines):
@@ -597,7 +597,7 @@ def join_continuation(lines):
"""
lines = iter(lines)
for item in lines:
- while item.endswith('\\'):
+ while item.endswith("\\"):
try:
item = item[:-2].strip() + next(lines)
except StopIteration:
@@ -619,6 +619,6 @@ def read_newlines(filename, limit=1024):
>>> read_newlines(filename)
('\r', '\n', '\r\n')
"""
- with open(filename, encoding='utf-8') as fp:
+ with open(filename, encoding="utf-8") as fp:
fp.read(limit)
return fp.newlines
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-dvorak.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-dvorak.py
index a6d5da80..245da8d0 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-dvorak.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-dvorak.py
@@ -3,4 +3,4 @@
from . import layouts
-__name__ == '__main__' and layouts._translate_stream(sys.stdin, layouts.to_dvorak)
+__name__ == "__main__" and layouts._translate_stream(sys.stdin, layouts.to_dvorak)
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-qwerty.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-qwerty.py
index abe27286..296e6fac 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-qwerty.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/jaraco/text/to-qwerty.py
@@ -3,4 +3,4 @@
from . import layouts
-__name__ == '__main__' and layouts._translate_stream(sys.stdin, layouts.to_qwerty)
+__name__ == "__main__" and layouts._translate_stream(sys.stdin, layouts.to_qwerty)
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py
index 9c4662fc..efb06b2a 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py
@@ -3,4 +3,4 @@
from .more import * # noqa
from .recipes import * # noqa
-__version__ = '10.3.0'
+__version__ = "10.3.0"
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.py
index 7b481907..bf055c40 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.py
@@ -43,120 +43,120 @@
)
__all__ = [
- 'AbortThread',
- 'SequenceView',
- 'UnequalIterablesError',
- 'adjacent',
- 'all_unique',
- 'always_iterable',
- 'always_reversible',
- 'bucket',
- 'callback_iter',
- 'chunked',
- 'chunked_even',
- 'circular_shifts',
- 'collapse',
- 'combination_index',
- 'combination_with_replacement_index',
- 'consecutive_groups',
- 'constrained_batches',
- 'consumer',
- 'count_cycle',
- 'countable',
- 'dft',
- 'difference',
- 'distinct_combinations',
- 'distinct_permutations',
- 'distribute',
- 'divide',
- 'doublestarmap',
- 'duplicates_everseen',
- 'duplicates_justseen',
- 'classify_unique',
- 'exactly_n',
- 'filter_except',
- 'filter_map',
- 'first',
- 'gray_product',
- 'groupby_transform',
- 'ichunked',
- 'iequals',
- 'idft',
- 'ilen',
- 'interleave',
- 'interleave_evenly',
- 'interleave_longest',
- 'intersperse',
- 'is_sorted',
- 'islice_extended',
- 'iterate',
- 'iter_suppress',
- 'join_mappings',
- 'last',
- 'locate',
- 'longest_common_prefix',
- 'lstrip',
- 'make_decorator',
- 'map_except',
- 'map_if',
- 'map_reduce',
- 'mark_ends',
- 'minmax',
- 'nth_or_last',
- 'nth_permutation',
- 'nth_product',
- 'nth_combination_with_replacement',
- 'numeric_range',
- 'one',
- 'only',
- 'outer_product',
- 'padded',
- 'partial_product',
- 'partitions',
- 'peekable',
- 'permutation_index',
- 'powerset_of_sets',
- 'product_index',
- 'raise_',
- 'repeat_each',
- 'repeat_last',
- 'replace',
- 'rlocate',
- 'rstrip',
- 'run_length',
- 'sample',
- 'seekable',
- 'set_partitions',
- 'side_effect',
- 'sliced',
- 'sort_together',
- 'split_after',
- 'split_at',
- 'split_before',
- 'split_into',
- 'split_when',
- 'spy',
- 'stagger',
- 'strip',
- 'strictly_n',
- 'substrings',
- 'substrings_indexes',
- 'takewhile_inclusive',
- 'time_limited',
- 'unique_in_window',
- 'unique_to_each',
- 'unzip',
- 'value_chain',
- 'windowed',
- 'windowed_complete',
- 'with_iter',
- 'zip_broadcast',
- 'zip_equal',
- 'zip_offset',
+ "AbortThread",
+ "SequenceView",
+ "UnequalIterablesError",
+ "adjacent",
+ "all_unique",
+ "always_iterable",
+ "always_reversible",
+ "bucket",
+ "callback_iter",
+ "chunked",
+ "chunked_even",
+ "circular_shifts",
+ "collapse",
+ "combination_index",
+ "combination_with_replacement_index",
+ "consecutive_groups",
+ "constrained_batches",
+ "consumer",
+ "count_cycle",
+ "countable",
+ "dft",
+ "difference",
+ "distinct_combinations",
+ "distinct_permutations",
+ "distribute",
+ "divide",
+ "doublestarmap",
+ "duplicates_everseen",
+ "duplicates_justseen",
+ "classify_unique",
+ "exactly_n",
+ "filter_except",
+ "filter_map",
+ "first",
+ "gray_product",
+ "groupby_transform",
+ "ichunked",
+ "iequals",
+ "idft",
+ "ilen",
+ "interleave",
+ "interleave_evenly",
+ "interleave_longest",
+ "intersperse",
+ "is_sorted",
+ "islice_extended",
+ "iterate",
+ "iter_suppress",
+ "join_mappings",
+ "last",
+ "locate",
+ "longest_common_prefix",
+ "lstrip",
+ "make_decorator",
+ "map_except",
+ "map_if",
+ "map_reduce",
+ "mark_ends",
+ "minmax",
+ "nth_or_last",
+ "nth_permutation",
+ "nth_product",
+ "nth_combination_with_replacement",
+ "numeric_range",
+ "one",
+ "only",
+ "outer_product",
+ "padded",
+ "partial_product",
+ "partitions",
+ "peekable",
+ "permutation_index",
+ "powerset_of_sets",
+ "product_index",
+ "raise_",
+ "repeat_each",
+ "repeat_last",
+ "replace",
+ "rlocate",
+ "rstrip",
+ "run_length",
+ "sample",
+ "seekable",
+ "set_partitions",
+ "side_effect",
+ "sliced",
+ "sort_together",
+ "split_after",
+ "split_at",
+ "split_before",
+ "split_into",
+ "split_when",
+ "spy",
+ "stagger",
+ "strip",
+ "strictly_n",
+ "substrings",
+ "substrings_indexes",
+ "takewhile_inclusive",
+ "time_limited",
+ "unique_in_window",
+ "unique_to_each",
+ "unzip",
+ "value_chain",
+ "windowed",
+ "windowed_complete",
+ "with_iter",
+ "zip_broadcast",
+ "zip_equal",
+ "zip_offset",
]
# math.sumprod is available for Python 3.12+
-_fsumprod = getattr(math, 'sumprod', lambda x, y: fsum(map(mul, x, y)))
+_fsumprod = getattr(math, "sumprod", lambda x, y: fsum(map(mul, x, y)))
def chunked(iterable, n, strict=False):
@@ -181,12 +181,12 @@ def chunked(iterable, n, strict=False):
iterator = iter(partial(take, n, iter(iterable)), [])
if strict:
if n is None:
- raise ValueError('n must not be None when using strict mode.')
+ raise ValueError("n must not be None when using strict mode.")
def ret():
for chunk in iterator:
if len(chunk) != n:
- raise ValueError('iterable is not divisible by n.')
+ raise ValueError("iterable is not divisible by n.")
yield chunk
return iter(ret())
@@ -215,8 +215,8 @@ def first(iterable, default=_marker):
return item
if default is _marker:
raise ValueError(
- 'first() was called on an empty iterable, and no '
- 'default value was provided.'
+ "first() was called on an empty iterable, and no "
+ "default value was provided."
)
return default
@@ -237,15 +237,15 @@ def last(iterable, default=_marker):
if isinstance(iterable, Sequence):
return iterable[-1]
# Work around https://bugs.python.org/issue38525
- elif hasattr(iterable, '__reversed__') and (hexversion != 0x030800F0):
+ elif hasattr(iterable, "__reversed__") and (hexversion != 0x030800F0):
return next(reversed(iterable))
else:
return deque(iterable, maxlen=1)[-1]
except (IndexError, TypeError, StopIteration):
if default is _marker:
raise ValueError(
- 'last() was called on an empty iterable, and no default was '
- 'provided.'
+ "last() was called on an empty iterable, and no default was "
+ "provided."
)
return default
@@ -403,7 +403,7 @@ def _get_slice(self, index):
start = -1 if (index.start is None) else index.start
stop = (-maxsize - 1) if (index.stop is None) else index.stop
else:
- raise ValueError('slice step cannot be zero')
+ raise ValueError("slice step cannot be zero")
# If either the start or stop index is negative, we'll need to cache
# the rest of the iterable in order to slice from the right side.
@@ -562,7 +562,7 @@ def one(iterable, too_short=None, too_long=None):
first_value = next(it)
except StopIteration as exc:
raise (
- too_short or ValueError('too few items in iterable (expected 1)')
+ too_short or ValueError("too few items in iterable (expected 1)")
) from exc
try:
@@ -571,8 +571,8 @@ def one(iterable, too_short=None, too_long=None):
pass
else:
msg = (
- 'Expected exactly one item in iterable, but got {!r}, {!r}, '
- 'and perhaps more.'.format(first_value, second_value)
+ "Expected exactly one item in iterable, but got {!r}, {!r}, "
+ "and perhaps more.".format(first_value, second_value)
)
raise too_long or ValueError(msg)
@@ -633,13 +633,13 @@ def strictly_n(iterable, n, too_short=None, too_long=None):
if too_short is None:
too_short = lambda item_count: raise_(
ValueError,
- 'Too few items in iterable (got {})'.format(item_count),
+ "Too few items in iterable (got {})".format(item_count),
)
if too_long is None:
too_long = lambda item_count: raise_(
ValueError,
- 'Too many items in iterable (got at least {})'.format(item_count),
+ "Too many items in iterable (got at least {})".format(item_count),
)
it = iter(iterable)
@@ -773,7 +773,7 @@ def intersperse(e, iterable, n=1):
"""
if n == 0:
- raise ValueError('n must be > 0')
+ raise ValueError("n must be > 0")
elif n == 1:
# interleave(repeat(e), iterable) -> e, x_0, e, x_1, e, x_2...
# islice(..., 1, None) -> x_0, e, x_1, e, x_2...
@@ -848,12 +848,12 @@ def windowed(seq, n, fillvalue=None, step=1):
[(None, None, 1), (None, 1, 2), (1, 2, 3), (2, 3, 4)]
"""
if n < 0:
- raise ValueError('n must be >= 0')
+ raise ValueError("n must be >= 0")
if n == 0:
yield ()
return
if step < 1:
- raise ValueError('step must be >= 1')
+ raise ValueError("step must be >= 1")
iterable = iter(seq)
@@ -1136,11 +1136,11 @@ def interleave_evenly(iterables, lengths=None):
lengths = [len(it) for it in iterables]
except TypeError:
raise ValueError(
- 'Iterable lengths could not be determined automatically. '
- 'Specify them with the lengths keyword.'
+ "Iterable lengths could not be determined automatically. "
+ "Specify them with the lengths keyword."
)
elif len(iterables) != len(lengths):
- raise ValueError('Mismatching number of iterables and lengths.')
+ raise ValueError("Mismatching number of iterables and lengths.")
dims = len(lengths)
@@ -1565,7 +1565,7 @@ def padded(iterable, fillvalue=None, n=None, next_multiple=False):
if n is None:
return iterable_with_repeat
elif n < 1:
- raise ValueError('n must be at least 1')
+ raise ValueError("n must be at least 1")
elif next_multiple:
def slice_generator():
@@ -1639,7 +1639,7 @@ def distribute(n, iterable):
"""
if n < 1:
- raise ValueError('n must be at least 1')
+ raise ValueError("n must be at least 1")
children = tee(iterable, n)
return [islice(it, index, None, n) for index, it in enumerate(children)]
@@ -1694,9 +1694,9 @@ def zip_equal(*iterables):
if hexversion >= 0x30A00A6:
warnings.warn(
(
- 'zip_equal will be removed in a future version of '
- 'more-itertools. Use the builtin zip function with '
- 'strict=True instead.'
+ "zip_equal will be removed in a future version of "
+ "more-itertools. Use the builtin zip function with "
+ "strict=True instead."
),
DeprecationWarning,
)
@@ -1888,7 +1888,7 @@ def divide(n, iterable):
"""
if n < 1:
- raise ValueError('n must be at least 1')
+ raise ValueError("n must be at least 1")
try:
iterable[:0]
@@ -1992,7 +1992,7 @@ def adjacent(predicate, iterable, distance=1):
"""
# Allow distance=0 mainly for testing that it reproduces results with map()
if distance < 0:
- raise ValueError('distance must be at least 0')
+ raise ValueError("distance must be at least 0")
i1, i2 = tee(iterable)
padding = [False] * distance
@@ -2113,18 +2113,18 @@ def __init__(self, *args):
self._start, self._stop, self._step = args
elif argc == 0:
raise TypeError(
- 'numeric_range expected at least '
- '1 argument, got {}'.format(argc)
+ "numeric_range expected at least "
+ "1 argument, got {}".format(argc)
)
else:
raise TypeError(
- 'numeric_range expected at most '
- '3 arguments, got {}'.format(argc)
+ "numeric_range expected at most "
+ "3 arguments, got {}".format(argc)
)
self._zero = type(self._step)(0)
if self._step == self._zero:
- raise ValueError('numeric_range() arg 3 must not be zero')
+ raise ValueError("numeric_range() arg 3 must not be zero")
self._growing = self._step > self._zero
def __bool__(self):
@@ -2181,8 +2181,8 @@ def __getitem__(self, key):
return numeric_range(start, stop, step)
else:
raise TypeError(
- 'numeric range indices must be '
- 'integers or slices, not {}'.format(type(key).__name__)
+ "numeric range indices must be "
+ "integers or slices, not {}".format(type(key).__name__)
)
def __hash__(self):
@@ -2358,7 +2358,7 @@ def locate(iterable, pred=bool, window_size=None):
return compress(count(), map(pred, iterable))
if window_size < 1:
- raise ValueError('window size must be at least 1')
+ raise ValueError("window size must be at least 1")
it = windowed(iterable, window_size, fillvalue=_marker)
return compress(count(), starmap(pred, it))
@@ -2478,14 +2478,14 @@ def __getitem__(self, key):
if isinstance(key, slice):
return islice_extended(_islice_helper(self._iterable, key))
- raise TypeError('islice_extended.__getitem__ argument must be a slice')
+ raise TypeError("islice_extended.__getitem__ argument must be a slice")
def _islice_helper(it, s):
start = s.start
stop = s.stop
if s.step == 0:
- raise ValueError('step argument must be a non-zero integer or None.')
+ raise ValueError("step argument must be a non-zero integer or None.")
step = s.step or 1
if step > 0:
@@ -2727,7 +2727,7 @@ def __len__(self):
return len(self._target)
def __repr__(self):
- return '{}({})'.format(self.__class__.__name__, repr(self._target))
+ return "{}({})".format(self.__class__.__name__, repr(self._target))
class seekable:
@@ -3140,7 +3140,7 @@ def replace(iterable, pred, substitutes, count=None, window_size=1):
"""
if window_size < 1:
- raise ValueError('window_size must be at least 1')
+ raise ValueError("window_size must be at least 1")
# Save the substitutes iterable, since it's used more than once
substitutes = tuple(substitutes)
@@ -3276,7 +3276,7 @@ class time_limited:
def __init__(self, limit_seconds, iterable):
if limit_seconds < 0:
- raise ValueError('limit_seconds must be positive')
+ raise ValueError("limit_seconds must be positive")
self.limit_seconds = limit_seconds
self._iterable = iter(iterable)
self._start_time = monotonic()
@@ -3330,8 +3330,8 @@ def only(iterable, default=None, too_long=None):
pass
else:
msg = (
- 'Expected exactly one item in iterable, but got {!r}, {!r}, '
- 'and perhaps more.'.format(first_value, second_value)
+ "Expected exactly one item in iterable, but got {!r}, {!r}, "
+ "and perhaps more.".format(first_value, second_value)
)
raise too_long or ValueError(msg)
@@ -3440,7 +3440,7 @@ def distinct_combinations(iterable, r):
"""
if r < 0:
- raise ValueError('r must be non-negative')
+ raise ValueError("r must be non-negative")
elif r == 0:
yield ()
return
@@ -3713,7 +3713,7 @@ class callback_iter:
"""
- def __init__(self, func, callback_kwd='callback', wait_seconds=0.1):
+ def __init__(self, func, callback_kwd="callback", wait_seconds=0.1):
self._func = func
self._callback_kwd = callback_kwd
self._aborted = False
@@ -3721,7 +3721,7 @@ def __init__(self, func, callback_kwd='callback', wait_seconds=0.1):
self._wait_seconds = wait_seconds
# Lazily import concurrent.future
self._executor = __import__(
- 'concurrent.futures'
+ "concurrent.futures"
).futures.ThreadPoolExecutor(max_workers=1)
self._iterator = self._reader()
@@ -3747,7 +3747,7 @@ def done(self):
@property
def result(self):
if not self.done:
- raise RuntimeError('Function has not yet completed')
+ raise RuntimeError("Function has not yet completed")
return self._future.result()
@@ -3756,7 +3756,7 @@ def _reader(self):
def callback(*args, **kwargs):
if self._aborted:
- raise AbortThread('canceled by user')
+ raise AbortThread("canceled by user")
q.put((args, kwargs))
@@ -3814,13 +3814,13 @@ def windowed_complete(iterable, n):
storage.
"""
if n < 0:
- raise ValueError('n must be >= 0')
+ raise ValueError("n must be >= 0")
seq = tuple(iterable)
size = len(seq)
if n > size:
- raise ValueError('n must be <= len(seq)')
+ raise ValueError("n must be <= len(seq)")
for i in range(size - n + 1):
beginning = seq[:i]
@@ -4036,7 +4036,7 @@ def product_index(element, *args):
for x, pool in zip_longest(element, args, fillvalue=_marker):
if x is _marker or pool is _marker:
- raise ValueError('element is not a product of args')
+ raise ValueError("element is not a product of args")
pool = tuple(pool)
index = index * len(pool) + pool.index(x)
@@ -4073,7 +4073,7 @@ def combination_index(element, iterable):
else:
k = tmp
else:
- raise ValueError('element is not a combination of iterable')
+ raise ValueError("element is not a combination of iterable")
n, _ = last(pool, default=(n, None))
@@ -4124,7 +4124,7 @@ def combination_with_replacement_index(element, iterable):
break
else:
raise ValueError(
- 'element is not a combination with replacement of iterable'
+ "element is not a combination with replacement of iterable"
)
n = len(pool)
@@ -4324,7 +4324,7 @@ def unique_in_window(iterable, n, key=None):
"""
if n <= 0:
- raise ValueError('n must be greater than 0')
+ raise ValueError("n must be greater than 0")
window = deque(maxlen=n)
counts = defaultdict(int)
@@ -4469,8 +4469,8 @@ def minmax(iterable_or_value, *others, key=None, default=_marker):
except StopIteration as exc:
if default is _marker:
raise ValueError(
- '`minmax()` argument is an empty iterable. '
- 'Provide a `default` value to suppress this error.'
+ "`minmax()` argument is an empty iterable. "
+ "Provide a `default` value to suppress this error."
) from exc
return default
@@ -4526,7 +4526,7 @@ def constrained_batches(
than *max_size*. Otherwise, allow single items to exceed *max_size*.
"""
if max_size <= 0:
- raise ValueError('maximum size must be greater than zero')
+ raise ValueError("maximum size must be greater than zero")
batch = []
batch_size = 0
@@ -4534,7 +4534,7 @@ def constrained_batches(
for item in iterable:
item_len = get_len(item)
if strict and item_len > max_size:
- raise ValueError('item size exceeds maximum size')
+ raise ValueError("item size exceeds maximum size")
reached_count = batch_count == max_count
reached_size = item_len + batch_size > max_size
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi
index e9460232..63f1211f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/more.pyi
@@ -10,7 +10,6 @@ from typing import (
ContextManager,
Generic,
Hashable,
- Mapping,
Iterable,
Iterator,
Mapping,
@@ -25,14 +24,14 @@ from typing import (
from typing_extensions import Protocol
# Type and type variable definitions
-_T = TypeVar('_T')
-_T1 = TypeVar('_T1')
-_T2 = TypeVar('_T2')
-_U = TypeVar('_U')
-_V = TypeVar('_V')
-_W = TypeVar('_W')
-_T_co = TypeVar('_T_co', covariant=True)
-_GenFn = TypeVar('_GenFn', bound=Callable[..., Iterator[Any]])
+_T = TypeVar("_T")
+_T1 = TypeVar("_T1")
+_T2 = TypeVar("_T2")
+_U = TypeVar("_U")
+_V = TypeVar("_V")
+_W = TypeVar("_W")
+_T_co = TypeVar("_T_co", covariant=True)
+_GenFn = TypeVar("_GenFn", bound=Callable[..., Iterator[Any]])
_Raisable = BaseException | Type[BaseException]
@type_check_only
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py
index b32fa955..5d5edd68 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py
@@ -32,52 +32,52 @@
from sys import hexversion
__all__ = [
- 'all_equal',
- 'batched',
- 'before_and_after',
- 'consume',
- 'convolve',
- 'dotproduct',
- 'first_true',
- 'factor',
- 'flatten',
- 'grouper',
- 'iter_except',
- 'iter_index',
- 'matmul',
- 'ncycles',
- 'nth',
- 'nth_combination',
- 'padnone',
- 'pad_none',
- 'pairwise',
- 'partition',
- 'polynomial_eval',
- 'polynomial_from_roots',
- 'polynomial_derivative',
- 'powerset',
- 'prepend',
- 'quantify',
- 'reshape',
- 'random_combination_with_replacement',
- 'random_combination',
- 'random_permutation',
- 'random_product',
- 'repeatfunc',
- 'roundrobin',
- 'sieve',
- 'sliding_window',
- 'subslices',
- 'sum_of_squares',
- 'tabulate',
- 'tail',
- 'take',
- 'totient',
- 'transpose',
- 'triplewise',
- 'unique',
- 'unique_everseen',
- 'unique_justseen',
+ "all_equal",
+ "batched",
+ "before_and_after",
+ "consume",
+ "convolve",
+ "dotproduct",
+ "first_true",
+ "factor",
+ "flatten",
+ "grouper",
+ "iter_except",
+ "iter_index",
+ "matmul",
+ "ncycles",
+ "nth",
+ "nth_combination",
+ "padnone",
+ "pad_none",
+ "pairwise",
+ "partition",
+ "polynomial_eval",
+ "polynomial_from_roots",
+ "polynomial_derivative",
+ "powerset",
+ "prepend",
+ "quantify",
+ "reshape",
+ "random_combination_with_replacement",
+ "random_combination",
+ "random_permutation",
+ "random_product",
+ "repeatfunc",
+ "roundrobin",
+ "sieve",
+ "sliding_window",
+ "subslices",
+ "sum_of_squares",
+ "tabulate",
+ "tail",
+ "take",
+ "totient",
+ "transpose",
+ "triplewise",
+ "unique",
+ "unique_everseen",
+ "unique_justseen",
]
_marker = object()
@@ -92,7 +92,7 @@
_zip_strict = partial(zip, strict=True)
# math.sumprod is available for Python 3.12+
-_sumprod = getattr(math, 'sumprod', lambda x, y: dotproduct(x, y))
+_sumprod = getattr(math, "sumprod", lambda x, y: dotproduct(x, y))
def take(n, iterable):
@@ -335,9 +335,9 @@ def pairwise(iterable):
class UnequalIterablesError(ValueError):
def __init__(self, details=None):
- msg = 'Iterables have different lengths'
+ msg = "Iterables have different lengths"
if details is not None:
- msg += (': index 0 has length {}; index {} has length {}').format(
+ msg += (": index 0 has length {}; index {} has length {}").format(
*details
)
@@ -368,7 +368,7 @@ def _zip_equal(*iterables):
return _zip_equal_generator(iterables)
-def grouper(iterable, n, incomplete='fill', fillvalue=None):
+def grouper(iterable, n, incomplete="fill", fillvalue=None):
"""Group elements from *iterable* into fixed-length groups of length *n*.
>>> list(grouper('ABCDEF', 3))
@@ -398,14 +398,14 @@ def grouper(iterable, n, incomplete='fill', fillvalue=None):
"""
args = [iter(iterable)] * n
- if incomplete == 'fill':
+ if incomplete == "fill":
return zip_longest(*args, fillvalue=fillvalue)
- if incomplete == 'strict':
+ if incomplete == "strict":
return _zip_equal(*args)
- if incomplete == 'ignore':
+ if incomplete == "ignore":
return zip(*args)
else:
- raise ValueError('Expected fill, strict, or ignore')
+ raise ValueError("Expected fill, strict, or ignore")
def roundrobin(*iterables):
@@ -869,7 +869,7 @@ def iter_index(iterable, value, start=0, stop=None):
associated with particular values.
"""
- seq_index = getattr(iterable, 'index', None)
+ seq_index = getattr(iterable, "index", None)
if seq_index is None:
# Slow path for general iterables
it = islice(iterable, start, stop)
@@ -917,11 +917,11 @@ def _batched(iterable, n, *, strict=False):
On Python 3.13 and above, this is an alias for :func:`itertools.batched`.
"""
if n < 1:
- raise ValueError('n must be at least one')
+ raise ValueError("n must be at least one")
it = iter(iterable)
while batch := tuple(islice(it, n)):
if strict and len(batch) != n:
- raise ValueError('batched(): incomplete batch')
+ raise ValueError("batched(): incomplete batch")
yield batch
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi
index 739acec0..bdb8afec 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.pyi
@@ -14,10 +14,10 @@ from typing import (
)
# Type and type variable definitions
-_T = TypeVar('_T')
-_T1 = TypeVar('_T1')
-_T2 = TypeVar('_T2')
-_U = TypeVar('_U')
+_T = TypeVar("_T")
+_T1 = TypeVar("_T1")
+_T2 = TypeVar("_T2")
+_U = TypeVar("_U")
def take(n: int, iterable: Iterable[_T]) -> list[_T]: ...
def tabulate(
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/licenses/__init__.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/licenses/__init__.py
index 569156d6..5382e744 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/licenses/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/licenses/__init__.py
@@ -140,6 +140,6 @@ def canonicalize_license_expression(
normalized_expression = " ".join(normalized_tokens)
return cast(
- NormalizedLicenseExpression,
+ "NormalizedLicenseExpression",
normalized_expression.replace("( ", "(").replace(" )", ")"),
)
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/metadata.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/metadata.py
index 721f411c..97c1a343 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/metadata.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/packaging/metadata.py
@@ -443,7 +443,7 @@ def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]:
# Check to see if we've already got a description, if so then both
# it, and this body move to unparseable.
if "description" in raw:
- description_header = cast(str, raw.pop("description"))
+ description_header = cast("str", raw.pop("description"))
unparsed.setdefault("description", []).extend(
[description_header, payload]
)
@@ -456,7 +456,7 @@ def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]:
# literal key names, but we're computing our key names on purpose, but the
# way this function is implemented, our `TypedDict` can only have valid key
# names.
- return cast(RawMetadata, raw), unparsed
+ return cast("RawMetadata", raw), unparsed
_NOT_FOUND = object()
@@ -519,7 +519,7 @@ def __get__(self, instance: Metadata, _owner: type[Metadata]) -> T:
except KeyError:
pass
- return cast(T, value)
+ return cast("T", value)
def _invalid_metadata(
self, msg: str, cause: Exception | None = None
@@ -534,7 +534,7 @@ def _process_metadata_version(self, value: str) -> _MetadataVersion:
# Implicitly makes Metadata-Version required.
if value not in _VALID_METADATA_VERSIONS:
raise self._invalid_metadata(f"{value!r} is not a valid metadata version")
- return cast(_MetadataVersion, value)
+ return cast("_MetadataVersion", value)
def _process_name(self, value: str) -> str:
if not value:
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/android.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/android.py
index afd3141c..65c01843 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/android.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/android.py
@@ -23,7 +23,7 @@ class Android(PlatformDirsABC):
@property
def user_data_dir(self) -> str:
""":return: data directory tied to the user, e.g. ``/data/user///files/``"""
- return self._append_app_name_and_version(cast(str, _android_folder()), "files")
+ return self._append_app_name_and_version(cast("str", _android_folder()), "files")
@property
def site_data_dir(self) -> str:
@@ -36,7 +36,7 @@ def user_config_dir(self) -> str:
:return: config directory tied to the user, e.g. \
``/data/user///shared_prefs/``
"""
- return self._append_app_name_and_version(cast(str, _android_folder()), "shared_prefs")
+ return self._append_app_name_and_version(cast("str", _android_folder()), "shared_prefs")
@property
def site_config_dir(self) -> str:
@@ -46,7 +46,7 @@ def site_config_dir(self) -> str:
@property
def user_cache_dir(self) -> str:
""":return: cache directory tied to the user, e.g.,``/data/user///cache/``"""
- return self._append_app_name_and_version(cast(str, _android_folder()), "cache")
+ return self._append_app_name_and_version(cast("str", _android_folder()), "cache")
@property
def site_cache_dir(self) -> str:
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/version.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/version.py
index 6483ddce..4e886e46 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/version.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/platformdirs/version.py
@@ -12,5 +12,5 @@
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
-__version__ = version = '4.2.2'
+__version__ = version = "4.2.2"
__version_tuple__ = version_tuple = (4, 2, 2)
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_decorators.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_decorators.py
index cf325335..c61ee48c 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_decorators.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_decorators.py
@@ -99,9 +99,9 @@ def instrument(f: T_CallableOrType) -> FunctionType | str:
closure = f.__closure__
if new_code.co_freevars != f.__code__.co_freevars:
# Create a new closure and find values for the new free variables
- frame = cast(FrameType, inspect.currentframe())
- frame = cast(FrameType, frame.f_back)
- frame_locals = cast(FrameType, frame.f_back).f_locals
+ frame = cast("FrameType", inspect.currentframe())
+ frame = cast("FrameType", frame.f_back)
+ frame_locals = cast("FrameType", frame.f_back).f_locals
cells: list[_Cell] = []
for key in new_code.co_freevars:
if key in instrumentor.names_used_in_annotations:
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_transformer.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_transformer.py
index 13ac3630..93372a97 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_transformer.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_transformer.py
@@ -421,12 +421,12 @@ def visit_Subscript(self, node: Subscript) -> Any:
# Only treat the first argument to typing.Annotated as a potential
# forward reference
items = cast(
- typing.List[expr],
+ "typing.List[expr]",
[self.visit(slice_value.elts[0])] + slice_value.elts[1:],
)
else:
items = cast(
- typing.List[expr],
+ "typing.List[expr]",
[self.visit(item) for item in slice_value.elts],
)
@@ -602,7 +602,7 @@ def _convert_annotation(self, annotation: expr | None) -> expr | None:
# Convert PEP 604 unions (x | y) and generic built-in collections where
# necessary, and undo forward references
- new_annotation = cast(expr, AnnotationTransformer(self).visit(annotation))
+ new_annotation = cast("expr", AnnotationTransformer(self).visit(annotation))
if isinstance(new_annotation, expr):
new_annotation = ast.copy_location(new_annotation, annotation)
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_utils.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_utils.py
index 9bcc8417..2ce7b1ef 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_utils.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/typeguard/_utils.py
@@ -154,7 +154,7 @@ def is_method_of(obj: object, cls: type) -> bool:
def get_stacklevel() -> int:
level = 1
- frame = cast(FrameType, currentframe()).f_back
+ frame = cast("FrameType", currentframe()).f_back
while frame and frame.f_globals.get("__name__", "").startswith("typeguard."):
level += 1
frame = frame.f_back
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/typing_extensions.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/typing_extensions.py
index dec429ca..b01e701f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/typing_extensions.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/typing_extensions.py
@@ -12,125 +12,125 @@
__all__ = [
# Super-special typing primitives.
- 'Any',
- 'ClassVar',
- 'Concatenate',
- 'Final',
- 'LiteralString',
- 'ParamSpec',
- 'ParamSpecArgs',
- 'ParamSpecKwargs',
- 'Self',
- 'Type',
- 'TypeVar',
- 'TypeVarTuple',
- 'Unpack',
+ "Any",
+ "ClassVar",
+ "Concatenate",
+ "Final",
+ "LiteralString",
+ "ParamSpec",
+ "ParamSpecArgs",
+ "ParamSpecKwargs",
+ "Self",
+ "Type",
+ "TypeVar",
+ "TypeVarTuple",
+ "Unpack",
# ABCs (from collections.abc).
- 'Awaitable',
- 'AsyncIterator',
- 'AsyncIterable',
- 'Coroutine',
- 'AsyncGenerator',
- 'AsyncContextManager',
- 'Buffer',
- 'ChainMap',
+ "Awaitable",
+ "AsyncIterator",
+ "AsyncIterable",
+ "Coroutine",
+ "AsyncGenerator",
+ "AsyncContextManager",
+ "Buffer",
+ "ChainMap",
# Concrete collection types.
- 'ContextManager',
- 'Counter',
- 'Deque',
- 'DefaultDict',
- 'NamedTuple',
- 'OrderedDict',
- 'TypedDict',
+ "ContextManager",
+ "Counter",
+ "Deque",
+ "DefaultDict",
+ "NamedTuple",
+ "OrderedDict",
+ "TypedDict",
# Structural checks, a.k.a. protocols.
- 'SupportsAbs',
- 'SupportsBytes',
- 'SupportsComplex',
- 'SupportsFloat',
- 'SupportsIndex',
- 'SupportsInt',
- 'SupportsRound',
+ "SupportsAbs",
+ "SupportsBytes",
+ "SupportsComplex",
+ "SupportsFloat",
+ "SupportsIndex",
+ "SupportsInt",
+ "SupportsRound",
# One-off things.
- 'Annotated',
- 'assert_never',
- 'assert_type',
- 'clear_overloads',
- 'dataclass_transform',
- 'deprecated',
- 'Doc',
- 'get_overloads',
- 'final',
- 'get_args',
- 'get_origin',
- 'get_original_bases',
- 'get_protocol_members',
- 'get_type_hints',
- 'IntVar',
- 'is_protocol',
- 'is_typeddict',
- 'Literal',
- 'NewType',
- 'overload',
- 'override',
- 'Protocol',
- 'reveal_type',
- 'runtime',
- 'runtime_checkable',
- 'Text',
- 'TypeAlias',
- 'TypeAliasType',
- 'TypeGuard',
- 'TypeIs',
- 'TYPE_CHECKING',
- 'Never',
- 'NoReturn',
- 'ReadOnly',
- 'Required',
- 'NotRequired',
+ "Annotated",
+ "assert_never",
+ "assert_type",
+ "clear_overloads",
+ "dataclass_transform",
+ "deprecated",
+ "Doc",
+ "get_overloads",
+ "final",
+ "get_args",
+ "get_origin",
+ "get_original_bases",
+ "get_protocol_members",
+ "get_type_hints",
+ "IntVar",
+ "is_protocol",
+ "is_typeddict",
+ "Literal",
+ "NewType",
+ "overload",
+ "override",
+ "Protocol",
+ "reveal_type",
+ "runtime",
+ "runtime_checkable",
+ "Text",
+ "TypeAlias",
+ "TypeAliasType",
+ "TypeGuard",
+ "TypeIs",
+ "TYPE_CHECKING",
+ "Never",
+ "NoReturn",
+ "ReadOnly",
+ "Required",
+ "NotRequired",
# Pure aliases, have always been in typing
- 'AbstractSet',
- 'AnyStr',
- 'BinaryIO',
- 'Callable',
- 'Collection',
- 'Container',
- 'Dict',
- 'ForwardRef',
- 'FrozenSet',
- 'Generator',
- 'Generic',
- 'Hashable',
- 'IO',
- 'ItemsView',
- 'Iterable',
- 'Iterator',
- 'KeysView',
- 'List',
- 'Mapping',
- 'MappingView',
- 'Match',
- 'MutableMapping',
- 'MutableSequence',
- 'MutableSet',
- 'NoDefault',
- 'Optional',
- 'Pattern',
- 'Reversible',
- 'Sequence',
- 'Set',
- 'Sized',
- 'TextIO',
- 'Tuple',
- 'Union',
- 'ValuesView',
- 'cast',
- 'no_type_check',
- 'no_type_check_decorator',
+ "AbstractSet",
+ "AnyStr",
+ "BinaryIO",
+ "Callable",
+ "Collection",
+ "Container",
+ "Dict",
+ "ForwardRef",
+ "FrozenSet",
+ "Generator",
+ "Generic",
+ "Hashable",
+ "IO",
+ "ItemsView",
+ "Iterable",
+ "Iterator",
+ "KeysView",
+ "List",
+ "Mapping",
+ "MappingView",
+ "Match",
+ "MutableMapping",
+ "MutableSequence",
+ "MutableSet",
+ "NoDefault",
+ "Optional",
+ "Pattern",
+ "Reversible",
+ "Sequence",
+ "Set",
+ "Sized",
+ "TextIO",
+ "Tuple",
+ "Union",
+ "ValuesView",
+ "cast",
+ "no_type_check",
+ "no_type_check_decorator",
]
# for backward compatibility
@@ -167,11 +167,11 @@ def _should_collect_from_parameters(t):
# Some unconstrained type variables. These are used by the container types.
# (These are not for export.)
-T = typing.TypeVar('T') # Any type.
-KT = typing.TypeVar('KT') # Key type.
-VT = typing.TypeVar('VT') # Value type.
-T_co = typing.TypeVar('T_co', covariant=True) # Any type covariant containers.
-T_contra = typing.TypeVar('T_contra', contravariant=True) # Ditto contravariant.
+T = typing.TypeVar("T") # Any type.
+KT = typing.TypeVar("KT") # Key type.
+VT = typing.TypeVar("VT") # Value type.
+T_co = typing.TypeVar("T_co", covariant=True) # Any type covariant containers.
+T_contra = typing.TypeVar("T_contra", contravariant=True) # Ditto contravariant.
if sys.version_info >= (3, 11):
@@ -209,7 +209,7 @@ def __new__(cls, *args, **kwargs):
class _ExtensionsSpecialForm(typing._SpecialForm, _root=True):
def __repr__(self):
- return 'typing_extensions.' + self._name
+ return "typing_extensions." + self._name
Final = typing.Final
@@ -287,7 +287,7 @@ def __hash__(self):
class _LiteralForm(_ExtensionsSpecialForm, _root=True):
def __init__(self, doc: str):
- self._name = 'Literal'
+ self._name = "Literal"
self._doc = self.__doc__ = doc
def __getitem__(self, parameters):
@@ -421,7 +421,7 @@ def clear_overloads():
from typing import AsyncContextManager, AsyncGenerator, ContextManager, Generator
else:
def _is_dunder(attr):
- return attr.startswith('__') and attr.endswith('__')
+ return attr.startswith("__") and attr.endswith("__")
# Python <3.9 doesn't have typing._SpecialGenericAlias
_special_generic_alias_base = getattr(
@@ -441,7 +441,7 @@ def __init__(self, origin, nparams, *, inst=True, name=None, defaults=()):
self._defaults = defaults
def __setattr__(self, attr, val):
- allowed_attrs = {'_name', '_inst', '_nparams', '_defaults'}
+ allowed_attrs = {"_name", "_inst", "_nparams", "_defaults"}
if _special_generic_alias_base is typing._GenericAlias:
# Python <3.9
allowed_attrs.add("__origin__")
@@ -500,12 +500,12 @@ def __getitem__(self, params):
_PROTO_ALLOWLIST = {
- 'collections.abc': [
- 'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable',
- 'Hashable', 'Sized', 'Container', 'Collection', 'Reversible', 'Buffer',
+ "collections.abc": [
+ "Callable", "Awaitable", "Iterable", "Iterator", "AsyncIterable",
+ "Hashable", "Sized", "Container", "Collection", "Reversible", "Buffer",
],
- 'contextlib': ['AbstractContextManager', 'AbstractAsyncContextManager'],
- 'typing_extensions': ['Buffer'],
+ "contextlib": ["AbstractContextManager", "AbstractAsyncContextManager"],
+ "typing_extensions": ["Buffer"],
}
@@ -518,18 +518,18 @@ def __getitem__(self, params):
def _get_protocol_attrs(cls):
attrs = set()
for base in cls.__mro__[:-1]: # without object
- if base.__name__ in {'Protocol', 'Generic'}:
+ if base.__name__ in {"Protocol", "Generic"}:
continue
- annotations = getattr(base, '__annotations__', {})
+ annotations = getattr(base, "__annotations__", {})
for attr in (*base.__dict__, *annotations):
- if (not attr.startswith('_abc_') and attr not in _EXCLUDED_ATTRS):
+ if (not attr.startswith("_abc_") and attr not in _EXCLUDED_ATTRS):
attrs.add(attr)
return attrs
def _caller(depth=2):
try:
- return sys._getframe(depth).f_globals.get('__name__', '__main__')
+ return sys._getframe(depth).f_globals.get("__name__", "__main__")
except (AttributeError, ValueError): # For platforms without _getframe()
return None
@@ -544,11 +544,11 @@ def _allow_reckless_class_checks(depth=3):
The abc and functools modules indiscriminately call isinstance() and
issubclass() on the whole MRO of a user class, which may contain protocols.
"""
- return _caller(depth) in {'abc', 'functools', None}
+ return _caller(depth) in {"abc", "functools", None}
def _no_init(self, *args, **kwargs):
if type(self)._is_protocol:
- raise TypeError('Protocols cannot be instantiated')
+ raise TypeError("Protocols cannot be instantiated")
def _type_check_issubclass_arg_1(arg):
"""Raise TypeError if `arg` is not an instance of `type`
@@ -564,7 +564,7 @@ def _type_check_issubclass_arg_1(arg):
"""
if not isinstance(arg, type):
# Same error message as for issubclass(1, int).
- raise TypeError('issubclass() arg 1 must be a class')
+ raise TypeError("issubclass() arg 1 must be a class")
# Inheriting from typing._ProtocolMeta isn't actually desirable,
# but is necessary to allow typing.Protocol and typing_extensions.Protocol
@@ -601,10 +601,10 @@ def __subclasscheck__(cls, other):
if cls is Protocol:
return type.__subclasscheck__(cls, other)
if (
- getattr(cls, '_is_protocol', False)
+ getattr(cls, "_is_protocol", False)
and not _allow_reckless_class_checks()
):
- if not getattr(cls, '_is_runtime_protocol', False):
+ if not getattr(cls, "_is_runtime_protocol", False):
_type_check_issubclass_arg_1(other)
raise TypeError(
"Instance and class checks can only be used with "
@@ -633,7 +633,7 @@ def __instancecheck__(cls, instance):
return abc.ABCMeta.__instancecheck__(cls, instance)
if (
- not getattr(cls, '_is_runtime_protocol', False) and
+ not getattr(cls, "_is_runtime_protocol", False) and
not _allow_reckless_class_checks()
):
raise TypeError("Instance and class checks can only be used with"
@@ -671,7 +671,7 @@ def __hash__(cls) -> int:
@classmethod
def _proto_hook(cls, other):
- if not cls.__dict__.get('_is_protocol', False):
+ if not cls.__dict__.get("_is_protocol", False):
return NotImplemented
for attr in cls.__protocol_attrs__:
@@ -683,7 +683,7 @@ def _proto_hook(cls, other):
break
# ...or in annotations, if it is a sub-protocol.
- annotations = getattr(base, '__annotations__', {})
+ annotations = getattr(base, "__annotations__", {})
if (
isinstance(annotations, collections.abc.Mapping)
and attr in annotations
@@ -704,11 +704,11 @@ def __init_subclass__(cls, *args, **kwargs):
super().__init_subclass__(*args, **kwargs)
# Determine if this is a protocol or a concrete subclass.
- if not cls.__dict__.get('_is_protocol', False):
+ if not cls.__dict__.get("_is_protocol", False):
cls._is_protocol = any(b is Protocol for b in cls.__bases__)
# Set (or override) the protocol subclass hook.
- if '__subclasshook__' not in cls.__dict__:
+ if "__subclasshook__" not in cls.__dict__:
cls.__subclasshook__ = _proto_hook
# Prohibit instantiation for protocol classes
@@ -738,9 +738,9 @@ def close(self): ...
Warning: this will check only the presence of the required methods,
not their type signatures!
"""
- if not issubclass(cls, typing.Generic) or not getattr(cls, '_is_protocol', False):
- raise TypeError(f'@runtime_checkable can be only applied to protocol classes,'
- f' got {cls!r}')
+ if not issubclass(cls, typing.Generic) or not getattr(cls, "_is_protocol", False):
+ raise TypeError(f"@runtime_checkable can be only applied to protocol classes,"
+ f" got {cls!r}")
cls._is_runtime_protocol = True
# typing.Protocol classes on <=3.11 break if we execute this block,
@@ -923,8 +923,8 @@ def __new__(cls, name, bases, ns, *, total=True, closed=False):
"""
for base in bases:
if type(base) is not _TypedDictMeta and base is not typing.Generic:
- raise TypeError('cannot inherit from both a TypedDict type '
- 'and a non-TypedDict base class')
+ raise TypeError("cannot inherit from both a TypedDict type "
+ "and a non-TypedDict base class")
if any(issubclass(b, typing.Generic) for b in bases):
generic_base = (typing.Generic,)
@@ -938,7 +938,7 @@ def __new__(cls, name, bases, ns, *, total=True, closed=False):
if tp_dict.__qualname__ == "Protocol":
tp_dict.__qualname__ = name
- if not hasattr(tp_dict, '__orig_bases__'):
+ if not hasattr(tp_dict, "__orig_bases__"):
tp_dict.__orig_bases__ = bases
annotations = {}
@@ -969,12 +969,12 @@ def __new__(cls, name, bases, ns, *, total=True, closed=False):
for base in bases:
base_dict = base.__dict__
- annotations.update(base_dict.get('__annotations__', {}))
- required_keys.update(base_dict.get('__required_keys__', ()))
- optional_keys.update(base_dict.get('__optional_keys__', ()))
- readonly_keys.update(base_dict.get('__readonly_keys__', ()))
- mutable_keys.update(base_dict.get('__mutable_keys__', ()))
- base_extra_items_type = base_dict.get('__extra_items__', None)
+ annotations.update(base_dict.get("__annotations__", {}))
+ required_keys.update(base_dict.get("__required_keys__", ()))
+ optional_keys.update(base_dict.get("__optional_keys__", ()))
+ readonly_keys.update(base_dict.get("__readonly_keys__", ()))
+ mutable_keys.update(base_dict.get("__mutable_keys__", ()))
+ base_extra_items_type = base_dict.get("__extra_items__", None)
if base_extra_items_type is not None:
extra_items_type = base_extra_items_type
@@ -1019,7 +1019,7 @@ def __new__(cls, name, bases, ns, *, total=True, closed=False):
tp_dict.__optional_keys__ = frozenset(optional_keys)
tp_dict.__readonly_keys__ = frozenset(readonly_keys)
tp_dict.__mutable_keys__ = frozenset(mutable_keys)
- if not hasattr(tp_dict, '__total__'):
+ if not hasattr(tp_dict, "__total__"):
tp_dict.__total__ = total
tp_dict.__closed__ = closed
tp_dict.__extra_items__ = extra_items_type
@@ -1029,11 +1029,11 @@ def __new__(cls, name, bases, ns, *, total=True, closed=False):
def __subclasscheck__(cls, other):
# Typed dicts are only for static structural subtyping.
- raise TypeError('TypedDict does not support instance and class checks')
+ raise TypeError("TypedDict does not support instance and class checks")
__instancecheck__ = __subclasscheck__
- _TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {})
+ _TypedDict = type.__new__(_TypedDictMeta, "TypedDict", (), {})
@_ensure_subclassable(lambda bases: (_TypedDict,))
def TypedDict(typename, fields=_marker, /, *, total=True, closed=False, **kwargs):
@@ -1114,11 +1114,11 @@ class Point2D(TypedDict):
stacklevel=2,
)
- ns = {'__annotations__': dict(fields)}
+ ns = {"__annotations__": dict(fields)}
module = _caller()
if module is not None:
# Setting correct module is necessary to make typed dict classes pickleable.
- ns['__module__'] = module
+ ns["__module__"] = module
td = _TypedDictMeta(typename, (), ns, total=total, closed=closed)
td.__orig_bases__ = (TypedDict,)
@@ -1238,7 +1238,7 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False):
# Python 3.9+ has PEP 593 (Annotated)
-if hasattr(typing, 'Annotated'):
+if hasattr(typing, "Annotated"):
Annotated = typing.Annotated
# Not exported and not a public API, but needed for get_origin() and get_args()
# to work.
@@ -1409,7 +1409,7 @@ def get_args(tp):
# 3.10+
-if hasattr(typing, 'TypeAlias'):
+if hasattr(typing, "TypeAlias"):
TypeAlias = typing.TypeAlias
# 3.9
elif sys.version_info[:2] >= (3, 9):
@@ -1429,7 +1429,7 @@ def TypeAlias(self, parameters):
# 3.8
else:
TypeAlias = _ExtensionsSpecialForm(
- 'TypeAlias',
+ "TypeAlias",
doc="""Special marker indicating that an assignment should
be recognized as a proper type alias definition by type
checkers.
@@ -1479,7 +1479,7 @@ def _set_default(type_param, default):
def _set_module(typevarlike):
# for pickling:
def_mod = _caller(depth=3)
- if def_mod != 'typing_extensions':
+ if def_mod != "typing_extensions":
typevarlike.__module__ = def_mod
@@ -1539,7 +1539,7 @@ def __init_subclass__(cls) -> None:
# Python 3.10+ has PEP 612
-if hasattr(typing, 'ParamSpecArgs'):
+if hasattr(typing, "ParamSpecArgs"):
ParamSpecArgs = typing.ParamSpecArgs
ParamSpecKwargs = typing.ParamSpecKwargs
# 3.8-3.9
@@ -1605,7 +1605,7 @@ def __eq__(self, other):
from typing import ParamSpec
# 3.10+
-elif hasattr(typing, 'ParamSpec'):
+elif hasattr(typing, "ParamSpec"):
# Add default parameter - PEP 696
class ParamSpec(metaclass=_TypeVarLikeMeta):
@@ -1723,25 +1723,25 @@ def __init__(self, name, *, bound=None, covariant=False, contravariant=False,
self.__contravariant__ = bool(contravariant)
self.__infer_variance__ = bool(infer_variance)
if bound:
- self.__bound__ = typing._type_check(bound, 'Bound must be a type.')
+ self.__bound__ = typing._type_check(bound, "Bound must be a type.")
else:
self.__bound__ = None
_DefaultMixin.__init__(self, default)
# for pickling:
def_mod = _caller()
- if def_mod != 'typing_extensions':
+ if def_mod != "typing_extensions":
self.__module__ = def_mod
def __repr__(self):
if self.__infer_variance__:
- prefix = ''
+ prefix = ""
elif self.__covariant__:
- prefix = '+'
+ prefix = "+"
elif self.__contravariant__:
- prefix = '-'
+ prefix = "-"
else:
- prefix = '~'
+ prefix = "~"
return prefix + self.__name__
def __hash__(self):
@@ -1759,7 +1759,7 @@ def __call__(self, *args, **kwargs):
# 3.8-3.9
-if not hasattr(typing, 'Concatenate'):
+if not hasattr(typing, "Concatenate"):
# Inherits from list as a workaround for Callable checks in Python < 3.9.2.
class _ConcatenateGenericAlias(list):
@@ -1809,7 +1809,7 @@ def _concatenate_getitem(self, parameters):
# 3.10+
-if hasattr(typing, 'Concatenate'):
+if hasattr(typing, "Concatenate"):
Concatenate = typing.Concatenate
_ConcatenateGenericAlias = typing._ConcatenateGenericAlias
# 3.9
@@ -1834,7 +1834,7 @@ def __getitem__(self, parameters):
return _concatenate_getitem(self, parameters)
Concatenate = _ConcatenateForm(
- 'Concatenate',
+ "Concatenate",
doc="""Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
higher order function which adds, removes or transforms parameters of a
callable.
@@ -1847,7 +1847,7 @@ def __getitem__(self, parameters):
""")
# 3.10+
-if hasattr(typing, 'TypeGuard'):
+if hasattr(typing, "TypeGuard"):
TypeGuard = typing.TypeGuard
# 3.9
elif sys.version_info[:2] >= (3, 9):
@@ -1895,18 +1895,18 @@ def is_str(val: Union[str, float]):
``TypeGuard`` also works with type variables. For more information, see
PEP 647 (User-Defined Type Guards).
"""
- item = typing._type_check(parameters, f'{self} accepts only a single type.')
+ item = typing._type_check(parameters, f"{self} accepts only a single type.")
return typing._GenericAlias(self, (item,))
# 3.8
else:
class _TypeGuardForm(_ExtensionsSpecialForm, _root=True):
def __getitem__(self, parameters):
item = typing._type_check(parameters,
- f'{self._name} accepts only a single type')
+ f"{self._name} accepts only a single type")
return typing._GenericAlias(self, (item,))
TypeGuard = _TypeGuardForm(
- 'TypeGuard',
+ "TypeGuard",
doc="""Special typing form used to annotate the return type of a user-defined
type guard function. ``TypeGuard`` only accepts a single type argument.
At runtime, functions marked this way should return a boolean.
@@ -1951,7 +1951,7 @@ def is_str(val: Union[str, float]):
""")
# 3.13+
-if hasattr(typing, 'TypeIs'):
+if hasattr(typing, "TypeIs"):
TypeIs = typing.TypeIs
# 3.9
elif sys.version_info[:2] >= (3, 9):
@@ -1993,18 +1993,18 @@ def f(val: Union[int, Awaitable[int]]) -> int:
``TypeIs`` also works with type variables. For more information, see
PEP 742 (Narrowing types with TypeIs).
"""
- item = typing._type_check(parameters, f'{self} accepts only a single type.')
+ item = typing._type_check(parameters, f"{self} accepts only a single type.")
return typing._GenericAlias(self, (item,))
# 3.8
else:
class _TypeIsForm(_ExtensionsSpecialForm, _root=True):
def __getitem__(self, parameters):
item = typing._type_check(parameters,
- f'{self._name} accepts only a single type')
+ f"{self._name} accepts only a single type")
return typing._GenericAlias(self, (item,))
TypeIs = _TypeIsForm(
- 'TypeIs',
+ "TypeIs",
doc="""Special typing form used to annotate the return type of a user-defined
type narrower function. ``TypeIs`` only accepts a single type argument.
At runtime, functions marked this way should return a boolean.
@@ -2045,7 +2045,7 @@ def f(val: Union[int, Awaitable[int]]) -> int:
# Vendored from cpython typing._SpecialFrom
class _SpecialForm(typing._Final, _root=True):
- __slots__ = ('_name', '__doc__', '_getitem')
+ __slots__ = ("_name", "__doc__", "_getitem")
def __init__(self, getitem):
self._getitem = getitem
@@ -2053,7 +2053,7 @@ def __init__(self, getitem):
self.__doc__ = getitem.__doc__
def __getattr__(self, item):
- if item in {'__name__', '__qualname__'}:
+ if item in {"__name__", "__qualname__"}:
return self._name
raise AttributeError(item)
@@ -2062,7 +2062,7 @@ def __mro_entries__(self, bases):
raise TypeError(f"Cannot subclass {self!r}")
def __repr__(self):
- return f'typing_extensions.{self._name}'
+ return f"typing_extensions.{self._name}"
def __reduce__(self):
return self._name
@@ -2161,7 +2161,7 @@ def int_or_str(arg: int | str) -> None:
raise TypeError(f"{self} is not subscriptable")
-if hasattr(typing, 'Required'): # 3.11+
+if hasattr(typing, "Required"): # 3.11+
Required = typing.Required
NotRequired = typing.NotRequired
elif sys.version_info[:2] >= (3, 9): # 3.9-3.10
@@ -2182,7 +2182,7 @@ class Movie(TypedDict, total=False):
There is no runtime checking that a required key is actually provided
when instantiating a related TypedDict.
"""
- item = typing._type_check(parameters, f'{self._name} accepts only a single type.')
+ item = typing._type_check(parameters, f"{self._name} accepts only a single type.")
return typing._GenericAlias(self, (item,))
@_ExtensionsSpecialForm
@@ -2199,18 +2199,18 @@ class Movie(TypedDict):
year=1999,
)
"""
- item = typing._type_check(parameters, f'{self._name} accepts only a single type.')
+ item = typing._type_check(parameters, f"{self._name} accepts only a single type.")
return typing._GenericAlias(self, (item,))
else: # 3.8
class _RequiredForm(_ExtensionsSpecialForm, _root=True):
def __getitem__(self, parameters):
item = typing._type_check(parameters,
- f'{self._name} accepts only a single type.')
+ f"{self._name} accepts only a single type.")
return typing._GenericAlias(self, (item,))
Required = _RequiredForm(
- 'Required',
+ "Required",
doc="""A special typing construct to mark a key of a total=False TypedDict
as required. For example:
@@ -2227,7 +2227,7 @@ class Movie(TypedDict, total=False):
when instantiating a related TypedDict.
""")
NotRequired = _RequiredForm(
- 'NotRequired',
+ "NotRequired",
doc="""A special typing construct to mark a key of a TypedDict as
potentially missing. For example:
@@ -2242,7 +2242,7 @@ class Movie(TypedDict):
""")
-if hasattr(typing, 'ReadOnly'):
+if hasattr(typing, "ReadOnly"):
ReadOnly = typing.ReadOnly
elif sys.version_info[:2] >= (3, 9): # 3.9-3.12
@_ExtensionsSpecialForm
@@ -2261,18 +2261,18 @@ def mutate_movie(m: Movie) -> None:
There is no runtime checking for this property.
"""
- item = typing._type_check(parameters, f'{self._name} accepts only a single type.')
+ item = typing._type_check(parameters, f"{self._name} accepts only a single type.")
return typing._GenericAlias(self, (item,))
else: # 3.8
class _ReadOnlyForm(_ExtensionsSpecialForm, _root=True):
def __getitem__(self, parameters):
item = typing._type_check(parameters,
- f'{self._name} accepts only a single type.')
+ f"{self._name} accepts only a single type.")
return typing._GenericAlias(self, (item,))
ReadOnly = _ReadOnlyForm(
- 'ReadOnly',
+ "ReadOnly",
doc="""A special typing construct to mark a key of a TypedDict as read-only.
For example:
@@ -2359,7 +2359,7 @@ def __typing_unpacked_tuple_args__(self):
@_UnpackSpecialForm
def Unpack(self, parameters):
- item = typing._type_check(parameters, f'{self._name} accepts only a single type.')
+ item = typing._type_check(parameters, f"{self._name} accepts only a single type.")
return _UnpackAlias(self, (item,))
def _is_unpack(obj):
@@ -2372,10 +2372,10 @@ class _UnpackAlias(typing._GenericAlias, _root=True):
class _UnpackForm(_ExtensionsSpecialForm, _root=True):
def __getitem__(self, parameters):
item = typing._type_check(parameters,
- f'{self._name} accepts only a single type.')
+ f"{self._name} accepts only a single type.")
return _UnpackAlias(self, (item,))
- Unpack = _UnpackForm('Unpack', doc=_UNPACK_DOC)
+ Unpack = _UnpackForm("Unpack", doc=_UNPACK_DOC)
def _is_unpack(obj):
return isinstance(obj, _UnpackAlias)
@@ -2389,7 +2389,7 @@ def _is_unpack(obj):
def _unpack_args(*args):
newargs = []
for arg in args:
- subargs = getattr(arg, '__typing_unpacked_tuple_args__', None)
+ subargs = getattr(arg, "__typing_unpacked_tuple_args__", None)
if subargs is not None and not (subargs and subargs[-1] is ...):
newargs.extend(subargs)
else:
@@ -2424,7 +2424,7 @@ def _typevartuple_prepare_subst(alias, args):
fillarg = None
for k, arg in enumerate(args):
if not isinstance(arg, type):
- subargs = getattr(arg, '__typing_unpacked_tuple_args__', None)
+ subargs = getattr(arg, "__typing_unpacked_tuple_args__", None)
if subargs and len(subargs) == 2 and subargs[-1] is ...:
if var_tuple_index is not None:
raise TypeError(
@@ -2515,7 +2515,7 @@ def __init__(self, name, *, default=NoDefault):
# for pickling:
def_mod = _caller()
- if def_mod != 'typing_extensions':
+ if def_mod != "typing_extensions":
self.__module__ = def_mod
self.__unpacked__ = Unpack[self]
@@ -2533,7 +2533,7 @@ def __reduce__(self):
return self.__name__
def __init_subclass__(self, *args, **kwds):
- if '_root' not in kwds:
+ if "_root" not in kwds:
raise TypeError("Cannot subclass special typing classes")
@@ -2591,7 +2591,7 @@ def int_or_str(arg: int | str) -> None:
"""
value = repr(arg)
if len(value) > _ASSERT_NEVER_REPR_MAX_LENGTH:
- value = value[:_ASSERT_NEVER_REPR_MAX_LENGTH] + '...'
+ value = value[:_ASSERT_NEVER_REPR_MAX_LENGTH] + "..."
raise AssertionError(f"Expected code to be unreachable, but got: {value}")
@@ -2895,12 +2895,12 @@ def _check_generic(cls, parameters, elen=_marker):
# since we validate TypeVarLike default in _collect_type_vars
# or _collect_parameters we can safely check parameters[alen]
if (
- getattr(parameters[alen], '__default__', NoDefault)
+ getattr(parameters[alen], "__default__", NoDefault)
is not NoDefault
):
return
- num_default_tv = sum(getattr(p, '__default__', NoDefault)
+ num_default_tv = sum(getattr(p, "__default__", NoDefault)
is not NoDefault for p in parameters)
elen -= num_default_tv
@@ -2932,12 +2932,12 @@ def _check_generic(cls, parameters, elen):
# since we validate TypeVarLike default in _collect_type_vars
# or _collect_parameters we can safely check parameters[alen]
if (
- getattr(parameters[alen], '__default__', NoDefault)
+ getattr(parameters[alen], "__default__", NoDefault)
is not NoDefault
):
return
- num_default_tv = sum(getattr(p, '__default__', NoDefault)
+ num_default_tv = sum(getattr(p, "__default__", NoDefault)
is not NoDefault for p in parameters)
elen -= num_default_tv
@@ -2985,7 +2985,7 @@ def _is_unpacked_typevartuple(x) -> bool:
# Python 3.11+ _collect_type_vars was renamed to _collect_parameters
-if hasattr(typing, '_collect_type_vars'):
+if hasattr(typing, "_collect_type_vars"):
def _collect_type_vars(types, typevar_types=None):
"""Collect all type variable contained in types in order of
first appearance (lexicographic order). For example::
@@ -3009,15 +3009,15 @@ def _collect_type_vars(types, typevar_types=None):
type_var_tuple_encountered = True
elif isinstance(t, typevar_types) and t not in tvars:
if enforce_default_ordering:
- has_default = getattr(t, '__default__', NoDefault) is not NoDefault
+ has_default = getattr(t, "__default__", NoDefault) is not NoDefault
if has_default:
if type_var_tuple_encountered:
- raise TypeError('Type parameter with a default'
- ' follows TypeVarTuple')
+ raise TypeError("Type parameter with a default"
+ " follows TypeVarTuple")
default_encountered = True
elif default_encountered:
- raise TypeError(f'Type parameter {t!r} without a default'
- ' follows type parameter with a default')
+ raise TypeError(f"Type parameter {t!r} without a default"
+ " follows type parameter with a default")
tvars.append(t)
if _should_collect_from_parameters(t):
@@ -3055,28 +3055,28 @@ def _collect_parameters(args):
for collected in _collect_parameters([x]):
if collected not in parameters:
parameters.append(collected)
- elif hasattr(t, '__typing_subst__'):
+ elif hasattr(t, "__typing_subst__"):
if t not in parameters:
if enforce_default_ordering:
has_default = (
- getattr(t, '__default__', NoDefault) is not NoDefault
+ getattr(t, "__default__", NoDefault) is not NoDefault
)
if type_var_tuple_encountered and has_default:
- raise TypeError('Type parameter with a default'
- ' follows TypeVarTuple')
+ raise TypeError("Type parameter with a default"
+ " follows TypeVarTuple")
if has_default:
default_encountered = True
elif default_encountered:
- raise TypeError(f'Type parameter {t!r} without a default'
- ' follows type parameter with a default')
+ raise TypeError(f"Type parameter {t!r} without a default"
+ " follows type parameter with a default")
parameters.append(t)
else:
if _is_unpacked_typevartuple(t):
type_var_tuple_encountered = True
- for x in getattr(t, '__parameters__', ()):
+ for x in getattr(t, "__parameters__", ()):
if x not in parameters:
parameters.append(x)
@@ -3107,7 +3107,7 @@ def _make_nmtuple(name, types, module, defaults=()):
return nm_tpl
_prohibited_namedtuple_fields = typing._prohibited
- _special_namedtuple_fields = frozenset({'__module__', '__name__', '__annotations__'})
+ _special_namedtuple_fields = frozenset({"__module__", "__name__", "__annotations__"})
class _NamedTupleMeta(type):
def __new__(cls, typename, bases, ns):
@@ -3115,7 +3115,7 @@ def __new__(cls, typename, bases, ns):
for base in bases:
if base is not _NamedTuple and base is not typing.Generic:
raise TypeError(
- 'can only inherit from a NamedTuple type and Generic')
+ "can only inherit from a NamedTuple type and Generic")
bases = tuple(tuple if base is _NamedTuple else base for base in bases)
if "__annotations__" in ns:
types = ns["__annotations__"]
@@ -3136,11 +3136,11 @@ def __new__(cls, typename, bases, ns):
nm_tpl = _make_nmtuple(
typename, types.items(),
defaults=[ns[n] for n in default_names],
- module=ns['__module__']
+ module=ns["__module__"]
)
nm_tpl.__bases__ = bases
if typing.Generic in bases:
- if hasattr(typing, '_generic_class_getitem'): # 3.12+
+ if hasattr(typing, "_generic_class_getitem"): # 3.12+
nm_tpl.__class_getitem__ = classmethod(typing._generic_class_getitem)
else:
class_getitem = typing.Generic.__class_getitem__.__func__
@@ -3179,7 +3179,7 @@ def __new__(cls, typename, bases, ns):
nm_tpl.__init_subclass__()
return nm_tpl
- _NamedTuple = type.__new__(_NamedTupleMeta, 'NamedTuple', (), {})
+ _NamedTuple = type.__new__(_NamedTupleMeta, "NamedTuple", (), {})
def _namedtuple_mro_entries(bases):
assert NamedTuple in bases
@@ -3310,7 +3310,7 @@ class Baz(list[str]): ...
return cls.__dict__.get("__orig_bases__", cls.__bases__)
except AttributeError:
raise TypeError(
- f'Expected an instance of type, not {type(cls).__name__!r}'
+ f"Expected an instance of type, not {type(cls).__name__!r}"
) from None
@@ -3338,12 +3338,12 @@ def __call__(self, obj, /):
def __init__(self, name, tp):
self.__qualname__ = name
- if '.' in name:
- name = name.rpartition('.')[-1]
+ if "." in name:
+ name = name.rpartition(".")[-1]
self.__name__ = name
self.__supertype__ = tp
def_mod = _caller()
- if def_mod != 'typing_extensions':
+ if def_mod != "typing_extensions":
self.__module__ = def_mod
def __mro_entries__(self, bases):
@@ -3363,7 +3363,7 @@ def __init_subclass__(cls):
return (Dummy,)
def __repr__(self):
- return f'{self.__module__}.{self.__qualname__}'
+ return f"{self.__module__}.{self.__qualname__}"
def __reduce__(self):
return self.__qualname__
@@ -3433,7 +3433,7 @@ def __init__(self, name: str, value, *, type_params=()):
parameters.append(type_param)
self.__parameters__ = tuple(parameters)
def_mod = _caller()
- if def_mod != 'typing_extensions':
+ if def_mod != "typing_extensions":
self.__module__ = def_mod
# Setting this attribute closes the TypeAliasType from further modification
self.__name__ = name
@@ -3468,7 +3468,7 @@ def __getitem__(self, parameters):
parameters = (parameters,)
parameters = [
typing._type_check(
- item, f'Subscripting {self.__name__} requires a type.'
+ item, f"Subscripting {self.__name__} requires a type."
)
for item in parameters
]
@@ -3521,7 +3521,7 @@ def is_protocol(tp: type, /) -> bool:
"""
return (
isinstance(tp, type)
- and getattr(tp, '_is_protocol', False)
+ and getattr(tp, "_is_protocol", False)
and tp is not Protocol
and tp is not typing.Protocol
)
@@ -3541,8 +3541,8 @@ def get_protocol_members(tp: type, /) -> typing.FrozenSet[str]:
Raise a TypeError for arguments that are not Protocols.
"""
if not is_protocol(tp):
- raise TypeError(f'{tp!r} is not a Protocol')
- if hasattr(tp, '__protocol_attrs__'):
+ raise TypeError(f"{tp!r} is not a Protocol")
+ if hasattr(tp, "__protocol_attrs__"):
return frozenset(tp.__protocol_attrs__)
return frozenset(_get_protocol_attrs(tp))
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py
index 88973ebf..3d664738 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/_bdist_wheel.py
@@ -321,7 +321,7 @@ def get_tag(self) -> tuple[str, str, str]:
# bdist sets self.plat_name if unset, we should only use it for purepy
# wheels if the user supplied it.
if self.plat_name_supplied:
- plat_name = cast(str, self.plat_name)
+ plat_name = cast("str", self.plat_name)
elif self.root_is_pure:
plat_name = "any"
else:
@@ -506,7 +506,7 @@ def license_paths(self) -> Iterable[str]:
metadata = self.distribution.get_option_dict("metadata")
if setuptools_major_version >= 42:
# Setuptools recognizes the license_files option but does not do globbing
- patterns = cast(Sequence[str], self.distribution.metadata.license_files)
+ patterns = cast("Sequence[str]", self.distribution.metadata.license_files)
else:
# Prior to those, wheel is entirely responsible for handling license files
if "license_files" in metadata:
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/utils.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/utils.py
index c2c2f75a..255a9a92 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/utils.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/wheel/vendored/packaging/utils.py
@@ -45,7 +45,7 @@ def canonicalize_name(name: str, *, validate: bool = False) -> NormalizedName:
raise InvalidName(f"name is invalid: {name!r}")
# This is taken from PEP 503.
value = _canonicalize_regex.sub("-", name).lower()
- return cast(NormalizedName, value)
+ return cast("NormalizedName", value)
def is_normalized_name(name: str) -> bool:
@@ -136,7 +136,7 @@ def parse_wheel_filename(
raise InvalidWheelFilename(
f"Invalid build number: {build_part} in '{filename}'"
)
- build = cast(BuildTag, (int(build_match.group(1)), build_match.group(2)))
+ build = cast("BuildTag", (int(build_match.group(1)), build_match.group(2)))
else:
build = ()
tags = parse_tag(parts[-1])
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/__init__.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/__init__.py
index d65297b8..43cf2ffb 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/__init__.py
@@ -12,7 +12,7 @@
from .glob import Translator
-__all__ = ['Path']
+__all__ = ["Path"]
def _parents(path):
@@ -135,17 +135,17 @@ def _sanitize(name):
"""
def allowed(part):
- return part and part not in {'..', '.'}
+ return part and part not in {"..", "."}
# Remove the drive letter.
# Don't use ntpath.splitdrive, because that also strips UNC paths
- bare = re.sub('^([A-Z]):', r'\1', name, flags=re.IGNORECASE)
- clean = bare.replace('\\', '/')
- parts = clean.split('/')
- joined = '/'.join(filter(allowed, parts))
+ bare = re.sub("^([A-Z]):", r"\1", name, flags=re.IGNORECASE)
+ clean = bare.replace("\\", "/")
+ parts = clean.split("/")
+ joined = "/".join(filter(allowed, parts))
if not joined:
raise ValueError("Empty filename")
- return joined + '/' * name.endswith('/')
+ return joined + "/" * name.endswith("/")
class CompleteDirs(InitializedState, SanitizedNames, zipfile.ZipFile):
@@ -178,7 +178,7 @@ def resolve_dir(self, name):
as a directory (with the trailing slash).
"""
names = self._name_set()
- dirname = name + '/'
+ dirname = name + "/"
dir_match = name not in names and dirname in names
return dirname if dir_match else name
@@ -189,7 +189,7 @@ def getinfo(self, name):
try:
return super().getinfo(name)
except KeyError:
- if not name.endswith('/') or name not in self._name_set():
+ if not name.endswith("/") or name not in self._name_set():
raise
return zipfile.ZipInfo(filename=name)
@@ -206,7 +206,7 @@ def make(cls, source):
return cls(source)
# Only allow for FastLookup when supplied zipfile is read-only
- if 'r' not in source.mode:
+ if "r" not in source.mode:
cls = CompleteDirs
source.__class__ = cls
@@ -244,7 +244,7 @@ def _name_set(self):
def _extract_text_encoding(encoding=None, *args, **kwargs):
# compute stack level so that the caller of the caller sees any warning.
- is_pypy = sys.implementation.name == 'pypy'
+ is_pypy = sys.implementation.name == "pypy"
stack_level = 3 + is_pypy
return text_encoding(encoding, stack_level), args, kwargs
@@ -379,7 +379,7 @@ def __eq__(self, other):
def __hash__(self):
return hash((self.root, self.at))
- def open(self, mode='r', *args, pwd=None, **kwargs):
+ def open(self, mode="r", *args, pwd=None, **kwargs):
"""
Open this entry as text or binary following the semantics
of ``pathlib.Path.open()`` by passing arguments through
@@ -388,10 +388,10 @@ def open(self, mode='r', *args, pwd=None, **kwargs):
if self.is_dir():
raise IsADirectoryError(self)
zip_mode = mode[0]
- if not self.exists() and zip_mode == 'r':
+ if not self.exists() and zip_mode == "r":
raise FileNotFoundError(self)
stream = self.root.open(self.at, zip_mode, pwd=pwd)
- if 'b' in mode:
+ if "b" in mode:
if args or kwargs:
raise ValueError("encoding args invalid for binary operation")
return stream
@@ -424,11 +424,11 @@ def filename(self):
def read_text(self, *args, **kwargs):
encoding, args, kwargs = _extract_text_encoding(*args, **kwargs)
- with self.open('r', encoding, *args, **kwargs) as strm:
+ with self.open("r", encoding, *args, **kwargs) as strm:
return strm.read()
def read_bytes(self):
- with self.open('rb') as strm:
+ with self.open("rb") as strm:
return strm.read()
def _is_child(self, path):
@@ -468,13 +468,13 @@ def glob(self, pattern):
raise ValueError(f"Unacceptable pattern: {pattern!r}")
prefix = re.escape(self.at)
- tr = Translator(seps='/')
+ tr = Translator(seps="/")
matches = re.compile(prefix + tr.translate(pattern)).fullmatch
names = (data.filename for data in self.root.filelist)
return map(self._next, filter(matches, names))
def rglob(self, pattern):
- return self.glob(f'**/{pattern}')
+ return self.glob(f"**/{pattern}")
def relative_to(self, other, *extra):
return posixpath.relpath(str(self), str(other.joinpath(*extra)))
@@ -495,7 +495,7 @@ def joinpath(self, *other):
def parent(self):
if not self.at:
return self.filename.parent
- parent_at = posixpath.dirname(self.at.rstrip('/'))
+ parent_at = posixpath.dirname(self.at.rstrip("/"))
if parent_at:
- parent_at += '/'
+ parent_at += "/"
return self._next(parent_at)
diff --git a/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/glob.py b/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/glob.py
index 69c41d77..a0d1a688 100644
--- a/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/glob.py
+++ b/.venv3.10/Lib/site-packages/setuptools/_vendor/zipp/glob.py
@@ -39,7 +39,7 @@ def extend(self, pattern):
Append '\Z' to imply fullmatch even when match is used.
"""
- return rf'(?s:{pattern})\Z'
+ return rf"(?s:{pattern})\Z"
def translate_core(self, pattern):
r"""
@@ -54,17 +54,17 @@ def translate_core(self, pattern):
'.*/[^/][^/]*'
"""
self.restrict_rglob(pattern)
- return ''.join(map(self.replace, separate(self.star_not_empty(pattern))))
+ return "".join(map(self.replace, separate(self.star_not_empty(pattern))))
def replace(self, match):
"""
Perform the replacements for a match from :func:`separate`.
"""
- return match.group('set') or (
+ return match.group("set") or (
re.escape(match.group(0))
- .replace('\\*\\*', r'.*')
- .replace('\\*', rf'[^{re.escape(self.seps)}]*')
- .replace('\\?', r'[^/]')
+ .replace("\\*\\*", r".*")
+ .replace("\\*", rf"[^{re.escape(self.seps)}]*")
+ .replace("\\?", r"[^/]")
)
def restrict_rglob(self, pattern):
@@ -76,9 +76,9 @@ def restrict_rglob(self, pattern):
...
ValueError: ** must appear alone in a path segment
"""
- seps_pattern = rf'[{re.escape(self.seps)}]+'
+ seps_pattern = rf"[{re.escape(self.seps)}]+"
segments = re.split(seps_pattern, pattern)
- if any('**' in segment and segment != '**' for segment in segments):
+ if any("**" in segment and segment != "**" for segment in segments):
raise ValueError("** must appear alone in a path segment")
def star_not_empty(self, pattern):
@@ -88,9 +88,9 @@ def star_not_empty(self, pattern):
def handle_segment(match):
segment = match.group(0)
- return '?*' if segment == '*' else segment
+ return "?*" if segment == "*" else segment
- not_seps_pattern = rf'[^{re.escape(self.seps)}]+'
+ not_seps_pattern = rf"[^{re.escape(self.seps)}]+"
return re.sub(not_seps_pattern, handle_segment, pattern)
@@ -103,4 +103,4 @@ def separate(pattern):
>>> [m.group(0) for m in separate('a[?]txt')]
['a', '[?]', 'txt']
"""
- return re.finditer(r'([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$)', pattern)
+ return re.finditer(r"([^\[]+)|(?P[\[].*?[\]])|([\[][^\]]*$)", pattern)
diff --git a/.venv3.10/Lib/site-packages/setuptools/archive_util.py b/.venv3.10/Lib/site-packages/setuptools/archive_util.py
index 1a02010b..7d0f283e 100644
--- a/.venv3.10/Lib/site-packages/setuptools/archive_util.py
+++ b/.venv3.10/Lib/site-packages/setuptools/archive_util.py
@@ -74,12 +74,12 @@ def unpack_directory(filename, extract_dir, progress_filter=default_filter) -> N
raise UnrecognizedFormat(f"{filename} is not a directory")
paths = {
- filename: ('', extract_dir),
+ filename: ("", extract_dir),
}
for base, dirs, files in os.walk(filename):
src, dst = paths[base]
for d in dirs:
- paths[os.path.join(base, d)] = src + d + '/', os.path.join(dst, d)
+ paths[os.path.join(base, d)] = src + d + "/", os.path.join(dst, d)
for f in files:
target = os.path.join(dst, f)
target = progress_filter(src + f, target)
@@ -116,21 +116,21 @@ def _unpack_zipfile_obj(zipfile_obj, extract_dir, progress_filter=default_filter
name = info.filename
# don't extract absolute paths or ones with .. in them
- if name.startswith('/') or '..' in name.split('/'):
+ if name.startswith("/") or ".." in name.split("/"):
continue
- target = os.path.join(extract_dir, *name.split('/'))
+ target = os.path.join(extract_dir, *name.split("/"))
target = progress_filter(name, target)
if not target:
continue
- if name.endswith('/'):
+ if name.endswith("/"):
# directory
ensure_directory(target)
else:
# file
ensure_directory(target)
data = zipfile_obj.read(info.filename)
- with open(target, 'wb') as f:
+ with open(target, "wb") as f:
f.write(data)
unix_attributes = info.external_attr >> 16
if unix_attributes:
@@ -155,7 +155,7 @@ def _resolve_tar_file_or_dir(tar_obj, tar_member_obj):
if is_file_or_dir:
return tar_member_obj
- raise LookupError('Got unknown file type')
+ raise LookupError("Got unknown file type")
def _iter_open_tar(tar_obj, extract_dir, progress_filter):
@@ -167,10 +167,10 @@ def _iter_open_tar(tar_obj, extract_dir, progress_filter):
for member in tar_obj:
name = member.name
# don't extract absolute paths or ones with .. in them
- if name.startswith('/') or '..' in name.split('/'):
+ if name.startswith("/") or ".." in name.split("/"):
continue
- prelim_dst = os.path.join(extract_dir, *name.split('/'))
+ prelim_dst = os.path.join(extract_dir, *name.split("/"))
try:
member = _resolve_tar_file_or_dir(tar_obj, member)
diff --git a/.venv3.10/Lib/site-packages/setuptools/build_meta.py b/.venv3.10/Lib/site-packages/setuptools/build_meta.py
index 8f2e930c..e9401f2e 100644
--- a/.venv3.10/Lib/site-packages/setuptools/build_meta.py
+++ b/.venv3.10/Lib/site-packages/setuptools/build_meta.py
@@ -55,16 +55,16 @@
from typing_extensions import TypeAlias
__all__ = [
- 'get_requires_for_build_sdist',
- 'get_requires_for_build_wheel',
- 'prepare_metadata_for_build_wheel',
- 'build_wheel',
- 'build_sdist',
- 'get_requires_for_build_editable',
- 'prepare_metadata_for_build_editable',
- 'build_editable',
- '__legacy__',
- 'SetupRequirementsError',
+ "get_requires_for_build_sdist",
+ "get_requires_for_build_wheel",
+ "prepare_metadata_for_build_wheel",
+ "build_wheel",
+ "build_sdist",
+ "get_requires_for_build_editable",
+ "prepare_metadata_for_build_editable",
+ "build_editable",
+ "__legacy__",
+ "SetupRequirementsError",
]
@@ -123,8 +123,8 @@ def _file_with_extension(directory: StrPath, extension: str | tuple[str, ...]):
(file,) = matching
except ValueError:
raise ValueError(
- 'No distribution was found. Ensure that `setup.py` '
- 'is not empty and that it calls `setup()`.'
+ "No distribution was found. Ensure that `setup.py` "
+ "is not empty and that it calls `setup()`."
) from None
return file
@@ -140,7 +140,7 @@ def _open_setup_script(setup_script):
@contextlib.contextmanager
def suppress_known_deprecation():
with warnings.catch_warnings():
- warnings.filterwarnings('ignore', 'setup.py install is deprecated')
+ warnings.filterwarnings("ignore", "setup.py install is deprecated")
yield
@@ -304,14 +304,14 @@ def _get_build_requires(
return requirements
- def run_setup(self, setup_script: str = 'setup.py'):
+ def run_setup(self, setup_script: str = "setup.py"):
# Note that we can reuse our build directory between calls
# Correctness comes first, then optimization later
__file__ = os.path.abspath(setup_script)
- __name__ = '__main__'
+ __name__ = "__main__"
with _open_setup_script(__file__) as f:
- code = f.read().replace(r'\r\n', r'\n')
+ code = f.read().replace(r"\r\n", r"\n")
try:
exec(code, locals())
@@ -422,29 +422,29 @@ def _build(cmd: list[str]):
with suppress_known_deprecation():
return self._build_with_temp_dir(
cmd,
- '.whl',
+ ".whl",
wheel_directory,
config_settings,
self._arbitrary_args(config_settings),
)
if metadata_directory is None:
- return _build(['bdist_wheel'])
+ return _build(["bdist_wheel"])
try:
- return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
+ return _build(["bdist_wheel", "--dist-info-dir", str(metadata_directory)])
except SystemExit as ex: # pragma: nocover
# pypa/setuptools#4683
if "--dist-info-dir not recognized" not in str(ex):
raise
_IncompatibleBdistWheel.emit()
- return _build(['bdist_wheel'])
+ return _build(["bdist_wheel"])
def build_sdist(
self, sdist_directory: StrPath, config_settings: _ConfigSettings = None
):
return self._build_with_temp_dir(
- ['sdist', '--formats', 'gztar'], '.tar.gz', sdist_directory, config_settings
+ ["sdist", "--formats", "gztar"], ".tar.gz", sdist_directory, config_settings
)
def _get_dist_info_dir(self, metadata_directory: StrPath | None) -> str | None:
@@ -492,7 +492,7 @@ class _BuildMetaLegacyBackend(_BuildMetaBackend):
and will eventually be removed.
"""
- def run_setup(self, setup_script: str = 'setup.py'):
+ def run_setup(self, setup_script: str = "setup.py"):
# In order to maintain compatibility with scripts assuming that
# the setup.py script is in a directory on the PYTHONPATH, inject
# '' into sys.path. (pypa/setuptools#1642)
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/__init__.py b/.venv3.10/Lib/site-packages/setuptools/command/__init__.py
index 50e6c2f5..de61dde9 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/__init__.py
@@ -8,14 +8,14 @@
from distutils.command.bdist import bdist
-if 'egg' not in bdist.format_commands:
+if "egg" not in bdist.format_commands:
try:
# format_commands is a dict in vendored distutils
# It used to be a list in older (stdlib) distutils
# We support both for backwards compatibility
- bdist.format_commands['egg'] = ('bdist_egg', "Python .egg file")
+ bdist.format_commands["egg"] = ("bdist_egg", "Python .egg file")
except TypeError:
- bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
- bdist.format_commands.append('egg')
+ bdist.format_command["egg"] = ("bdist_egg", "Python .egg file")
+ bdist.format_commands.append("egg")
del bdist, sys
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/_requirestxt.py b/.venv3.10/Lib/site-packages/setuptools/command/_requirestxt.py
index 9029b125..cf11a865 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/_requirestxt.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/_requirestxt.py
@@ -75,7 +75,7 @@ def _move_install_requirements_markers(
simple_install_requires = list(map(str, simple_reqs))
for r in complex_reqs:
- extras_require[':' + str(r.marker)].setdefault(r)
+ extras_require[":" + str(r.marker)].setdefault(r)
expanded_extras = dict(
# list(dict.fromkeys(...)) ensures a list of unique strings
@@ -88,7 +88,7 @@ def _move_install_requirements_markers(
def _suffix_for(req):
"""Return the 'extras_require' suffix for a given requirement."""
- return ':' + str(req.marker) if req.marker else ''
+ return ":" + str(req.marker) if req.marker else ""
def _clean_req(req):
@@ -106,7 +106,7 @@ def _write_requirements(stream, reqs):
lines = yield_lines(reqs or ())
def append_cr(line):
- return line + '\n'
+ return line + "\n"
lines = map(append_cr, lines)
stream.writelines(lines)
@@ -120,7 +120,7 @@ def write_requirements(cmd, basename, filename):
)
_write_requirements(data, install_requires)
for extra in sorted(extras_require):
- data.write('\n[{extra}]\n'.format(**vars()))
+ data.write("\n[{extra}]\n".format(**vars()))
_write_requirements(data, extras_require[extra])
cmd.write_or_delete_file("requirements", filename, data.getvalue())
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/alias.py b/.venv3.10/Lib/site-packages/setuptools/command/alias.py
index b8d74af7..570ff419 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/alias.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/alias.py
@@ -20,10 +20,10 @@ class alias(option_base):
command_consumes_arguments = True
user_options = [
- ('remove', 'r', 'remove (unset) the alias'),
+ ("remove", "r", "remove (unset) the alias"),
] + option_base.user_options
- boolean_options = option_base.boolean_options + ['remove']
+ boolean_options = option_base.boolean_options + ["remove"]
def initialize_options(self):
option_base.initialize_options(self)
@@ -38,7 +38,7 @@ def finalize_options(self) -> None:
)
def run(self) -> None:
- aliases = self.distribution.get_option_dict('aliases')
+ aliases = self.distribution.get_option_dict("aliases")
if not self.args:
print("Command Aliases")
@@ -59,19 +59,19 @@ def run(self) -> None:
return
else:
alias = self.args[0]
- command = ' '.join(map(shquote, self.args[1:]))
+ command = " ".join(map(shquote, self.args[1:]))
- edit_config(self.filename, {'aliases': {alias: command}}, self.dry_run)
+ edit_config(self.filename, {"aliases": {alias: command}}, self.dry_run)
def format_alias(name, aliases):
source, command = aliases[name]
- if source == config_file('global'):
- source = '--global-config '
- elif source == config_file('user'):
- source = '--user-config '
- elif source == config_file('local'):
- source = ''
+ if source == config_file("global"):
+ source = "--global-config "
+ elif source == config_file("user"):
+ source = "--user-config "
+ elif source == config_file("local"):
+ source = ""
else:
- source = f'--filename={source!r}'
- return source + name + ' ' + command
+ source = f"--filename={source!r}"
+ return source + name + " " + command
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/bdist_egg.py b/.venv3.10/Lib/site-packages/setuptools/command/bdist_egg.py
index b66020c8..735ac30a 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/bdist_egg.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/bdist_egg.py
@@ -33,9 +33,9 @@ def _get_purelib():
def strip_module(filename):
- if '.' in filename:
+ if "." in filename:
filename = os.path.splitext(filename)[0]
- if filename.endswith('module'):
+ if filename.endswith("module"):
filename = filename[:-6]
return filename
@@ -64,7 +64,7 @@ def __bootstrap__():
__bootstrap__()
"""
).lstrip()
- with open(pyfile, 'w', encoding="utf-8") as f:
+ with open(pyfile, "w", encoding="utf-8") as f:
f.write(_stub_template % resource)
@@ -72,25 +72,25 @@ class bdist_egg(Command):
description = 'create an "egg" distribution'
user_options = [
- ('bdist-dir=', 'b', "temporary directory for creating the distribution"),
+ ("bdist-dir=", "b", "temporary directory for creating the distribution"),
(
- 'plat-name=',
- 'p',
+ "plat-name=",
+ "p",
"platform name to embed in generated filenames "
"(by default uses `sysconfig.get_platform()`)",
),
- ('exclude-source-files', None, "remove all .py files from the generated egg"),
+ ("exclude-source-files", None, "remove all .py files from the generated egg"),
(
- 'keep-temp',
- 'k',
+ "keep-temp",
+ "k",
"keep the pseudo-installation tree around after "
"creating the distribution archive",
),
- ('dist-dir=', 'd', "directory to put final built distributions in"),
- ('skip-build', None, "skip rebuilding everything (for testing/debugging)"),
+ ("dist-dir=", "d", "directory to put final built distributions in"),
+ ("skip-build", None, "skip rebuilding everything (for testing/debugging)"),
]
- boolean_options = ['keep-temp', 'skip-build', 'exclude-source-files']
+ boolean_options = ["keep-temp", "skip-build", "exclude-source-files"]
def initialize_options(self):
self.bdist_dir = None
@@ -106,13 +106,13 @@ def finalize_options(self) -> None:
self.egg_info = ei_cmd.egg_info
if self.bdist_dir is None:
- bdist_base = self.get_finalized_command('bdist').bdist_base
- self.bdist_dir = os.path.join(bdist_base, 'egg')
+ bdist_base = self.get_finalized_command("bdist").bdist_base
+ self.bdist_dir = os.path.join(bdist_base, "egg")
if self.plat_name is None:
self.plat_name = get_platform()
- self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
+ self.set_undefined_options("bdist", ("dist_dir", "dist_dir"))
if self.egg_output is None:
# Compute filename of the output egg
@@ -121,11 +121,11 @@ def finalize_options(self) -> None:
platform=self.distribution.has_ext_modules() and self.plat_name,
)
- self.egg_output = os.path.join(self.dist_dir, basename + '.egg')
+ self.egg_output = os.path.join(self.dist_dir, basename + ".egg")
def do_install_data(self) -> None:
# Hack for packages that install data to install's --install-lib
- self.get_finalized_command('install').install_lib = self.bdist_dir
+ self.get_finalized_command("install").install_lib = self.bdist_dir
site_packages = os.path.normcase(os.path.realpath(_get_purelib()))
old, self.distribution.data_files = self.distribution.data_files, []
@@ -144,7 +144,7 @@ def do_install_data(self) -> None:
try:
log.info("installing package data to %s", self.bdist_dir)
- self.call_command('install_data', force=False, root=None)
+ self.call_command("install_data", force=False, root=None)
finally:
self.distribution.data_files = old
@@ -155,8 +155,8 @@ def call_command(self, cmdname, **kw):
"""Invoke reinitialized command `cmdname` with keyword args"""
for dirname in INSTALL_DIRECTORY_ATTRS:
kw.setdefault(dirname, self.bdist_dir)
- kw.setdefault('skip_build', self.skip_build)
- kw.setdefault('dry_run', self.dry_run)
+ kw.setdefault("skip_build", self.skip_build)
+ kw.setdefault("dry_run", self.dry_run)
cmd = self.reinitialize_command(cmdname, **kw)
self.run_command(cmdname)
return cmd
@@ -167,12 +167,12 @@ def run(self): # noqa: C901 # is too complex (14) # FIXME
# We run install_lib before install_data, because some data hacks
# pull their data path from the install_lib command.
log.info("installing library code to %s", self.bdist_dir)
- instcmd = self.get_finalized_command('install')
+ instcmd = self.get_finalized_command("install")
old_root = instcmd.root
instcmd.root = None
if self.distribution.has_c_libraries() and not self.skip_build:
- self.run_command('build_clib')
- cmd = self.call_command('install_lib', warn_dir=False)
+ self.run_command("build_clib")
+ cmd = self.call_command("install_lib", warn_dir=False)
instcmd.root = old_root
all_outputs, ext_outputs = self.get_ext_outputs()
@@ -180,13 +180,13 @@ def run(self): # noqa: C901 # is too complex (14) # FIXME
to_compile = []
for p, ext_name in enumerate(ext_outputs):
filename, _ext = os.path.splitext(ext_name)
- pyfile = os.path.join(self.bdist_dir, strip_module(filename) + '.py')
+ pyfile = os.path.join(self.bdist_dir, strip_module(filename) + ".py")
self.stubs.append(pyfile)
log.info("creating stub loader for %s", ext_name)
if not self.dry_run:
write_stub(os.path.basename(ext_name), pyfile)
to_compile.append(pyfile)
- ext_outputs[p] = ext_name.replace(os.sep, '/')
+ ext_outputs[p] = ext_name.replace(os.sep, "/")
if to_compile:
cmd.byte_compile(to_compile)
@@ -195,12 +195,12 @@ def run(self): # noqa: C901 # is too complex (14) # FIXME
# Make the EGG-INFO directory
archive_root = self.bdist_dir
- egg_info = os.path.join(archive_root, 'EGG-INFO')
+ egg_info = os.path.join(archive_root, "EGG-INFO")
self.mkpath(egg_info)
if self.distribution.scripts:
- script_dir = os.path.join(egg_info, 'scripts')
+ script_dir = os.path.join(egg_info, "scripts")
log.info("installing scripts to %s", script_dir)
- self.call_command('install_scripts', install_dir=script_dir, no_ep=True)
+ self.call_command("install_scripts", install_dir=script_dir, no_ep=True)
self.copy_metadata_to(egg_info)
native_libs = os.path.join(egg_info, "native_libs.txt")
@@ -208,17 +208,17 @@ def run(self): # noqa: C901 # is too complex (14) # FIXME
log.info("writing %s", native_libs)
if not self.dry_run:
ensure_directory(native_libs)
- with open(native_libs, 'wt', encoding="utf-8") as libs_file:
- libs_file.write('\n'.join(all_outputs))
- libs_file.write('\n')
+ with open(native_libs, "wt", encoding="utf-8") as libs_file:
+ libs_file.write("\n".join(all_outputs))
+ libs_file.write("\n")
elif os.path.isfile(native_libs):
log.info("removing %s", native_libs)
if not self.dry_run:
os.unlink(native_libs)
- write_safety_flag(os.path.join(archive_root, 'EGG-INFO'), self.zip_safe())
+ write_safety_flag(os.path.join(archive_root, "EGG-INFO"), self.zip_safe())
- if os.path.exists(os.path.join(self.egg_info, 'depends.txt')):
+ if os.path.exists(os.path.join(self.egg_info, "depends.txt")):
log.warn(
"WARNING: 'depends.txt' will not be used by setuptools 0.6!\n"
"Use the install_requires/extras_require setup() args instead."
@@ -239,8 +239,8 @@ def run(self): # noqa: C901 # is too complex (14) # FIXME
remove_tree(self.bdist_dir, dry_run=self.dry_run)
# Add to 'Distribution.dist_files' so that the "upload" command works
- getattr(self.distribution, 'dist_files', []).append((
- 'bdist_egg',
+ getattr(self.distribution, "dist_files", []).append((
+ "bdist_egg",
get_python_version(),
self.egg_output,
))
@@ -251,16 +251,16 @@ def zap_pyfiles(self):
for name in files:
path = os.path.join(base, name)
- if name.endswith('.py'):
+ if name.endswith(".py"):
log.debug("Deleting %s", path)
os.unlink(path)
- if base.endswith('__pycache__'):
+ if base.endswith("__pycache__"):
path_old = path
- pattern = r'(?P.+)\.(?P[^.]+)\.pyc'
+ pattern = r"(?P.+)\.(?P[^.]+)\.pyc"
m = re.match(pattern, name)
- path_new = os.path.join(base, os.pardir, m.group('name') + '.pyc')
+ path_new = os.path.join(base, os.pardir, m.group("name") + ".pyc")
log.info(f"Renaming file from [{path_old}] to [{path_new}]")
try:
os.remove(path_new)
@@ -269,21 +269,21 @@ def zap_pyfiles(self):
os.rename(path_old, path_new)
def zip_safe(self):
- safe = getattr(self.distribution, 'zip_safe', None)
+ safe = getattr(self.distribution, "zip_safe", None)
if safe is not None:
return safe
log.warn("zip_safe flag not set; analyzing archive contents...")
return analyze_egg(self.bdist_dir, self.stubs)
def gen_header(self) -> Literal["w"]:
- return 'w'
+ return "w"
def copy_metadata_to(self, target_dir) -> None:
"Copy metadata (egg info) to the target_dir"
# normalize the path (so that a forward-slash in egg_info will
# match using startswith below)
norm_egg_info = os.path.normpath(self.egg_info)
- prefix = os.path.join(norm_egg_info, '')
+ prefix = os.path.join(norm_egg_info, "")
for path in self.ei_cmd.filelist.files:
if path.startswith(prefix):
target = os.path.join(target_dir, path[len(prefix) :])
@@ -296,7 +296,7 @@ def get_ext_outputs(self):
all_outputs = []
ext_outputs = []
- paths = {self.bdist_dir: ''}
+ paths = {self.bdist_dir: ""}
for base, dirs, files in sorted_walk(self.bdist_dir):
all_outputs.extend(
paths[base] + filename
@@ -304,31 +304,31 @@ def get_ext_outputs(self):
if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS
)
for filename in dirs:
- paths[os.path.join(base, filename)] = paths[base] + filename + '/'
+ paths[os.path.join(base, filename)] = paths[base] + filename + "/"
if self.distribution.has_ext_modules():
- build_cmd = self.get_finalized_command('build_ext')
+ build_cmd = self.get_finalized_command("build_ext")
for ext in build_cmd.extensions:
if isinstance(ext, Library):
continue
fullname = build_cmd.get_ext_fullname(ext.name)
filename = build_cmd.get_ext_filename(fullname)
- if not os.path.basename(filename).startswith('dl-'):
+ if not os.path.basename(filename).startswith("dl-"):
if os.path.exists(os.path.join(self.bdist_dir, filename)):
ext_outputs.append(filename)
return all_outputs, ext_outputs
-NATIVE_EXTENSIONS: dict[str, None] = dict.fromkeys('.dll .so .dylib .pyd'.split())
+NATIVE_EXTENSIONS: dict[str, None] = dict.fromkeys(".dll .so .dylib .pyd".split())
def walk_egg(egg_dir):
"""Walk an unpacked egg's contents, skipping the metadata directory"""
walker = sorted_walk(egg_dir)
base, dirs, files = next(walker)
- if 'EGG-INFO' in dirs:
- dirs.remove('EGG-INFO')
+ if "EGG-INFO" in dirs:
+ dirs.remove("EGG-INFO")
yield base, dirs, files
yield from walker
@@ -336,16 +336,16 @@ def walk_egg(egg_dir):
def analyze_egg(egg_dir, stubs):
# check for existing flag in EGG-INFO
for flag, fn in safety_flags.items():
- if os.path.exists(os.path.join(egg_dir, 'EGG-INFO', fn)):
+ if os.path.exists(os.path.join(egg_dir, "EGG-INFO", fn)):
return flag
if not can_scan():
return False
safe = True
for base, dirs, files in walk_egg(egg_dir):
for name in files:
- if name.endswith('.py') or name.endswith('.pyw'):
+ if name.endswith(".py") or name.endswith(".pyw"):
continue
- elif name.endswith('.pyc') or name.endswith('.pyo'):
+ elif name.endswith(".pyc") or name.endswith(".pyo"):
# always scan, even if we already know we're not safe
safe = scan_module(egg_dir, base, name, stubs) and safe
return safe
@@ -359,13 +359,13 @@ def write_safety_flag(egg_dir, safe) -> None:
if safe is None or bool(safe) != flag:
os.unlink(fn)
elif safe is not None and bool(safe) == flag:
- with open(fn, 'wt', encoding="utf-8") as f:
- f.write('\n')
+ with open(fn, "wt", encoding="utf-8") as f:
+ f.write("\n")
safety_flags = {
- True: 'zip-safe',
- False: 'not-zip-safe',
+ True: "zip-safe",
+ False: "not-zip-safe",
}
@@ -375,33 +375,33 @@ def scan_module(egg_dir, base, name, stubs):
filename = os.path.join(base, name)
if filename[:-1] in stubs:
return True # Extension module
- pkg = base[len(egg_dir) + 1 :].replace(os.sep, '.')
- module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0]
+ pkg = base[len(egg_dir) + 1 :].replace(os.sep, ".")
+ module = pkg + (pkg and "." or "") + os.path.splitext(name)[0]
skip = 16 # skip magic & reserved? & date & file size
- f = open(filename, 'rb')
+ f = open(filename, "rb")
f.read(skip)
code = marshal.load(f)
f.close()
safe = True
symbols = dict.fromkeys(iter_symbols(code))
- for bad in ['__file__', '__path__']:
+ for bad in ["__file__", "__path__"]:
if bad in symbols:
log.warn("%s: module references %s", module, bad)
safe = False
- if 'inspect' in symbols:
+ if "inspect" in symbols:
for bad in [
- 'getsource',
- 'getabsfile',
- 'getfile',
- 'getsourcefile',
- 'getsourcelines',
- 'findsource',
- 'getcomments',
- 'getframeinfo',
- 'getinnerframes',
- 'getouterframes',
- 'stack',
- 'trace',
+ "getsource",
+ "getabsfile",
+ "getfile",
+ "getsourcefile",
+ "getsourcelines",
+ "findsource",
+ "getcomments",
+ "getframeinfo",
+ "getinnerframes",
+ "getouterframes",
+ "stack",
+ "trace",
]:
if bad in symbols:
log.warn("%s: module MAY be using inspect.%s", module, bad)
@@ -420,7 +420,7 @@ def iter_symbols(code):
def can_scan() -> bool:
- if not sys.platform.startswith('java') and sys.platform != 'cli':
+ if not sys.platform.startswith("java") and sys.platform != "cli":
# CPython, PyPy, etc.
return True
log.warn("Unable to analyze compiled code on this platform.")
@@ -434,7 +434,7 @@ def can_scan() -> bool:
# Attribute names of options for commands that might need to be convinced to
# install to the egg build directory
-INSTALL_DIRECTORY_ATTRS = ['install_lib', 'install_dir', 'install_data', 'install_base']
+INSTALL_DIRECTORY_ATTRS = ["install_lib", "install_dir", "install_data", "install_base"]
def make_zipfile(
@@ -443,7 +443,7 @@ def make_zipfile(
verbose: bool = False,
dry_run: bool = False,
compress=True,
- mode: _ZipFileMode = 'w',
+ mode: _ZipFileMode = "w",
) -> StrPathT:
"""Create a zip file from all the files under 'base_dir'. The output
zip file will be named 'base_dir' + ".zip". Uses either the "zipfile"
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/bdist_rpm.py b/.venv3.10/Lib/site-packages/setuptools/command/bdist_rpm.py
index 6dbb2700..a3606209 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/bdist_rpm.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/bdist_rpm.py
@@ -27,7 +27,7 @@ def run(self) -> None:
)
# ensure distro name is up-to-date
- self.run_command('egg_info')
+ self.run_command("egg_info")
orig.bdist_rpm.run(self)
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/bdist_wheel.py b/.venv3.10/Lib/site-packages/setuptools/command/bdist_wheel.py
index 91ed0017..6aec1745 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/bdist_wheel.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/bdist_wheel.py
@@ -233,7 +233,7 @@ def finalize_options(self) -> None:
self.bdist_dir = os.path.join(bdist_base, "wheel")
if self.dist_info_dir is None:
- egg_info = cast(egg_info_cls, self.distribution.get_command_obj("egg_info"))
+ egg_info = cast("egg_info_cls", self.distribution.get_command_obj("egg_info"))
egg_info.ensure_finalized() # needed for correct `wheel_dist_name`
self.data_dir = self.wheel_dist_name + ".data"
@@ -493,7 +493,7 @@ def license_paths(self) -> Iterable[str]:
metadata = self.distribution.get_option_dict("metadata")
if setuptools_major_version >= 42:
# Setuptools recognizes the license_files option but does not do globbing
- patterns = cast(Sequence[str], self.distribution.metadata.license_files)
+ patterns = cast("Sequence[str]", self.distribution.metadata.license_files)
else:
# Prior to those, wheel is entirely responsible for handling license files
if "license_files" in metadata:
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/build_clib.py b/.venv3.10/Lib/site-packages/setuptools/command/build_clib.py
index f376f4ce..0a4f0dd2 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/build_clib.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/build_clib.py
@@ -26,7 +26,7 @@ class build_clib(orig.build_clib):
def build_libraries(self, libraries) -> None:
for lib_name, build_info in libraries:
- sources = build_info.get('sources')
+ sources = build_info.get("sources")
if sources is None or not isinstance(sources, (list, tuple)):
raise DistutilsSetupError(
f"in 'libraries' option (library '{lib_name}'), "
@@ -40,7 +40,7 @@ def build_libraries(self, libraries) -> None:
# Make sure everything is the correct type.
# obj_deps should be a dictionary of keys as sources
# and a list/tuple of files that are its dependencies.
- obj_deps = build_info.get('obj_deps', dict())
+ obj_deps = build_info.get("obj_deps", dict())
if not isinstance(obj_deps, dict):
raise DistutilsSetupError(
f"in 'libraries' option (library '{lib_name}'), "
@@ -51,7 +51,7 @@ def build_libraries(self, libraries) -> None:
# Get the global dependencies that are specified by the '' key.
# These will go into every source's dependency list.
- global_deps = obj_deps.get('', list())
+ global_deps = obj_deps.get("", list())
if not isinstance(global_deps, (list, tuple)):
raise DistutilsSetupError(
f"in 'libraries' option (library '{lib_name}'), "
@@ -83,9 +83,9 @@ def build_libraries(self, libraries) -> None:
# First, compile the source code to object files in the library
# directory. (This should probably change to putting object
# files in a temporary build directory.)
- macros = build_info.get('macros')
- include_dirs = build_info.get('include_dirs')
- cflags = build_info.get('cflags')
+ macros = build_info.get("macros")
+ include_dirs = build_info.get("include_dirs")
+ cflags = build_info.get("cflags")
self.compiler.compile(
sources,
output_dir=self.build_temp,
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/build_ext.py b/.venv3.10/Lib/site-packages/setuptools/command/build_ext.py
index af73fff7..db23f3b7 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/build_ext.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/build_ext.py
@@ -28,7 +28,7 @@
# Additionally, assert that the compiler module will load
# also. Ref #1229.
- __import__('Cython.Compiler.Main')
+ __import__("Cython.Compiler.Main")
except ImportError:
from distutils.command.build_ext import build_ext as _build_ext
@@ -47,11 +47,11 @@ def _customize_compiler_for_shlib(compiler):
tmp = _CONFIG_VARS.copy()
try:
# XXX Help! I don't have any idea whether these are right...
- _CONFIG_VARS['LDSHARED'] = (
+ _CONFIG_VARS["LDSHARED"] = (
"gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
)
- _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
- _CONFIG_VARS['SO'] = ".dylib"
+ _CONFIG_VARS["CCSHARED"] = " -dynamiclib"
+ _CONFIG_VARS["SO"] = ".dylib"
customize_compiler(compiler)
finally:
_CONFIG_VARS.clear()
@@ -62,15 +62,15 @@ def _customize_compiler_for_shlib(compiler):
have_rtld = False
use_stubs = False
-libtype = 'shared'
+libtype = "shared"
if sys.platform == "darwin":
use_stubs = True
-elif os.name != 'nt':
+elif os.name != "nt":
try:
import dl # type: ignore[import-not-found] # https://github.com/python/mypy/issues/13002
- use_stubs = have_rtld = hasattr(dl, 'RTLD_NOW')
+ use_stubs = have_rtld = hasattr(dl, "RTLD_NOW")
except ImportError:
pass
@@ -78,9 +78,9 @@ def _customize_compiler_for_shlib(compiler):
def get_abi3_suffix():
"""Return the file extension for an abi3-compliant Extension()"""
for suffix in EXTENSION_SUFFIXES:
- if '.abi3' in suffix: # Unix
+ if ".abi3" in suffix: # Unix
return suffix
- elif suffix == '.pyd': # Windows
+ elif suffix == ".pyd": # Windows
return suffix
return None
@@ -101,15 +101,15 @@ def run(self):
def _get_inplace_equivalent(self, build_py, ext: Extension) -> tuple[str, str]:
fullname = self.get_ext_fullname(ext.name)
filename = self.get_ext_filename(fullname)
- modpath = fullname.split('.')
- package = '.'.join(modpath[:-1])
+ modpath = fullname.split(".")
+ package = ".".join(modpath[:-1])
package_dir = build_py.get_package_dir(package)
inplace_file = os.path.join(package_dir, os.path.basename(filename))
regular_file = os.path.join(self.build_lib, filename)
return (inplace_file, regular_file)
def copy_extensions_to_source(self) -> None:
- build_py = self.get_finalized_command('build_py')
+ build_py = self.get_finalized_command("build_py")
for ext in self.extensions:
inplace_file, regular_file = self._get_inplace_equivalent(build_py, ext)
@@ -134,8 +134,8 @@ def _get_output_mapping(self) -> Iterator[tuple[str, str]]:
if not self.inplace:
return
- build_py = self.get_finalized_command('build_py')
- opt = self.get_finalized_command('install_lib').optimize or ""
+ build_py = self.get_finalized_command("build_py")
+ opt = self.get_finalized_command("install_lib").optimize or ""
for ext in self.extensions:
inplace_file, regular_file = self._get_inplace_equivalent(build_py, ext)
@@ -156,12 +156,12 @@ def _get_output_mapping(self) -> Iterator[tuple[str, str]]:
yield (output_cache, inplace_cache)
def get_ext_filename(self, fullname: str) -> str:
- so_ext = os.getenv('SETUPTOOLS_EXT_SUFFIX')
+ so_ext = os.getenv("SETUPTOOLS_EXT_SUFFIX")
if so_ext:
- filename = os.path.join(*fullname.split('.')) + so_ext
+ filename = os.path.join(*fullname.split(".")) + so_ext
else:
filename = _build_ext.get_ext_filename(self, fullname)
- ext_suffix = get_config_var('EXT_SUFFIX')
+ ext_suffix = get_config_var("EXT_SUFFIX")
if not isinstance(ext_suffix, str):
raise OSError(
"Configuration variable EXT_SUFFIX not found for this platform "
@@ -179,7 +179,7 @@ def get_ext_filename(self, fullname: str) -> str:
return self.shlib_compiler.library_filename(fn, libtype)
elif use_stubs and ext._links_to_dynamic:
d, fn = os.path.split(filename)
- return os.path.join(d, 'dl-' + fn)
+ return os.path.join(d, "dl-" + fn)
return filename
def initialize_options(self):
@@ -204,7 +204,7 @@ def finalize_options(self) -> None:
# distutils 3.1 will also ask for module names
# XXX what to do with conflicts?
- self.ext_map[fullname.split('.')[-1]] = ext
+ self.ext_map[fullname.split(".")[-1]] = ext
ltd = self.shlibs and self.links_to_dynamic(ext) or False
ns = ltd and use_stubs and not isinstance(ext, Library)
@@ -260,7 +260,7 @@ def build_extension(self, ext) -> None:
self.compiler = self.shlib_compiler
_build_ext.build_extension(self, ext)
if ext._needs_stub:
- build_lib = self.get_finalized_command('build_py').build_lib
+ build_lib = self.get_finalized_command("build_py").build_lib
self.write_stub(build_lib, ext)
finally:
self.compiler = _compiler
@@ -271,7 +271,7 @@ def links_to_dynamic(self, ext):
# XXX as dynamic, and not just using a locally-found version or a
# XXX static-compiled version
libnames = dict.fromkeys([lib._full_name for lib in self.shlibs])
- pkg = '.'.join(ext._full_name.split('.')[:-1] + [''])
+ pkg = ".".join(ext._full_name.split(".")[:-1] + [""])
return any(pkg + libname in libnames for libname in ext.libraries)
def get_source_files(self) -> list[str]:
@@ -328,7 +328,7 @@ def get_output_mapping(self) -> dict[str, str]:
def __get_stubs_outputs(self):
# assemble the base name for each extension that needs a stub
ns_ext_bases = (
- os.path.join(self.build_lib, *ext._full_name.split('.'))
+ os.path.join(self.build_lib, *ext._full_name.split("."))
for ext in self.extensions
if ext._needs_stub
)
@@ -337,13 +337,13 @@ def __get_stubs_outputs(self):
return list(base + fnext for base, fnext in pairs)
def __get_output_extensions(self):
- yield '.py'
- yield '.pyc'
- if self.get_finalized_command('build_py').optimize:
- yield '.pyo'
+ yield ".py"
+ yield ".pyc"
+ if self.get_finalized_command("build_py").optimize:
+ yield ".pyo"
def write_stub(self, output_dir, ext, compile=False) -> None:
- stub_file = os.path.join(output_dir, *ext._full_name.split('.')) + '.py'
+ stub_file = os.path.join(output_dir, *ext._full_name.split(".")) + ".py"
self._write_stub_file(stub_file, ext, compile)
def _write_stub_file(self, stub_file: str, ext: Extension, compile=False):
@@ -351,7 +351,7 @@ def _write_stub_file(self, stub_file: str, ext: Extension, compile=False):
if compile and os.path.exists(stub_file):
raise BaseError(stub_file + " already exists! Please delete.")
if not self.dry_run:
- with open(stub_file, 'w', encoding="utf-8") as f:
+ with open(stub_file, "w", encoding="utf-8") as f:
content = (
textwrap.dedent(f"""
def __bootstrap__():
@@ -378,7 +378,7 @@ def __bootstrap__():
__bootstrap__()
""")
.lstrip()
- .replace('#rtld', '#rtld' * (not have_rtld))
+ .replace("#rtld", "#rtld" * (not have_rtld))
)
f.write(content)
if compile:
@@ -388,7 +388,7 @@ def _compile_and_remove_stub(self, stub_file: str):
from distutils.util import byte_compile
byte_compile([stub_file], optimize=0, force=True, dry_run=self.dry_run)
- optimize = self.get_finalized_command('install_lib').optimize
+ optimize = self.get_finalized_command("install_lib").optimize
if optimize > 0:
byte_compile(
[stub_file],
@@ -400,7 +400,7 @@ def _compile_and_remove_stub(self, stub_file: str):
os.unlink(stub_file)
-if use_stubs or os.name == 'nt':
+if use_stubs or os.name == "nt":
# Build shared libraries
#
def link_shared_object(
@@ -436,7 +436,7 @@ def link_shared_object(
else:
# Build static libraries everywhere else
- libtype = 'static'
+ libtype = "static"
def link_shared_object(
self,
@@ -462,7 +462,7 @@ def link_shared_object(
assert output_dir is None # distutils build_ext doesn't pass this
output_dir, filename = os.path.split(output_libname)
basename, _ext = os.path.splitext(filename)
- if self.library_filename("x").startswith('lib'):
+ if self.library_filename("x").startswith("lib"):
# strip 'lib' prefix; this is kludgy if some platform uses
# a different prefix
basename = basename[3:]
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/build_py.py b/.venv3.10/Lib/site-packages/setuptools/command/build_py.py
index 2f6fcb7c..1c7e0557 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/build_py.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/build_py.py
@@ -20,7 +20,7 @@
import distutils.errors
from distutils.util import convert_path
-_IMPLICIT_DATA_FILES = ('*.pyi', 'py.typed')
+_IMPLICIT_DATA_FILES = ("*.pyi", "py.typed")
def make_writable(target) -> None:
@@ -45,8 +45,8 @@ def finalize_options(self):
orig.build_py.finalize_options(self)
self.package_data = self.distribution.package_data
self.exclude_package_data = self.distribution.exclude_package_data or {}
- if 'data_files' in self.__dict__:
- del self.__dict__['data_files']
+ if "data_files" in self.__dict__:
+ del self.__dict__["data_files"]
def copy_file( # type: ignore[override] # No overload, no bytes support
self,
@@ -83,7 +83,7 @@ def run(self) -> None:
def __getattr__(self, attr: str):
"lazily compute data files"
- if attr == 'data_files':
+ if attr == "data_files":
self.data_files = self._get_data_files()
return self.data_files
return orig.build_py.__getattr__(self, attr)
@@ -100,7 +100,7 @@ def get_data_files_without_manifest(self):
"""
# Prevent eventual errors from unset `manifest_files`
# (that would otherwise be set by `analyze_manifest`)
- self.__dict__.setdefault('manifest_files', {})
+ self.__dict__.setdefault("manifest_files", {})
return list(map(self._get_pkg_data_files, self.packages or ()))
def _get_pkg_data_files(self, package):
@@ -108,7 +108,7 @@ def _get_pkg_data_files(self, package):
src_dir = self.get_package_dir(package)
# Compute package build directory
- build_dir = os.path.join(*([self.build_lib] + package.split('.')))
+ build_dir = os.path.join(*([self.build_lib] + package.split(".")))
# Strip directory from globbed filenames
filenames = [
@@ -152,7 +152,7 @@ def get_output_mapping(self) -> dict[str, str]:
def _get_module_mapping(self) -> Iterator[tuple[str, str]]:
"""Iterate over all modules producing (dest, src) pairs."""
for package, module, module_file in self.find_all_modules():
- package = package.split('.')
+ package = package.split(".")
filename = self.get_module_outfile(self.build_lib, package, module)
yield (filename, module_file)
@@ -188,8 +188,8 @@ def analyze_manifest(self) -> None:
manifest = Path(egg_info_dir, "SOURCES.txt")
files = manifest.read_text(encoding="utf-8").splitlines()
else:
- self.run_command('egg_info')
- ei_cmd = self.get_finalized_command('egg_info')
+ self.run_command("egg_info")
+ ei_cmd = self.get_finalized_command("egg_info")
egg_info_dir = ei_cmd.egg_info
files = ei_cmd.filelist.files
@@ -250,14 +250,14 @@ def check_package(self, package, package_dir):
return init_py
for pkg in self.distribution.namespace_packages:
- if pkg == package or pkg.startswith(package + '.'):
+ if pkg == package or pkg.startswith(package + "."):
break
else:
return init_py
- with open(init_py, 'rb') as f:
+ with open(init_py, "rb") as f:
contents = f.read()
- if b'declare_namespace' not in contents:
+ if b"declare_namespace" not in contents:
raise distutils.errors.DistutilsError(
f"Namespace package problem: {package} is a namespace package, but "
"its\n__init__.py does not call declare_namespace()! Please "
@@ -304,7 +304,7 @@ def _get_platform_patterns(spec, package, src_dir, extra_patterns=()):
"""
raw_patterns = itertools.chain(
extra_patterns,
- spec.get('', []),
+ spec.get("", []),
spec.get(package, []),
)
return (
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/develop.py b/.venv3.10/Lib/site-packages/setuptools/command/develop.py
index 1f704fce..eff8ed25 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/develop.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/develop.py
@@ -11,14 +11,14 @@ class develop(Command):
user_options = [
("install-dir=", "d", "install package to DIR"),
- ('no-deps', 'N', "don't install dependencies"),
- ('user', None, f"install in user site-package '{site.USER_SITE}'"),
- ('prefix=', None, "installation prefix"),
+ ("no-deps", "N", "don't install dependencies"),
+ ("user", None, f"install in user site-package '{site.USER_SITE}'"),
+ ("prefix=", None, "installation prefix"),
("index-url=", "i", "base URL of Python Package Index"),
]
boolean_options = [
- 'no-deps',
- 'user',
+ "no-deps",
+ "user",
]
install_dir = None
@@ -29,12 +29,12 @@ class develop(Command):
def run(self):
cmd = (
- [sys.executable, '-m', 'pip', 'install', '-e', '.', '--use-pep517']
- + ['--target', self.install_dir] * bool(self.install_dir)
- + ['--no-deps'] * self.no_deps
- + ['--user'] * self.user
- + ['--prefix', self.prefix] * bool(self.prefix)
- + ['--index-url', self.index_url] * bool(self.index_url)
+ [sys.executable, "-m", "pip", "install", "-e", ".", "--use-pep517"]
+ + ["--target", self.install_dir] * bool(self.install_dir)
+ + ["--no-deps"] * self.no_deps
+ + ["--user"] * self.user
+ + ["--prefix", self.prefix] * bool(self.prefix)
+ + ["--index-url", self.index_url] * bool(self.index_url)
)
subprocess.check_call(cmd)
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/dist_info.py b/.venv3.10/Lib/site-packages/setuptools/command/dist_info.py
index dca01ff0..3719075f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/dist_info.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/dist_info.py
@@ -27,19 +27,19 @@ class dist_info(Command):
user_options = [
(
- 'output-dir=',
- 'o',
+ "output-dir=",
+ "o",
"directory inside of which the .dist-info will be"
"created [default: top of the source tree]",
),
- ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"),
- ('tag-build=', 'b', "Specify explicit tag to add to version number"),
- ('no-date', 'D', "Don't include date stamp [default]"),
- ('keep-egg-info', None, "*TRANSITIONAL* will be removed in the future"),
+ ("tag-date", "d", "Add date stamp (e.g. 20050528) to version number"),
+ ("tag-build=", "b", "Specify explicit tag to add to version number"),
+ ("no-date", "D", "Don't include date stamp [default]"),
+ ("keep-egg-info", None, "*TRANSITIONAL* will be removed in the future"),
]
- boolean_options = ['tag-date', 'keep-egg-info']
- negative_opt = {'no-date': 'tag-date'}
+ boolean_options = ["tag-date", "keep-egg-info"]
+ negative_opt = {"no-date": "tag-date"}
def initialize_options(self):
self.output_dir = None
@@ -54,7 +54,7 @@ def finalize_options(self) -> None:
project_dir = dist.src_root or os.curdir
self.output_dir = Path(self.output_dir or project_dir)
- egg_info = cast(egg_info_cls, self.reinitialize_command("egg_info"))
+ egg_info = cast("egg_info_cls", self.reinitialize_command("egg_info"))
egg_info.egg_base = str(self.output_dir)
if self.tag_date:
@@ -96,7 +96,7 @@ def run(self) -> None:
assert os.path.isdir(egg_info_dir), ".egg-info dir should have been created"
log.info(f"creating '{os.path.abspath(self.dist_info_dir)}'")
- bdist_wheel = self.get_finalized_command('bdist_wheel')
+ bdist_wheel = self.get_finalized_command("bdist_wheel")
# TODO: if bdist_wheel if merged into setuptools, just add "keep_egg_info" there
with self._maybe_bkp_dir(egg_info_dir, self.keep_egg_info):
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/editable_wheel.py b/.venv3.10/Lib/site-packages/setuptools/command/editable_wheel.py
index c7725708..ad3810f1 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/editable_wheel.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/editable_wheel.py
@@ -149,7 +149,7 @@ def run(self) -> None:
def _ensure_dist_info(self):
if self.dist_info_dir is None:
- dist_info = cast(dist_info_cls, self.reinitialize_command("dist_info"))
+ dist_info = cast("dist_info_cls", self.reinitialize_command("dist_info"))
dist_info.output_dir = self.dist_dir
dist_info.ensure_finalized()
dist_info.run()
@@ -197,16 +197,16 @@ def _configure_build(
# egg-info may be generated again to create a manifest (used for package data)
egg_info = cast(
- egg_info_cls, dist.reinitialize_command("egg_info", reinit_subcommands=True)
+ "egg_info_cls", dist.reinitialize_command("egg_info", reinit_subcommands=True)
)
egg_info.egg_base = str(tmp_dir)
egg_info.ignore_egg_info_in_manifest = True
build = cast(
- build_cls, dist.reinitialize_command("build", reinit_subcommands=True)
+ "build_cls", dist.reinitialize_command("build", reinit_subcommands=True)
)
install = cast(
- install_cls, dist.reinitialize_command("install", reinit_subcommands=True)
+ "install_cls", dist.reinitialize_command("install", reinit_subcommands=True)
)
build.build_platlib = build.build_purelib = build.build_lib = build_lib
@@ -218,16 +218,16 @@ def _configure_build(
# For portability, ensure scripts are built with #!python shebang
# pypa/setuptools#4863
build_scripts = dist.get_command_obj("build_scripts")
- build_scripts.executable = 'python'
+ build_scripts.executable = "python"
install_scripts = cast(
- install_scripts_cls, dist.get_command_obj("install_scripts")
+ "install_scripts_cls", dist.get_command_obj("install_scripts")
)
install_scripts.no_ep = True
build.build_temp = str(tmp_dir)
- build_py = cast(build_py_cls, dist.get_command_obj("build_py"))
+ build_py = cast("build_py_cls", dist.get_command_obj("build_py"))
build_py.compile = False
build_py.existing_egg_info_dir = self._find_egg_info_dir()
@@ -459,7 +459,7 @@ def _normalize_output(self, file: str) -> str | None:
# Files relative to build_lib will be normalized to None
with suppress(ValueError):
path = Path(file).resolve().relative_to(self.build_lib)
- return str(path).replace(os.sep, '/')
+ return str(path).replace(os.sep, "/")
return None
def _create_file(self, relative_output: str, src_file: str, link=None):
@@ -644,7 +644,7 @@ def _simple_layout(
return set(package_dir) in ({}, {""})
parent = os.path.commonpath(starmap(_parent_path, layout.items()))
return all(
- _path.same_path(Path(parent, *key.split('.')), value)
+ _path.same_path(Path(parent, *key.split(".")), value)
for key, value in layout.items()
)
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/egg_info.py b/.venv3.10/Lib/site-packages/setuptools/command/egg_info.py
index 7e00ae2c..ec448034 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/egg_info.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/egg_info.py
@@ -32,7 +32,7 @@
from distutils.filelist import FileList as _FileList
from distutils.util import convert_path
-PY_MAJOR = f'{sys.version_info.major}.{sys.version_info.minor}'
+PY_MAJOR = f"{sys.version_info.major}.{sys.version_info.minor}"
def translate_pattern(glob): # noqa: C901 # is too complex (14) # FIXME
@@ -42,25 +42,25 @@ def translate_pattern(glob): # noqa: C901 # is too complex (14) # FIXME
directory separators. It also knows about '**/' which matches any number of
directories.
"""
- pat = ''
+ pat = ""
# This will split on '/' within [character classes]. This is deliberate.
chunks = glob.split(os.path.sep)
sep = re.escape(os.sep)
- valid_char = f'[^{sep}]'
+ valid_char = f"[^{sep}]"
for c, chunk in enumerate(chunks):
last_chunk = c == len(chunks) - 1
# Chunks that are a literal ** are globstars. They match anything.
- if chunk == '**':
+ if chunk == "**":
if last_chunk:
# Match anything if this is the last component
- pat += '.*'
+ pat += ".*"
else:
# Match '(name/)*'
- pat += f'(?:{valid_char}+{sep})*'
+ pat += f"(?:{valid_char}+{sep})*"
continue # Break here as the whole path component has been handled
# Find any special characters in the remainder
@@ -68,23 +68,23 @@ def translate_pattern(glob): # noqa: C901 # is too complex (14) # FIXME
chunk_len = len(chunk)
while i < chunk_len:
char = chunk[i]
- if char == '*':
+ if char == "*":
# Match any number of name characters
- pat += valid_char + '*'
- elif char == '?':
+ pat += valid_char + "*"
+ elif char == "?":
# Match a name character
pat += valid_char
- elif char == '[':
+ elif char == "[":
# Character class
inner_i = i + 1
# Skip initial !/] chars
- if inner_i < chunk_len and chunk[inner_i] == '!':
+ if inner_i < chunk_len and chunk[inner_i] == "!":
inner_i = inner_i + 1
- if inner_i < chunk_len and chunk[inner_i] == ']':
+ if inner_i < chunk_len and chunk[inner_i] == "]":
inner_i = inner_i + 1
# Loop till the closing ] is found
- while inner_i < chunk_len and chunk[inner_i] != ']':
+ while inner_i < chunk_len and chunk[inner_i] != "]":
inner_i = inner_i + 1
if inner_i >= chunk_len:
@@ -94,15 +94,15 @@ def translate_pattern(glob): # noqa: C901 # is too complex (14) # FIXME
else:
# Grab the insides of the [brackets]
inner = chunk[i + 1 : inner_i]
- char_class = ''
+ char_class = ""
# Class negation
- if inner[0] == '!':
- char_class = '^'
+ if inner[0] == "!":
+ char_class = "^"
inner = inner[1:]
char_class += re.escape(inner)
- pat += f'[{char_class}]'
+ pat += f"[{char_class}]"
# Skip to the end ]
i = inner_i
@@ -114,7 +114,7 @@ def translate_pattern(glob): # noqa: C901 # is too complex (14) # FIXME
if not last_chunk:
pat += sep
- pat += r'\Z'
+ pat += r"\Z"
return re.compile(pat, flags=re.MULTILINE | re.DOTALL)
@@ -152,10 +152,10 @@ def _safe_tags(self) -> str:
try:
return _normalization.safe_version(f"0{self.vtags}")[1:]
except packaging.version.InvalidVersion:
- return _normalization.safe_name(self.vtags.replace(' ', '.'))
+ return _normalization.safe_name(self.vtags.replace(" ", "."))
def tags(self) -> str:
- version = ''
+ version = ""
if self.tag_build:
version += self.tag_build
if self.tag_date:
@@ -170,19 +170,19 @@ class egg_info(InfoCommon, Command):
user_options = [
(
- 'egg-base=',
- 'e',
+ "egg-base=",
+ "e",
"directory containing .egg-info directories"
" [default: top of the source tree]",
),
- ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"),
- ('tag-build=', 'b', "Specify explicit tag to add to version number"),
- ('no-date', 'D', "Don't include date stamp [default]"),
+ ("tag-date", "d", "Add date stamp (e.g. 20050528) to version number"),
+ ("tag-build=", "b", "Specify explicit tag to add to version number"),
+ ("no-date", "D", "Don't include date stamp [default]"),
]
- boolean_options = ['tag-date']
+ boolean_options = ["tag-date"]
negative_opt = {
- 'no-date': 'tag-date',
+ "no-date": "tag-date",
}
def initialize_options(self):
@@ -236,10 +236,10 @@ def finalize_options(self) -> None:
if self.egg_base is None:
dirs = self.distribution.package_dir
- self.egg_base = (dirs or {}).get('', os.curdir)
+ self.egg_base = (dirs or {}).get("", os.curdir)
- self.ensure_dirname('egg_base')
- self.egg_info = _normalization.filename_component(self.egg_name) + '.egg-info'
+ self.ensure_dirname("egg_base")
+ self.egg_info = _normalization.filename_component(self.egg_name) + ".egg-info"
if self.egg_base != os.curdir:
self.egg_info = os.path.join(self.egg_base, self.egg_info)
@@ -279,7 +279,7 @@ def write_file(self, what, filename, data) -> None:
log.info("writing %s to %s", what, filename)
data = data.encode("utf-8")
if not self.dry_run:
- f = open(filename, 'wb')
+ f = open(filename, "wb")
f.write(data)
f.close()
@@ -292,7 +292,7 @@ def delete_file(self, filename) -> None:
def run(self) -> None:
# Pre-load to avoid iterating over entry-points while an empty .egg-info
# exists in sys.path. See pypa/pyproject-hooks#206
- writers = list(metadata.entry_points(group='egg_info.writers'))
+ writers = list(metadata.entry_points(group="egg_info.writers"))
self.mkpath(self.egg_info)
try:
@@ -339,40 +339,40 @@ def process_template_line(self, line) -> None:
(action, patterns, dir, dir_pattern) = self._parse_template_line(line)
action_map: dict[str, Callable] = {
- 'include': self.include,
- 'exclude': self.exclude,
- 'global-include': self.global_include,
- 'global-exclude': self.global_exclude,
- 'recursive-include': functools.partial(
+ "include": self.include,
+ "exclude": self.exclude,
+ "global-include": self.global_include,
+ "global-exclude": self.global_exclude,
+ "recursive-include": functools.partial(
self.recursive_include,
dir,
),
- 'recursive-exclude': functools.partial(
+ "recursive-exclude": functools.partial(
self.recursive_exclude,
dir,
),
- 'graft': self.graft,
- 'prune': self.prune,
+ "graft": self.graft,
+ "prune": self.prune,
}
log_map = {
- 'include': "warning: no files found matching '%s'",
- 'exclude': ("warning: no previously-included files found matching '%s'"),
- 'global-include': (
+ "include": "warning: no files found matching '%s'",
+ "exclude": ("warning: no previously-included files found matching '%s'"),
+ "global-include": (
"warning: no files found matching '%s' anywhere in distribution"
),
- 'global-exclude': (
+ "global-exclude": (
"warning: no previously-included files matching "
"'%s' found anywhere in distribution"
),
- 'recursive-include': (
+ "recursive-include": (
"warning: no files found matching '%s' under directory '%s'"
),
- 'recursive-exclude': (
+ "recursive-exclude": (
"warning: no previously-included files matching "
"'%s' found under directory '%s'"
),
- 'graft': "warning: no directories found matching '%s'",
- 'prune': "no previously-included directories found matching '%s'",
+ "graft": "warning: no directories found matching '%s'",
+ "prune": "no previously-included directories found matching '%s'",
}
try:
@@ -385,14 +385,14 @@ def process_template_line(self, line) -> None:
# right number of words on the line for that action -- so we
# can proceed with minimal error-checking.
- action_is_recursive = action.startswith('recursive-')
- if action in {'graft', 'prune'}:
+ action_is_recursive = action.startswith("recursive-")
+ if action in {"graft", "prune"}:
patterns = [dir_pattern]
extra_log_args = (dir,) if action_is_recursive else ()
log_tmpl = log_map[action]
self.debug_print(
- ' '.join(
+ " ".join(
[action] + ([dir] if action_is_recursive else []) + patterns,
)
)
@@ -428,7 +428,7 @@ def recursive_include(self, dir, pattern):
"""
Include all files anywhere in 'dir/' that match the pattern.
"""
- full_pattern = os.path.join(dir, '**', pattern)
+ full_pattern = os.path.join(dir, "**", pattern)
found = [f for f in glob(full_pattern, recursive=True) if not os.path.isdir(f)]
self.extend(found)
return bool(found)
@@ -437,7 +437,7 @@ def recursive_exclude(self, dir, pattern):
"""
Exclude any file anywhere in 'dir/' that match the pattern.
"""
- match = translate_pattern(os.path.join(dir, '**', pattern))
+ match = translate_pattern(os.path.join(dir, "**", pattern))
return self._remove_files(match.match)
def graft(self, dir):
@@ -452,7 +452,7 @@ def graft(self, dir):
def prune(self, dir):
"""Filter out files from 'dir/'."""
- match = translate_pattern(os.path.join(dir, '**'))
+ match = translate_pattern(os.path.join(dir, "**"))
return self._remove_files(match.match)
def global_include(self, pattern):
@@ -462,7 +462,7 @@ def global_include(self, pattern):
"""
if self.allfiles is None:
self.findall()
- match = translate_pattern(os.path.join('**', pattern))
+ match = translate_pattern(os.path.join("**", pattern))
found = [f for f in self.allfiles if match.match(f)]
self.extend(found)
return bool(found)
@@ -471,11 +471,11 @@ def global_exclude(self, pattern):
"""
Exclude all files anywhere that match the pattern.
"""
- match = translate_pattern(os.path.join('**', pattern))
+ match = translate_pattern(os.path.join("**", pattern))
return self._remove_files(match.match)
def append(self, item) -> None:
- if item.endswith('\r'): # Fix older sdists built on Windows
+ if item.endswith("\r"): # Fix older sdists built on Windows
item = item[:-1]
path = convert_path(item)
@@ -507,7 +507,7 @@ def _safe_path(self, path):
# Must ensure utf-8 encodability
utf8_path = unicode_utils.try_encode(u_path, "utf-8")
if utf8_path is None:
- log.warn(enc_warn, path, 'utf-8')
+ log.warn(enc_warn, path, "utf-8")
return False
try:
@@ -552,7 +552,7 @@ def run(self) -> None:
def _manifest_normalize(self, path):
path = unicode_utils.filesys_decode(path)
- return path.replace(os.sep, '/')
+ return path.replace(os.sep, "/")
def write_manifest(self) -> None:
"""
@@ -592,7 +592,7 @@ def add_defaults(self) -> None:
# the script called to create the sdist
self.filelist.append("setup.py")
- ei_cmd = self.get_finalized_command('egg_info')
+ ei_cmd = self.get_finalized_command("egg_info")
self.filelist.graft(ei_cmd.egg_info)
def add_license_files(self) -> None:
@@ -603,7 +603,7 @@ def add_license_files(self) -> None:
def _add_referenced_files(self):
"""Add files referenced by the config (e.g. `file:` directive) to filelist"""
- referenced = getattr(self.distribution, '_referenced_files', [])
+ referenced = getattr(self.distribution, "_referenced_files", [])
# ^-- fallback if dist comes from distutils or is a custom class
for rf in referenced:
log.debug("adding file referenced by config '%s'", rf)
@@ -619,7 +619,7 @@ def _safe_data_files(self, build_py):
Therefore, avoid triggering any attempt of
analyzing/building the manifest again.
"""
- if hasattr(build_py, 'get_data_files_without_manifest'):
+ if hasattr(build_py, "get_data_files_without_manifest"):
return build_py.get_data_files_without_manifest()
SetuptoolsDeprecationWarning.emit(
@@ -659,7 +659,7 @@ def write_pkg_info(cmd, basename, filename) -> None:
finally:
metadata.name, metadata.version = oldname, oldver
- safe = getattr(cmd.distribution, 'zip_safe', None)
+ safe = getattr(cmd.distribution, "zip_safe", None)
bdist_egg.write_safety_flag(cmd.egg_info, safe)
@@ -681,9 +681,9 @@ def warn_depends_obsolete(cmd, basename, filename) -> None:
def write_toplevel_names(cmd, basename, filename) -> None:
pkgs = dict.fromkeys([
- k.split('.', 1)[0] for k in cmd.distribution.iter_distribution_names()
+ k.split(".", 1)[0] for k in cmd.distribution.iter_distribution_names()
])
- cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs)) + '\n')
+ cmd.write_file("top-level names", filename, "\n".join(sorted(pkgs)) + "\n")
def overwrite_arg(cmd, basename, filename) -> None:
@@ -694,14 +694,14 @@ def write_arg(cmd, basename, filename, force: bool = False) -> None:
argname = os.path.splitext(basename)[0]
value = getattr(cmd.distribution, argname, None)
if value is not None:
- value = '\n'.join(value) + '\n'
+ value = "\n".join(value) + "\n"
cmd.write_or_delete_file(argname, filename, value, force)
def write_entries(cmd, basename, filename) -> None:
eps = _entry_points.load(cmd.distribution.entry_points)
defn = _entry_points.render(eps)
- cmd.write_or_delete_file('entry points', filename, defn, True)
+ cmd.write_or_delete_file("entry points", filename, defn, True)
def _egg_basename(egg_name, egg_version, py_version=None, platform=None):
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/install.py b/.venv3.10/Lib/site-packages/setuptools/command/install.py
index 19ca6014..7e2fa597 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/install.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/install.py
@@ -35,22 +35,22 @@ class install(orig.install):
distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
user_options = orig.install.user_options + [
- ('old-and-unmanageable', None, "Try not to use this!"),
+ ("old-and-unmanageable", None, "Try not to use this!"),
(
- 'single-version-externally-managed',
+ "single-version-externally-managed",
None,
"used by system package builders to create 'flat' eggs",
),
]
boolean_options = orig.install.boolean_options + [
- 'old-and-unmanageable',
- 'single-version-externally-managed',
+ "old-and-unmanageable",
+ "single-version-externally-managed",
]
# Type the same as distutils.command.install.install.sub_commands
# Must keep the second tuple item potentially None due to invariance
new_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] = [
- ('install_egg_info', lambda self: True),
- ('install_scripts', lambda self: True),
+ ("install_egg_info", lambda self: True),
+ ("install_scripts", lambda self: True),
]
_nc = dict(new_commands)
@@ -88,7 +88,7 @@ def handle_extra_path(self):
# Ignore extra_path when installing an egg (or being run by another
# command without --root or --single-version-externally-managed
self.path_file = None
- self.extra_dirs = ''
+ self.extra_dirs = ""
return None
@staticmethod
@@ -105,7 +105,7 @@ def _called_from_setup(run_frame):
if run_frame is None:
msg = "Call stack not available. bdist_* commands may fail."
SetuptoolsWarning.emit(msg)
- if platform.python_implementation() == 'IronPython':
+ if platform.python_implementation() == "IronPython":
msg = "For best results, pass -X:Frames to enable call stack."
SetuptoolsWarning.emit(msg)
return True
@@ -114,13 +114,13 @@ def _called_from_setup(run_frame):
for frame in frames[2:4]:
(caller,) = frame[:1]
info = inspect.getframeinfo(caller)
- caller_module = caller.f_globals.get('__name__', '')
+ caller_module = caller.f_globals.get("__name__", "")
if caller_module == "setuptools.dist" and info.function == "run_command":
# Starting from v61.0.0 setuptools overwrites dist.run_command
continue
- return caller_module == 'distutils.dist' and info.function == 'run_commands'
+ return caller_module == "distutils.dist" and info.function == "run_commands"
return False
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/install_egg_info.py b/.venv3.10/Lib/site-packages/setuptools/command/install_egg_info.py
index 44f22ccf..a268f613 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/install_egg_info.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/install_egg_info.py
@@ -14,14 +14,14 @@ class install_egg_info(namespaces.Installer, Command):
description = "Install an .egg-info directory for the package"
user_options = [
- ('install-dir=', 'd', "directory to install to"),
+ ("install-dir=", "d", "directory to install to"),
]
def initialize_options(self):
self.install_dir = None
def finalize_options(self) -> None:
- self.set_undefined_options('install_lib', ('install_dir', 'install_dir'))
+ self.set_undefined_options("install_lib", ("install_dir", "install_dir"))
ei_cmd = self.get_finalized_command("egg_info")
basename = f"{ei_cmd._get_egg_basename()}.egg-info"
self.source = ei_cmd.egg_info
@@ -29,7 +29,7 @@ def finalize_options(self) -> None:
self.outputs: list[str] = []
def run(self) -> None:
- self.run_command('egg_info')
+ self.run_command("egg_info")
if os.path.isdir(self.target) and not os.path.islink(self.target):
dir_util.remove_tree(self.target, dry_run=self.dry_run)
elif os.path.exists(self.target):
@@ -48,8 +48,8 @@ def skimmer(src, dst):
# filter out source-control directories; note that 'src' is always
# a '/'-separated path, regardless of platform. 'dst' is a
# platform-specific path.
- for skip in '.svn/', 'CVS/':
- if src.startswith(skip) or '/' + skip in src:
+ for skip in ".svn/", "CVS/":
+ if src.startswith(skip) or "/" + skip in src:
return None
self.outputs.append(dst)
log.debug("Copying %s to %s", src, dst)
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/install_lib.py b/.venv3.10/Lib/site-packages/setuptools/command/install_lib.py
index 8e1e0727..3273821f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/install_lib.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/install_lib.py
@@ -41,7 +41,7 @@ def _exclude_pkg_path(self, pkg, exclusion_path):
Given a package name and exclusion path within that package,
compute the full exclusion path.
"""
- parts = pkg.split('.') + [exclusion_path]
+ parts = pkg.split(".") + [exclusion_path]
return os.path.join(self.install_dir, *parts)
@staticmethod
@@ -52,7 +52,7 @@ def _all_packages(pkg_name):
"""
while pkg_name:
yield pkg_name
- pkg_name, _sep, _child = pkg_name.rpartition('.')
+ pkg_name, _sep, _child = pkg_name.rpartition(".")
def _get_SVEM_NSPs(self):
"""
@@ -65,7 +65,7 @@ def _get_SVEM_NSPs(self):
if not self.distribution.namespace_packages:
return []
- install_cmd = self.get_finalized_command('install')
+ install_cmd = self.get_finalized_command("install")
svem = install_cmd.single_version_externally_managed
return self.distribution.namespace_packages if svem else []
@@ -77,19 +77,19 @@ def _gen_exclusion_paths():
cache files).
"""
# always exclude the package module itself
- yield '__init__.py'
+ yield "__init__.py"
- yield '__init__.pyc'
- yield '__init__.pyo'
+ yield "__init__.pyc"
+ yield "__init__.pyo"
- if not hasattr(sys, 'implementation'):
+ if not hasattr(sys, "implementation"):
return
- base = os.path.join('__pycache__', '__init__.' + sys.implementation.cache_tag)
- yield base + '.pyc'
- yield base + '.pyo'
- yield base + '.opt-1.pyc'
- yield base + '.opt-2.pyc'
+ base = os.path.join("__pycache__", "__init__." + sys.implementation.cache_tag)
+ yield base + ".pyc"
+ yield base + ".pyo"
+ yield base + ".opt-1.pyc"
+ yield base + ".opt-2.pyc"
def copy_tree(
self,
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/install_scripts.py b/.venv3.10/Lib/site-packages/setuptools/command/install_scripts.py
index 537181e3..0aee739e 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/install_scripts.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/install_scripts.py
@@ -37,8 +37,8 @@ def _install_ep_scripts(self):
ei_cmd = self.get_finalized_command("egg_info")
dist = metadata.Distribution.at(path=ei_cmd.egg_info)
- bs_cmd = self.get_finalized_command('build_scripts')
- exec_param = getattr(bs_cmd, 'executable', None)
+ bs_cmd = self.get_finalized_command("build_scripts")
+ exec_param = getattr(bs_cmd, "executable", None)
writer = _scripts.ScriptWriter
if exec_param == sys.executable:
# In case the path to the Python executable contains a space, wrap
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/rotate.py b/.venv3.10/Lib/site-packages/setuptools/command/rotate.py
index acdce07b..6a9095fc 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/rotate.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/rotate.py
@@ -15,9 +15,9 @@ class rotate(Command):
description = "delete older distributions, keeping N newest files"
user_options = [
- ('match=', 'm', "patterns to match (required)"),
- ('dist-dir=', 'd', "directory where the distributions are"),
- ('keep=', 'k', "number of matching distributions to keep"),
+ ("match=", "m", "patterns to match (required)"),
+ ("dist-dir=", "d", "directory where the distributions are"),
+ ("keep=", "k", "number of matching distributions to keep"),
]
boolean_options: ClassVar[list[str]] = []
@@ -40,15 +40,15 @@ def finalize_options(self) -> None:
except ValueError as e:
raise DistutilsOptionError("--keep must be an integer") from e
if isinstance(self.match, str):
- self.match = [convert_path(p.strip()) for p in self.match.split(',')]
- self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
+ self.match = [convert_path(p.strip()) for p in self.match.split(",")]
+ self.set_undefined_options("bdist", ("dist_dir", "dist_dir"))
def run(self) -> None:
self.run_command("egg_info")
from glob import glob
for pattern in self.match:
- pattern = self.distribution.get_name() + '*' + pattern
+ pattern = self.distribution.get_name() + "*" + pattern
files = glob(os.path.join(self.dist_dir, pattern))
files = [(os.path.getmtime(f), f) for f in files]
files.sort()
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/saveopts.py b/.venv3.10/Lib/site-packages/setuptools/command/saveopts.py
index 2a2cbce6..2f1c2ee9 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/saveopts.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/saveopts.py
@@ -11,7 +11,7 @@ def run(self) -> None:
settings: dict[str, dict[str, str]] = {}
for cmd in dist.command_options:
- if cmd == 'saveopts':
+ if cmd == "saveopts":
continue # don't save our own options!
for opt, (src, val) in dist.get_option_dict(cmd).items():
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/sdist.py b/.venv3.10/Lib/site-packages/setuptools/command/sdist.py
index 1aed1d5e..62e27871 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/sdist.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/sdist.py
@@ -16,9 +16,9 @@
_default_revctrl = list
-def walk_revctrl(dirname=''):
+def walk_revctrl(dirname=""):
"""Find all files under revision control"""
- for ep in metadata.entry_points(group='setuptools.file_finders'):
+ for ep in metadata.entry_points(group="setuptools.file_finders"):
yield from ep.load()(dirname)
@@ -26,25 +26,25 @@ class sdist(orig.sdist):
"""Smart sdist that finds anything supported by revision control"""
user_options = [
- ('formats=', None, "formats for source distribution (comma-separated list)"),
+ ("formats=", None, "formats for source distribution (comma-separated list)"),
(
- 'keep-temp',
- 'k',
+ "keep-temp",
+ "k",
"keep the distribution tree around after creating archive file(s)",
),
(
- 'dist-dir=',
- 'd',
+ "dist-dir=",
+ "d",
"directory to put the source distribution archive(s) in [default: dist]",
),
(
- 'owner=',
- 'u',
+ "owner=",
+ "u",
"Owner name used when creating a tar file [default: current user]",
),
(
- 'group=',
- 'g',
+ "group=",
+ "g",
"Group name used when creating a tar file [default: current group]",
),
]
@@ -52,14 +52,14 @@ class sdist(orig.sdist):
distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
negative_opt: ClassVar[dict[str, str]] = {}
- README_EXTENSIONS = ['', '.rst', '.txt', '.md']
- READMES = tuple(f'README{ext}' for ext in README_EXTENSIONS)
+ README_EXTENSIONS = ["", ".rst", ".txt", ".md"]
+ READMES = tuple(f"README{ext}" for ext in README_EXTENSIONS)
def run(self) -> None:
- self.run_command('egg_info')
- ei_cmd = self.get_finalized_command('egg_info')
+ self.run_command("egg_info")
+ ei_cmd = self.get_finalized_command("egg_info")
self.filelist = ei_cmd.filelist
- self.filelist.append(os.path.join(ei_cmd.egg_info, 'SOURCES.txt'))
+ self.filelist.append(os.path.join(ei_cmd.egg_info, "SOURCES.txt"))
self.check_readme()
# Run sub commands
@@ -68,9 +68,9 @@ def run(self) -> None:
self.make_distribution()
- dist_files = getattr(self.distribution, 'dist_files', [])
+ dist_files = getattr(self.distribution, "dist_files", [])
for file in self.archive_files:
- data = ('sdist', '', file)
+ data = ("sdist", "", file)
if data not in dist_files:
dist_files.append(data)
@@ -94,7 +94,7 @@ def _remove_os_link():
class NoValue:
pass
- orig_val = getattr(os, 'link', NoValue)
+ orig_val = getattr(os, "link", NoValue)
try:
del os.link
except Exception:
@@ -111,13 +111,13 @@ def add_defaults(self) -> None:
def _add_defaults_optional(self):
super()._add_defaults_optional()
- if os.path.isfile('pyproject.toml'):
- self.filelist.append('pyproject.toml')
+ if os.path.isfile("pyproject.toml"):
+ self.filelist.append("pyproject.toml")
def _add_defaults_python(self):
"""getting python files"""
if self.distribution.has_pure_modules():
- build_py = self.get_finalized_command('build_py')
+ build_py = self.get_finalized_command("build_py")
self.filelist.extend(build_py.get_source_files())
self._add_data_files(self._safe_data_files(build_py))
@@ -170,30 +170,30 @@ def check_readme(self) -> None:
return
else:
self.warn(
- "standard file not found: should have one of " + ', '.join(self.READMES)
+ "standard file not found: should have one of " + ", ".join(self.READMES)
)
def make_release_tree(self, base_dir, files) -> None:
orig.sdist.make_release_tree(self, base_dir, files)
# Save any egg_info command line options used to create this sdist
- dest = os.path.join(base_dir, 'setup.cfg')
- if hasattr(os, 'link') and os.path.exists(dest):
+ dest = os.path.join(base_dir, "setup.cfg")
+ if hasattr(os, "link") and os.path.exists(dest):
# unlink and re-copy, since it might be hard-linked, and
# we don't want to change the source version
os.unlink(dest)
- self.copy_file('setup.cfg', dest)
+ self.copy_file("setup.cfg", dest)
- self.get_finalized_command('egg_info').save_version_info(dest)
+ self.get_finalized_command("egg_info").save_version_info(dest)
def _manifest_is_not_generated(self):
# check for special comment used in 2.7.1 and higher
if not os.path.isfile(self.manifest):
return False
- with open(self.manifest, 'rb') as fp:
+ with open(self.manifest, "rb") as fp:
first_line = fp.readline()
- return first_line != b'# file GENERATED by distutils, do NOT edit\n'
+ return first_line != b"# file GENERATED by distutils, do NOT edit\n"
def read_manifest(self):
"""Read the manifest file (named by 'self.manifest') and use it to
@@ -201,17 +201,17 @@ def read_manifest(self):
distribution.
"""
log.info("reading manifest file '%s'", self.manifest)
- manifest = open(self.manifest, 'rb')
+ manifest = open(self.manifest, "rb")
for bytes_line in manifest:
# The manifest must contain UTF-8. See #303.
try:
- line = bytes_line.decode('UTF-8')
+ line = bytes_line.decode("UTF-8")
except UnicodeDecodeError:
log.warn(f"{line!r} not UTF-8 decodable -- skipping")
continue
# ignore comments and blank lines
line = line.strip()
- if line.startswith('#') or not line:
+ if line.startswith("#") or not line:
continue
self.filelist.append(line)
manifest.close()
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/setopt.py b/.venv3.10/Lib/site-packages/setuptools/command/setopt.py
index 678a0593..e18a0836 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/setopt.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/setopt.py
@@ -9,7 +9,7 @@
from distutils.errors import DistutilsOptionError
from distutils.util import convert_path
-__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
+__all__ = ["config_file", "edit_config", "option_base", "setopt"]
def config_file(kind="local"):
@@ -17,12 +17,12 @@ def config_file(kind="local"):
`kind` must be one of "local", "global", or "user"
"""
- if kind == 'local':
- return 'setup.cfg'
- if kind == 'global':
- return os.path.join(os.path.dirname(distutils.__file__), 'distutils.cfg')
- if kind == 'user':
- dot = os.name == 'posix' and '.' or ''
+ if kind == "local":
+ return "setup.cfg"
+ if kind == "global":
+ return os.path.join(os.path.dirname(distutils.__file__), "distutils.cfg")
+ if kind == "user":
+ dot = os.name == "posix" and "." or ""
return os.path.expanduser(convert_path(f"~/{dot}pydistutils.cfg"))
raise ValueError("config_file() type must be 'local', 'global', or 'user'", kind)
@@ -65,7 +65,7 @@ def edit_config(filename, settings, dry_run=False):
log.info("Writing %s", filename)
if not dry_run:
- with open(filename, 'w', encoding="utf-8") as f:
+ with open(filename, "w", encoding="utf-8") as f:
opts.write(f)
@@ -73,14 +73,14 @@ class option_base(Command):
"""Abstract base class for commands that mess with config files"""
user_options = [
- ('global-config', 'g', "save options to the site-wide distutils.cfg file"),
- ('user-config', 'u', "save options to the current user's pydistutils.cfg file"),
- ('filename=', 'f', "configuration file to use (default=setup.cfg)"),
+ ("global-config", "g", "save options to the site-wide distutils.cfg file"),
+ ("user-config", "u", "save options to the current user's pydistutils.cfg file"),
+ ("filename=", "f", "configuration file to use (default=setup.cfg)"),
]
boolean_options = [
- 'global-config',
- 'user-config',
+ "global-config",
+ "user-config",
]
def initialize_options(self):
@@ -91,13 +91,13 @@ def initialize_options(self):
def finalize_options(self):
filenames = []
if self.global_config:
- filenames.append(config_file('global'))
+ filenames.append(config_file("global"))
if self.user_config:
- filenames.append(config_file('user'))
+ filenames.append(config_file("user"))
if self.filename is not None:
filenames.append(self.filename)
if not filenames:
- filenames.append(config_file('local'))
+ filenames.append(config_file("local"))
if len(filenames) > 1:
raise DistutilsOptionError(
"Must specify only one configuration file option", filenames
@@ -111,13 +111,13 @@ class setopt(option_base):
description = "set an option in setup.cfg or another config file"
user_options = [
- ('command=', 'c', 'command to set an option for'),
- ('option=', 'o', 'option to set'),
- ('set-value=', 's', 'value of the option'),
- ('remove', 'r', 'remove (unset) the value'),
+ ("command=", "c", "command to set an option for"),
+ ("option=", "o", "option to set"),
+ ("set-value=", "s", "value of the option"),
+ ("remove", "r", "remove (unset) the value"),
] + option_base.user_options
- boolean_options = option_base.boolean_options + ['remove']
+ boolean_options = option_base.boolean_options + ["remove"]
def initialize_options(self):
option_base.initialize_options(self)
@@ -136,6 +136,6 @@ def finalize_options(self) -> None:
def run(self) -> None:
edit_config(
self.filename,
- {self.command: {self.option.replace('-', '_'): self.set_value}},
+ {self.command: {self.option.replace("-", "_"): self.set_value}},
self.dry_run,
)
diff --git a/.venv3.10/Lib/site-packages/setuptools/command/test.py b/.venv3.10/Lib/site-packages/setuptools/command/test.py
index 341b11a2..fb1bba91 100644
--- a/.venv3.10/Lib/site-packages/setuptools/command/test.py
+++ b/.venv3.10/Lib/site-packages/setuptools/command/test.py
@@ -6,7 +6,7 @@
# Would restrict to Literal["test"], but mypy doesn't support it: https://github.com/python/mypy/issues/8203
def __getattr__(name: str) -> type[_test]:
- if name == 'test':
+ if name == "test":
SetuptoolsDeprecationWarning.emit(
"The test command is disabled and references to it are deprecated.",
"Please remove any references to `setuptools.command.test` in all "
@@ -26,13 +26,13 @@ class _test(Command):
description = "stub for old test command (do not use)"
user_options = [
- ('test-module=', 'm', "Run 'test_suite' in specified module"),
+ ("test-module=", "m", "Run 'test_suite' in specified module"),
(
- 'test-suite=',
- 's',
+ "test-suite=",
+ "s",
"Run single test, case or suite (e.g. 'module.test_suite')",
),
- ('test-runner=', 'r', "Test runner to use"),
+ ("test-runner=", "r", "Test runner to use"),
]
def initialize_options(self):
diff --git a/.venv3.10/Lib/site-packages/setuptools/compat/py310.py b/.venv3.10/Lib/site-packages/setuptools/compat/py310.py
index 58a4d9f3..aa0f82d4 100644
--- a/.venv3.10/Lib/site-packages/setuptools/compat/py310.py
+++ b/.venv3.10/Lib/site-packages/setuptools/compat/py310.py
@@ -1,6 +1,6 @@
import sys
-__all__ = ['tomllib']
+__all__ = ["tomllib"]
if sys.version_info >= (3, 11):
@@ -17,4 +17,4 @@ def add_note(ex, note):
else: # pragma: no cover
def add_note(ex, note):
- vars(ex).setdefault('__notes__', []).append(note)
+ vars(ex).setdefault("__notes__", []).append(note)
diff --git a/.venv3.10/Lib/site-packages/setuptools/config/__init__.py b/.venv3.10/Lib/site-packages/setuptools/config/__init__.py
index fcc7d008..bda6992e 100644
--- a/.venv3.10/Lib/site-packages/setuptools/config/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/config/__init__.py
@@ -10,7 +10,7 @@
Fn = TypeVar("Fn", bound=Callable)
-__all__ = ('parse_configuration', 'read_configuration')
+__all__ = ("parse_configuration", "read_configuration")
def _deprecation_notice(fn: Fn) -> Fn:
@@ -36,7 +36,7 @@ def _wrapper(*args, **kwargs):
)
return fn(*args, **kwargs)
- return cast(Fn, _wrapper)
+ return cast("Fn", _wrapper)
read_configuration = _deprecation_notice(setupcfg.read_configuration)
diff --git a/.venv3.10/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py b/.venv3.10/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py
index 9088bc13..15197d01 100644
--- a/.venv3.10/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py
+++ b/.venv3.10/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py
@@ -327,7 +327,7 @@ def _valid_command_options(cmdclass: Mapping = EMPTY) -> dict[str, set[str]]:
valid_options = {"global": _normalise_cmd_options(Distribution.global_options)}
- unloaded_entry_points = metadata.entry_points(group='distutils.commands')
+ unloaded_entry_points = metadata.entry_points(group="distutils.commands")
loaded_entry_points = (_load_ep(ep) for ep in unloaded_entry_points)
entry_points = (ep for ep in loaded_entry_points if ep)
for cmd, cmd_class in chain(entry_points, cmdclass.items()):
diff --git a/.venv3.10/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py b/.venv3.10/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
index d2dddd6a..71027dd1 100644
--- a/.venv3.10/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
+++ b/.venv3.10/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py
@@ -1,7 +1,7 @@
import re
-SPLIT_RE = re.compile(r'[\.\[\]]+')
+SPLIT_RE = re.compile(r"[\.\[\]]+")
class JsonSchemaException(ValueError):
@@ -36,7 +36,7 @@ def __init__(self, message, value=None, name=None, definition=None, rule=None):
@property
def path(self):
- return [item for item in SPLIT_RE.split(self.name) if item != '']
+ return [item for item in SPLIT_RE.split(self.name) if item != ""]
@property
def rule_definition(self):
diff --git a/.venv3.10/Lib/site-packages/setuptools/config/expand.py b/.venv3.10/Lib/site-packages/setuptools/config/expand.py
index 531f9650..aa3ecc0c 100644
--- a/.venv3.10/Lib/site-packages/setuptools/config/expand.py
+++ b/.venv3.10/Lib/site-packages/setuptools/config/expand.py
@@ -87,7 +87,7 @@ def glob_relative(
(current directory by default)
:rtype: list
"""
- glob_characters = {'*', '?', '[', ']', '{', '}'}
+ glob_characters = {"*", "?", "[", "]", "{", "}"}
expanded_values = []
root_dir = root_dir or os.getcwd()
for value in patterns:
@@ -123,7 +123,7 @@ def read_files(
root_dir = os.path.abspath(root_dir or os.getcwd())
_filepaths = (os.path.join(root_dir, path) for path in always_iterable(filepaths))
- return '\n'.join(
+ return "\n".join(
_read_file(path)
for path in _filter_existing_files(_filepaths)
if _assert_local(path, root_dir)
@@ -139,7 +139,7 @@ def _filter_existing_files(filepaths: Iterable[StrPath]) -> Iterator[StrPath]:
def _read_file(filepath: bytes | StrPath) -> str:
- with open(filepath, encoding='utf-8') as f:
+ with open(filepath, encoding="utf-8") as f:
return f.read()
@@ -174,10 +174,10 @@ def read_attr(
:rtype: str
"""
root_dir = root_dir or os.getcwd()
- attrs_path = attr_desc.strip().split('.')
+ attrs_path = attr_desc.strip().split(".")
attr_name = attrs_path.pop()
- module_name = '.'.join(attrs_path)
- module_name = module_name or '__init__'
+ module_name = ".".join(attrs_path)
+ module_name = module_name or "__init__"
path = _find_module(module_name, package_dir, root_dir)
spec = _find_spec(module_name, path)
@@ -242,7 +242,7 @@ def resolve_class(
) -> Callable:
"""Given a qualified class name, return the associated class object"""
root_dir = root_dir or os.getcwd()
- idx = qualified_class_name.rfind('.')
+ idx = qualified_class_name.rfind(".")
class_name = qualified_class_name[idx + 1 :]
pkg_name = qualified_class_name[:idx]
@@ -297,7 +297,7 @@ def find_packages(
from setuptools.discovery import PEP420PackageFinder as PackageFinder
root_dir = root_dir or os.curdir
- where = kwargs.pop('where', ['.'])
+ where = kwargs.pop("where", ["."])
packages: list[str] = []
fill_package_dir = {} if fill_package_dir is None else fill_package_dir
search = list(unique_everseen(always_iterable(where)))
@@ -330,9 +330,9 @@ def version(value: Callable | Iterable[str | int] | str) -> str:
if isinstance(_value, str):
return _value
- if hasattr(_value, '__iter__'):
- return '.'.join(map(str, _value))
- return f'{_value}'
+ if hasattr(_value, "__iter__"):
+ return ".".join(map(str, _value))
+ return f"{_value}"
def canonic_package_data(package_data: dict) -> dict:
diff --git a/.venv3.10/Lib/site-packages/setuptools/config/setupcfg.py b/.venv3.10/Lib/site-packages/setuptools/config/setupcfg.py
index 633aa9d4..21511fb2 100644
--- a/.venv3.10/Lib/site-packages/setuptools/config/setupcfg.py
+++ b/.venv3.10/Lib/site-packages/setuptools/config/setupcfg.py
@@ -94,7 +94,7 @@ def _apply(
filepath = os.path.abspath(filepath)
if not os.path.isfile(filepath):
- raise FileError(f'Configuration file {filepath} does not exist.')
+ raise FileError(f"Configuration file {filepath} does not exist.")
current_directory = os.getcwd()
os.chdir(os.path.dirname(filepath))
@@ -102,7 +102,7 @@ def _apply(
try:
# TODO: Temporary cast until mypy 1.12 is released with upstream fixes from typeshed
- _Distribution.parse_config_files(dist, filenames=cast(list[str], filenames))
+ _Distribution.parse_config_files(dist, filenames=cast("list[str]", filenames))
handlers = parse_configuration(
dist, dist.command_options, ignore_option_errors=ignore_option_errors
)
@@ -119,7 +119,7 @@ def _get_option(target_obj: Distribution | DistributionMetadata, key: str):
the target object, either through a get_{key} method or
from an attribute directly.
"""
- getter_name = f'get_{key}'
+ getter_name = f"get_{key}"
by_attribute = functools.partial(getattr, target_obj, key)
getter = getattr(target_obj, getter_name, by_attribute)
return getter()
@@ -266,13 +266,13 @@ def _section_options(
pre, _sep, name = full_name.partition(cls.section_prefix)
if pre:
continue
- yield name.lstrip('.'), value
+ yield name.lstrip("."), value
@property
def parsers(self):
"""Metadata item name to parser function mapping."""
raise NotImplementedError(
- f'{self.__class__.__name__} must provide .parsers property'
+ f"{self.__class__.__name__} must provide .parsers property"
)
def __setitem__(self, option_name, value) -> None:
@@ -302,7 +302,7 @@ def __setitem__(self, option_name, value) -> None:
self.set_options.append(option_name)
@classmethod
- def _parse_list(cls, value, separator=','):
+ def _parse_list(cls, value, separator=","):
"""Represents value as a list.
Value is split either by separator (defaults to comma) or by lines.
@@ -314,7 +314,7 @@ def _parse_list(cls, value, separator=','):
if isinstance(value, list): # _get_parser_compound case
return value
- if '\n' in value:
+ if "\n" in value:
value = value.splitlines()
else:
value = value.split(separator)
@@ -328,7 +328,7 @@ def _parse_dict(cls, value):
:param value:
:rtype: dict
"""
- separator = '='
+ separator = "="
result = {}
for line in cls._parse_list(value):
key, sep, val = line.partition(separator)
@@ -346,7 +346,7 @@ def _parse_bool(cls, value):
:rtype: bool
"""
value = value.lower()
- return value in ('1', 'true', 'yes')
+ return value in ("1", "true", "yes")
@classmethod
def _exclude_files_parser(cls, key):
@@ -361,11 +361,11 @@ def _exclude_files_parser(cls, key):
"""
def parser(value):
- exclude_directive = 'file:'
+ exclude_directive = "file:"
if value.startswith(exclude_directive):
raise ValueError(
- f'Only strings are accepted for the {key} field, '
- 'files are not accepted'
+ f"Only strings are accepted for the {key} field, "
+ "files are not accepted"
)
return _static.Str(value)
@@ -384,7 +384,7 @@ def _parse_file(self, value, root_dir: StrPath | None):
:param str value:
:rtype: str
"""
- include_directive = 'file:'
+ include_directive = "file:"
if not isinstance(value, str):
return value
@@ -393,7 +393,7 @@ def _parse_file(self, value, root_dir: StrPath | None):
return _static.Str(value)
spec = value[len(include_directive) :]
- filepaths = [path.strip() for path in spec.split(',')]
+ filepaths = [path.strip() for path in spec.split(",")]
self._referenced_files.update(filepaths)
# XXX: Is marking as static contents coming from files too optimistic?
return _static.Str(expand.read_files(filepaths, root_dir))
@@ -408,11 +408,11 @@ def _parse_attr(self, value, package_dir, root_dir: StrPath):
:param str value:
:rtype: str
"""
- attr_directive = 'attr:'
+ attr_directive = "attr:"
if not value.startswith(attr_directive):
return _static.Str(value)
- attr_desc = value.replace(attr_directive, '')
+ attr_desc = value.replace(attr_directive, "")
# Make sure package_dir is populated correctly, so `attr:` directives can work
package_dir.update(self.ensure_discovered.package_dir)
@@ -482,14 +482,14 @@ def parse(self) -> None:
"""
for section_name, section_options in self.sections.items():
- method_postfix = ''
+ method_postfix = ""
if section_name: # [section.option] variant
method_postfix = f"_{section_name}"
section_parser_method: Callable | None = getattr(
self,
# Dots in section names are translated into dunderscores.
- f'parse_section{method_postfix}'.replace('.', '__'),
+ f"parse_section{method_postfix}".replace(".", "__"),
None,
)
@@ -518,13 +518,13 @@ def config_handler(*args, **kwargs):
class ConfigMetadataHandler(ConfigHandler["DistributionMetadata"]):
- section_prefix = 'metadata'
+ section_prefix = "metadata"
aliases = {
- 'home_page': 'url',
- 'summary': 'description',
- 'classifier': 'classifiers',
- 'platform': 'platforms',
+ "home_page": "url",
+ "summary": "description",
+ "classifier": "classifiers",
+ "platform": "platforms",
}
strict_mode = False
@@ -555,23 +555,23 @@ def parsers(self):
exclude_files_parser = self._exclude_files_parser
return {
- 'author': _static.Str,
- 'author_email': _static.Str,
- 'maintainer': _static.Str,
- 'maintainer_email': _static.Str,
- 'platforms': parse_list_static,
- 'keywords': parse_list_static,
- 'provides': parse_list_static,
- 'obsoletes': parse_list_static,
- 'classifiers': self._get_parser_compound(parse_file, parse_list_static),
- 'license': exclude_files_parser('license'),
- 'license_files': parse_list_static,
- 'description': parse_file,
- 'long_description': parse_file,
- 'long_description_content_type': _static.Str,
- 'version': self._parse_version, # Cannot be marked as dynamic
- 'url': _static.Str,
- 'project_urls': parse_dict_static,
+ "author": _static.Str,
+ "author_email": _static.Str,
+ "maintainer": _static.Str,
+ "maintainer_email": _static.Str,
+ "platforms": parse_list_static,
+ "keywords": parse_list_static,
+ "provides": parse_list_static,
+ "obsoletes": parse_list_static,
+ "classifiers": self._get_parser_compound(parse_file, parse_list_static),
+ "license": exclude_files_parser("license"),
+ "license_files": parse_list_static,
+ "description": parse_file,
+ "long_description": parse_file,
+ "long_description_content_type": _static.Str,
+ "version": self._parse_version, # Cannot be marked as dynamic
+ "url": _static.Str,
+ "project_urls": parse_dict_static,
}
def _parse_version(self, value):
@@ -591,8 +591,8 @@ def _parse_version(self, value):
Version(version)
except InvalidVersion as e:
raise OptionError(
- f'Version loaded from {value} does not '
- f'comply with PEP 440: {version}'
+ f"Version loaded from {value} does not "
+ f"comply with PEP 440: {version}"
) from e
return version
@@ -601,7 +601,7 @@ def _parse_version(self, value):
class ConfigOptionsHandler(ConfigHandler["Distribution"]):
- section_prefix = 'options'
+ section_prefix = "options"
def __init__(
self,
@@ -616,7 +616,7 @@ def __init__(
@classmethod
def _parse_list_semicolon(cls, value):
- return cls._parse_list(value, separator=';')
+ return cls._parse_list(value, separator=";")
def _parse_file_in_root(self, value):
return self._parse_file(value, root_dir=self.root_dir)
@@ -638,27 +638,27 @@ def parsers(self):
parse_cmdclass = self._parse_cmdclass
return {
- 'zip_safe': parse_bool,
- 'include_package_data': parse_bool,
- 'package_dir': self._parse_dict,
- 'scripts': parse_list,
- 'eager_resources': parse_list,
- 'dependency_links': parse_list,
- 'namespace_packages': self._deprecated_config_handler(
+ "zip_safe": parse_bool,
+ "include_package_data": parse_bool,
+ "package_dir": self._parse_dict,
+ "scripts": parse_list,
+ "eager_resources": parse_list,
+ "dependency_links": parse_list,
+ "namespace_packages": self._deprecated_config_handler(
parse_list,
"The namespace_packages parameter is deprecated, "
"consider using implicit namespaces instead (PEP 420).",
# TODO: define due date, see setuptools.dist:check_nsp.
),
- 'install_requires': partial( # Core Metadata
+ "install_requires": partial( # Core Metadata
self._parse_requirements_list, "install_requires"
),
- 'setup_requires': self._parse_list_semicolon,
- 'packages': self._parse_packages,
- 'entry_points': self._parse_file_in_root,
- 'py_modules': parse_list,
- 'python_requires': _static.SpecifierSet, # Core Metadata
- 'cmdclass': parse_cmdclass,
+ "setup_requires": self._parse_list_semicolon,
+ "packages": self._parse_packages,
+ "entry_points": self._parse_file_in_root,
+ "py_modules": parse_list,
+ "python_requires": _static.SpecifierSet, # Core Metadata
+ "cmdclass": parse_cmdclass,
}
def _parse_cmdclass(self, value):
@@ -671,7 +671,7 @@ def _parse_packages(self, value):
:param value:
:rtype: list
"""
- find_directives = ['find:', 'find_namespace:']
+ find_directives = ["find:", "find_namespace:"]
trimmed_value = value.strip()
if trimmed_value not in find_directives:
@@ -679,7 +679,7 @@ def _parse_packages(self, value):
# Read function arguments from a dedicated section.
find_kwargs = self.parse_section_packages__find(
- self.sections.get('packages.find', {})
+ self.sections.get("packages.find", {})
)
find_kwargs.update(
@@ -699,12 +699,12 @@ def parse_section_packages__find(self, section_options):
"""
section_data = self._parse_section_to_dict(section_options, self._parse_list)
- valid_keys = ['where', 'include', 'exclude']
+ valid_keys = ["where", "include", "exclude"]
find_kwargs = {k: v for k, v in section_data.items() if k in valid_keys and v}
- where = find_kwargs.get('where')
+ where = find_kwargs.get("where")
if where is not None:
- find_kwargs['where'] = where[0] # cast list to single val
+ find_kwargs["where"] = where[0] # cast list to single val
return find_kwargs
@@ -714,7 +714,7 @@ def parse_section_entry_points(self, section_options) -> None:
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
- self['entry_points'] = parsed
+ self["entry_points"] = parsed
def _parse_package_data(self, section_options):
package_data = self._parse_section_to_dict(section_options, self._parse_list)
@@ -725,14 +725,14 @@ def parse_section_package_data(self, section_options) -> None:
:param dict section_options:
"""
- self['package_data'] = self._parse_package_data(section_options)
+ self["package_data"] = self._parse_package_data(section_options)
def parse_section_exclude_package_data(self, section_options) -> None:
"""Parses `exclude_package_data` configuration file section.
:param dict section_options:
"""
- self['exclude_package_data'] = self._parse_package_data(section_options)
+ self["exclude_package_data"] = self._parse_package_data(section_options)
def parse_section_extras_require(self, section_options) -> None: # Core Metadata
"""Parses `extras_require` configuration file section.
@@ -744,7 +744,7 @@ def parse_section_extras_require(self, section_options) -> None: # Core Metadat
lambda k, v: self._parse_requirements_list(f"extras_require[{k}]", v),
)
- self['extras_require'] = _static.Dict(parsed)
+ self["extras_require"] = _static.Dict(parsed)
# ^-- Use `_static.Dict` to mark a non-`Dynamic` Core Metadata
def parse_section_data_files(self, section_options) -> None:
@@ -753,7 +753,7 @@ def parse_section_data_files(self, section_options) -> None:
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
- self['data_files'] = expand.canonic_data_files(parsed, self.root_dir)
+ self["data_files"] = expand.canonic_data_files(parsed, self.root_dir)
class _AmbiguousMarker(SetuptoolsDeprecationWarning):
diff --git a/.venv3.10/Lib/site-packages/setuptools/depends.py b/.venv3.10/Lib/site-packages/setuptools/depends.py
index e5223b79..3828d06f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/depends.py
+++ b/.venv3.10/Lib/site-packages/setuptools/depends.py
@@ -14,7 +14,7 @@
_T = TypeVar("_T")
-__all__ = ['Require', 'find_module']
+__all__ = ["Require", "find_module"]
class Require:
@@ -25,7 +25,7 @@ def __init__(
name,
requested_version,
module,
- homepage: str = '',
+ homepage: str = "",
attribute=None,
format=None,
) -> None:
@@ -35,7 +35,7 @@ def __init__(
if format is not None:
requested_version = format(requested_version)
if attribute is None:
- attribute = '__version__'
+ attribute = "__version__"
self.__dict__.update(locals())
del self.self
@@ -43,7 +43,7 @@ def __init__(
def full_name(self):
"""Return full package/distribution name, w/version"""
if self.requested_version is not None:
- return f'{self.name}-{self.requested_version}'
+ return f"{self.name}-{self.requested_version}"
return self.name
def version_ok(self, version):
@@ -110,7 +110,7 @@ def empty():
# Some objects are not available on some platforms.
# XXX it'd be better to test assertions about bytecode instead.
-if not sys.platform.startswith('java') and sys.platform != 'cli':
+if not sys.platform.startswith("java") and sys.platform != "cli":
def get_module_constant(
module, symbol, default: _T | int = -1, paths=None
@@ -134,7 +134,7 @@ def get_module_constant(
elif kind == PY_FROZEN:
code = _imp.get_frozen_object(module, paths)
elif kind == PY_SOURCE:
- code = compile(f.read(), path, 'exec')
+ code = compile(f.read(), path, "exec")
else:
# Not something we can parse; we'll have to import it. :(
imported = _imp.get_module(module, paths, info)
@@ -162,9 +162,9 @@ def extract_constant(
name_idx = list(code.co_names).index(symbol)
- STORE_NAME = dis.opmap['STORE_NAME']
- STORE_GLOBAL = dis.opmap['STORE_GLOBAL']
- LOAD_CONST = dis.opmap['LOAD_CONST']
+ STORE_NAME = dis.opmap["STORE_NAME"]
+ STORE_GLOBAL = dis.opmap["STORE_GLOBAL"]
+ LOAD_CONST = dis.opmap["LOAD_CONST"]
const = default
@@ -182,4 +182,4 @@ def extract_constant(
return None
- __all__ += ['get_module_constant', 'extract_constant']
+ __all__ += ["get_module_constant", "extract_constant"]
diff --git a/.venv3.10/Lib/site-packages/setuptools/discovery.py b/.venv3.10/Lib/site-packages/setuptools/discovery.py
index c8883991..8eda5dcd 100644
--- a/.venv3.10/Lib/site-packages/setuptools/discovery.py
+++ b/.venv3.10/Lib/site-packages/setuptools/discovery.py
@@ -90,9 +90,9 @@ class _Finder:
@classmethod
def find(
cls,
- where: StrPath = '.',
+ where: StrPath = ".",
exclude: Iterable[str] = (),
- include: Iterable[str] = ('*',),
+ include: Iterable[str] = ("*",),
) -> list[str]:
"""Return a list of all Python items (packages or modules, depending on
the finder implementation) found within directory 'where'.
@@ -152,10 +152,10 @@ def _find_iter(
for dir in all_dirs:
full_path = os.path.join(root, dir)
rel_path = os.path.relpath(full_path, where)
- package = rel_path.replace(os.path.sep, '.')
+ package = rel_path.replace(os.path.sep, ".")
# Skip directory trees that are not valid packages
- if '.' in dir or not cls._looks_like_package(full_path, package):
+ if "." in dir or not cls._looks_like_package(full_path, package):
continue
# Should this package be included?
@@ -173,7 +173,7 @@ def _find_iter(
@staticmethod
def _looks_like_package(path: StrPath, _package_name: str) -> bool:
"""Does a directory look like a package?"""
- return os.path.isfile(os.path.join(path, '__init__.py'))
+ return os.path.isfile(os.path.join(path, "__init__.py"))
class PEP420PackageFinder(PackageFinder):
@@ -254,7 +254,7 @@ class FlatLayoutPackageFinder(PEP420PackageFinder):
@staticmethod
def _looks_like_package(_path: StrPath, package_name: str) -> bool:
- names = package_name.split('.')
+ names = package_name.split(".")
# Consider PEP 561
root_pkg_is_valid = names[0].isidentifier() or names[0].endswith("-stubs")
return root_pkg_is_valid and all(name.isidentifier() for name in names[1:])
@@ -498,7 +498,7 @@ def analyse_name(self) -> None:
def _find_name_single_package_or_module(self) -> str | None:
"""Exactly one module or package"""
- for field in ('packages', 'py_modules'):
+ for field in ("packages", "py_modules"):
items = getattr(self.dist, field, None) or []
if items and len(items) == 1:
log.debug(f"Single module/package detected, name: {items[0]}")
diff --git a/.venv3.10/Lib/site-packages/setuptools/dist.py b/.venv3.10/Lib/site-packages/setuptools/dist.py
index f06298c8..bed95278 100644
--- a/.venv3.10/Lib/site-packages/setuptools/dist.py
+++ b/.venv3.10/Lib/site-packages/setuptools/dist.py
@@ -47,7 +47,7 @@
from typing_extensions import TypeAlias
-__all__ = ['Distribution']
+__all__ = ["Distribution"]
_sequence = tuple, list
"""
@@ -98,7 +98,7 @@ def assert_string_list(dist, attr: str, value: _Sequence) -> None:
# or single-use iterables
assert isinstance(value, _sequence)
# verify that elements of value are strings
- assert ''.join(value) != value
+ assert "".join(value) != value
except (TypeError, ValueError, AttributeError, AssertionError) as e:
raise DistutilsSetupError(
f"{attr!r} must be of type <{_sequence_type_repr}> (got {value!r})"
@@ -114,7 +114,7 @@ def check_nsp(dist, attr, value):
raise DistutilsSetupError(
f"Distribution contains no modules or packages for namespace package {nsp!r}"
)
- parent, _sep, _child = nsp.rpartition('.')
+ parent, _sep, _child = nsp.rpartition(".")
if parent and parent not in ns_packages:
distutils.log.warn(
"WARNING: %r is declared as a package namespace, but %r"
@@ -146,7 +146,7 @@ def check_extras(dist, attr, value):
def _check_extra(extra, reqs):
- _name, _sep, marker = extra.partition(':')
+ _name, _sep, marker = extra.partition(":")
try:
_check_marker(marker)
except InvalidMarker:
@@ -219,12 +219,12 @@ def check_package_data(dist, attr, value):
raise DistutilsSetupError(
f"keys of {attr!r} dict must be strings (got {k!r})"
)
- assert_string_list(dist, f'values of {attr!r} dict', v)
+ assert_string_list(dist, f"values of {attr!r} dict", v)
def check_packages(dist, attr, value):
for pkgname in value:
- if not re.match(r'\w+(\.\w+)*', pkgname):
+ if not re.match(r"\w+(\.\w+)*", pkgname):
distutils.log.warn(
"WARNING: %r not a valid package name; please use only "
".-separated package names in setup.py",
@@ -286,14 +286,14 @@ class Distribution(_Distribution):
"""
_DISTUTILS_UNSUPPORTED_METADATA = {
- 'long_description_content_type': lambda: None,
- 'project_urls': dict,
- 'provides_extras': dict, # behaves like an ordered set
- 'license_expression': lambda: None,
- 'license_file': lambda: None,
- 'license_files': lambda: None,
- 'install_requires': list,
- 'extras_require': dict,
+ "long_description_content_type": lambda: None,
+ "project_urls": dict,
+ "provides_extras": dict, # behaves like an ordered set
+ "license_expression": lambda: None,
+ "license_file": lambda: None,
+ "license_files": lambda: None,
+ "install_requires": list,
+ "extras_require": dict,
}
# Used by build_py, editable_wheel and install_lib commands for legacy namespaces
@@ -310,9 +310,9 @@ def __init__(self, attrs: MutableMapping[str, Any] | None = None) -> None:
self.exclude_package_data: dict[str, list[str]] | None = None
# Filter-out setuptools' specific options.
self.src_root: str | None = attrs.pop("src_root", None)
- self.dependency_links: list[str] = attrs.pop('dependency_links', [])
- self.setup_requires: list[str] = attrs.pop('setup_requires', [])
- for ep in metadata.entry_points(group='distutils.setup_keywords'):
+ self.dependency_links: list[str] = attrs.pop("dependency_links", [])
+ self.setup_requires: list[str] = attrs.pop("setup_requires", [])
+ for ep in metadata.entry_points(group="distutils.setup_keywords"):
vars(self).setdefault(ep.name, None)
metadata_only = set(self._DISTUTILS_UNSUPPORTED_METADATA)
@@ -376,7 +376,7 @@ def _finalize_requires(self):
Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`.
"""
- if getattr(self, 'python_requires', None):
+ if getattr(self, "python_requires", None):
self.metadata.python_requires = self.python_requires
self._normalize_requires()
@@ -386,7 +386,7 @@ def _finalize_requires(self):
if self.extras_require:
for extra in self.extras_require.keys():
# Setuptools allows a weird ": syntax for extras
- extra = extra.split(':')[0]
+ extra = extra.split(":")[0]
if extra:
self.metadata.provides_extras.setdefault(extra)
@@ -457,7 +457,7 @@ def _finalize_license_files(self) -> None:
# Default patterns match the ones wheel uses
# See https://wheel.readthedocs.io/en/stable/user_guide.html
# -> 'Including license files in the generated wheel file'
- patterns = ['LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*']
+ patterns = ["LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*"]
files = self._expand_patterns(patterns, enforce_match=False)
else: # Patterns explicitly given by the user
files = self._expand_patterns(patterns, enforce_match=True)
@@ -481,7 +481,7 @@ def _expand_patterns(
path.replace(os.sep, "/")
for pattern in patterns
for path in sorted(cls._find_pattern(pattern, enforce_match))
- if not path.endswith('~') and os.path.isfile(path)
+ if not path.endswith("~") and os.path.isfile(path)
)
@staticmethod
@@ -519,7 +519,7 @@ def _find_pattern(pattern: str, enforce_match: bool = True) -> list[str]:
raise InvalidConfigError(
f"Pattern {pattern!r} should be relative and must not start with '/'"
)
- if re.match(r'^[\w\-\.\/\*\?\[\]]+$', pattern) is None:
+ if re.match(r"^[\w\-\.\/\*\?\[\]]+$", pattern) is None:
SetuptoolsDeprecationWarning.emit(
"Please provide a valid glob pattern.",
"Pattern {pattern!r} contains invalid characters.",
@@ -556,19 +556,19 @@ def _parse_config_files(self, filenames=None): # noqa: C901
[]
if sys.prefix == sys.base_prefix
else [
- 'install-base',
- 'install-platbase',
- 'install-lib',
- 'install-platlib',
- 'install-purelib',
- 'install-headers',
- 'install-scripts',
- 'install-data',
- 'prefix',
- 'exec-prefix',
- 'home',
- 'user',
- 'root',
+ "install-base",
+ "install-platbase",
+ "install-lib",
+ "install-platlib",
+ "install-purelib",
+ "install-headers",
+ "install-scripts",
+ "install-data",
+ "prefix",
+ "exec-prefix",
+ "home",
+ "user",
+ "root",
]
)
@@ -583,7 +583,7 @@ def _parse_config_files(self, filenames=None): # noqa: C901
parser = ConfigParser()
parser.optionxform = str
for filename in filenames:
- with open(filename, encoding='utf-8') as reader:
+ with open(filename, encoding="utf-8") as reader:
if DEBUG:
self.announce(" reading {filename}".format(**locals()))
parser.read_file(reader)
@@ -592,7 +592,7 @@ def _parse_config_files(self, filenames=None): # noqa: C901
opt_dict = self.get_option_dict(section)
for opt in options:
- if opt == '__name__' or opt in ignore_options:
+ if opt == "__name__" or opt in ignore_options:
continue
val = parser.get(section, opt)
@@ -604,17 +604,17 @@ def _parse_config_files(self, filenames=None): # noqa: C901
# the original filenames that options come from)
parser.__init__()
- if 'global' not in self.command_options:
+ if "global" not in self.command_options:
return
# If there was a "global" section in the config file, use it
# to set Distribution options.
- for opt, (src, val) in self.command_options['global'].items():
+ for opt, (src, val) in self.command_options["global"].items():
alias = self.negative_opt.get(opt)
if alias:
val = not strtobool(val)
- elif opt in ('verbose', 'dry_run'): # ugh!
+ elif opt in ("verbose", "dry_run"): # ugh!
val = strtobool(val)
try:
@@ -626,7 +626,7 @@ def _enforce_underscore(self, opt: str, section: str) -> str:
if "-" not in opt or self._skip_setupcfg_normalization(section):
return opt
- underscore_opt = opt.replace('-', '_')
+ underscore_opt = opt.replace("-", "_")
affected = f"(Affected: {self.metadata.name})." if self.metadata.name else ""
SetuptoolsDeprecationWarning.emit(
f"Invalid dash-separated key {opt!r} in {section!r} (setup.cfg), "
@@ -664,11 +664,11 @@ def _enforce_option_lowercase(self, opt: str, section: str) -> str:
def _skip_setupcfg_normalization(self, section: str) -> bool:
skip = (
- 'options.extras_require',
- 'options.data_files',
- 'options.entry_points',
- 'options.package_data',
- 'options.exclude_package_data',
+ "options.extras_require",
+ "options.data_files",
+ "options.entry_points",
+ "options.package_data",
+ "options.exclude_package_data",
)
return section in skip or not self._is_setuptools_section(section)
@@ -772,10 +772,10 @@ def finalize_options(self) -> None:
to influence the order of execution. Smaller numbers
go first and the default is 0.
"""
- group = 'setuptools.finalize_distribution_options'
+ group = "setuptools.finalize_distribution_options"
def by_order(hook):
- return getattr(hook, 'order', 0)
+ return getattr(hook, "order", 0)
defined = metadata.entry_points(group=group)
filtered = itertools.filterfalse(self._removed, defined)
@@ -793,12 +793,12 @@ def _removed(ep):
"""
removed = {
# removed 2021-09-05
- '2to3_doctests',
+ "2to3_doctests",
}
return ep.name in removed
def _finalize_setup_keywords(self):
- for ep in metadata.entry_points(group='distutils.setup_keywords'):
+ for ep in metadata.entry_points(group="distutils.setup_keywords"):
value = getattr(self, ep.name, None)
if value is not None:
ep.load()(self, ep.name, value)
@@ -806,21 +806,21 @@ def _finalize_setup_keywords(self):
def get_egg_cache_dir(self):
from . import windows_support
- egg_cache_dir = os.path.join(os.curdir, '.eggs')
+ egg_cache_dir = os.path.join(os.curdir, ".eggs")
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
windows_support.hide_file(egg_cache_dir)
- readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt')
- with open(readme_txt_filename, 'w', encoding="utf-8") as f:
+ readme_txt_filename = os.path.join(egg_cache_dir, "README.txt")
+ with open(readme_txt_filename, "w", encoding="utf-8") as f:
f.write(
- 'This directory contains eggs that were downloaded '
- 'by setuptools to build, test, and run plug-ins.\n\n'
+ "This directory contains eggs that were downloaded "
+ "by setuptools to build, test, and run plug-ins.\n\n"
)
f.write(
- 'This directory caches those eggs to prevent '
- 'repeated downloads.\n\n'
+ "This directory caches those eggs to prevent "
+ "repeated downloads.\n\n"
)
- f.write('However, it is safe to delete this directory.\n\n')
+ f.write("However, it is safe to delete this directory.\n\n")
return egg_cache_dir
@@ -836,12 +836,12 @@ def get_command_class(self, command: str) -> type[distutils.cmd.Command]: # typ
return self.cmdclass[command]
# Special case bdist_wheel so it's never loaded from "wheel"
- if command == 'bdist_wheel':
+ if command == "bdist_wheel":
from .command.bdist_wheel import bdist_wheel
return bdist_wheel
- eps = metadata.entry_points(group='distutils.commands', name=command)
+ eps = metadata.entry_points(group="distutils.commands", name=command)
for ep in eps:
self.cmdclass[command] = cmdclass = ep.load()
return cmdclass
@@ -849,14 +849,14 @@ def get_command_class(self, command: str) -> type[distutils.cmd.Command]: # typ
return _Distribution.get_command_class(self, command)
def print_commands(self):
- for ep in metadata.entry_points(group='distutils.commands'):
+ for ep in metadata.entry_points(group="distutils.commands"):
if ep.name not in self.cmdclass:
cmdclass = ep.load()
self.cmdclass[ep.name] = cmdclass
return _Distribution.print_commands(self)
def get_command_list(self):
- for ep in metadata.entry_points(group='distutils.commands'):
+ for ep in metadata.entry_points(group="distutils.commands"):
if ep.name not in self.cmdclass:
cmdclass = ep.load()
self.cmdclass[ep.name] = cmdclass
@@ -878,7 +878,7 @@ def include(self, **attrs) -> None:
handle whatever special inclusion logic is needed.
"""
for k, v in attrs.items():
- include = getattr(self, '_include_' + k, None)
+ include = getattr(self, "_include_" + k, None)
if include:
include(v)
else:
@@ -887,7 +887,7 @@ def include(self, **attrs) -> None:
def exclude_package(self, package: str) -> None:
"""Remove packages, modules, and extensions in named package"""
- pfx = package + '.'
+ pfx = package + "."
if self.packages:
self.packages = [
p for p in self.packages if p != package and not p.startswith(pfx)
@@ -908,7 +908,7 @@ def exclude_package(self, package: str) -> None:
def has_contents_for(self, package: str) -> bool:
"""Return true if 'exclude_package(package)' would do something"""
- pfx = package + '.'
+ pfx = package + "."
for p in self.iter_distribution_names():
if p == package or p.startswith(pfx):
@@ -971,7 +971,7 @@ def exclude(self, **attrs) -> None:
handle whatever special exclusion logic is needed.
"""
for k, v in attrs.items():
- exclude = getattr(self, '_exclude_' + k, None)
+ exclude = getattr(self, "_exclude_" + k, None)
if exclude:
exclude(v)
else:
@@ -991,7 +991,7 @@ def _parse_command_opts(self, parser, args):
# First, expand any aliases
command = args[0]
- aliases = self.get_option_dict('aliases')
+ aliases = self.get_option_dict("aliases")
while command in aliases:
_src, alias = aliases[command]
del aliases[command] # ensure each alias can expand only once!
@@ -1004,8 +1004,8 @@ def _parse_command_opts(self, parser, args):
# Handle commands that want to consume all remaining arguments
cmd_class = self.get_command_class(command)
- if getattr(cmd_class, 'command_consumes_arguments', None):
- self.get_option_dict(command)['args'] = ("command line", nargs)
+ if getattr(cmd_class, "command_consumes_arguments", None):
+ self.get_option_dict(command)["args"] = ("command line", nargs)
if nargs is not None:
return []
@@ -1029,12 +1029,12 @@ def get_cmdline_options(self) -> dict[str, dict[str, str | None]]:
if src != "command line":
continue
- opt = opt.replace('_', '-')
+ opt = opt.replace("_", "-")
if val == 0:
cmdobj = self.get_command_obj(cmd)
neg_opt = self.negative_opt.copy()
- neg_opt.update(getattr(cmdobj, 'negative_opt', {}))
+ neg_opt.update(getattr(cmdobj, "negative_opt", {}))
for neg, pos in neg_opt.items():
if pos == opt:
opt = neg
@@ -1062,7 +1062,7 @@ def iter_distribution_names(self):
name, _buildinfo = ext
else:
name = ext.name
- if name.endswith('module'):
+ if name.endswith("module"):
name = name[:-6]
yield name
@@ -1083,12 +1083,12 @@ def handle_display_options(self, option_order):
# Don't wrap stdout if utf-8 is already the encoding. Provides
# workaround for #334.
- if sys.stdout.encoding.lower() in ('utf-8', 'utf8'):
+ if sys.stdout.encoding.lower() in ("utf-8", "utf8"):
return _Distribution.handle_display_options(self, option_order)
# Print metadata in UTF-8 no matter the platform
encoding = sys.stdout.encoding
- sys.stdout.reconfigure(encoding='utf-8')
+ sys.stdout.reconfigure(encoding="utf-8")
try:
return _Distribution.handle_display_options(self, option_order)
finally:
@@ -1106,7 +1106,7 @@ def run_command(self, command) -> None:
def _setuptools_commands() -> set[str]:
try:
# Use older API for importlib.metadata compatibility
- entry_points = metadata.distribution('setuptools').entry_points
+ entry_points = metadata.distribution("setuptools").entry_points
eps: Iterable[str] = (ep.name for ep in entry_points)
except metadata.PackageNotFoundError:
# during bootstrapping, distribution doesn't exist
diff --git a/.venv3.10/Lib/site-packages/setuptools/extension.py b/.venv3.10/Lib/site-packages/setuptools/extension.py
index 76e03d9d..6224d1fa 100644
--- a/.venv3.10/Lib/site-packages/setuptools/extension.py
+++ b/.venv3.10/Lib/site-packages/setuptools/extension.py
@@ -17,10 +17,10 @@ def _have_cython():
"""
Return True if Cython can be imported.
"""
- cython_impl = 'Cython.Distutils.build_ext'
+ cython_impl = "Cython.Distutils.build_ext"
try:
# from (cython_impl) import build_ext
- __import__(cython_impl, fromlist=['build_ext']).build_ext
+ __import__(cython_impl, fromlist=["build_ext"]).build_ext
except Exception:
return False
return True
@@ -167,9 +167,9 @@ def _convert_pyx_sources_to_lang(self):
if _have_cython():
# the build has Cython, so allow it to compile the .pyx files
return
- lang = self.language or ''
- target_ext = '.cpp' if lang.lower() == 'c++' else '.c'
- sub = functools.partial(re.sub, '.pyx$', target_ext)
+ lang = self.language or ""
+ target_ext = ".cpp" if lang.lower() == "c++" else ".c"
+ sub = functools.partial(re.sub, ".pyx$", target_ext)
self.sources = list(map(sub, self.sources))
diff --git a/.venv3.10/Lib/site-packages/setuptools/glob.py b/.venv3.10/Lib/site-packages/setuptools/glob.py
index 1dfff2cd..3ba58e4c 100644
--- a/.venv3.10/Lib/site-packages/setuptools/glob.py
+++ b/.venv3.10/Lib/site-packages/setuptools/glob.py
@@ -95,7 +95,7 @@ def glob1(dirname: BytesPath, pattern: bytes) -> list[bytes]: ...
def glob1(dirname: StrOrBytesPath, pattern: str | bytes) -> list[str] | list[bytes]:
if not dirname:
if isinstance(pattern, bytes):
- dirname = os.curdir.encode('ASCII')
+ dirname = os.curdir.encode("ASCII")
else:
dirname = os.curdir
try:
@@ -140,7 +140,7 @@ def _rlistdir(dirname: BytesPath) -> Iterator[bytes]: ...
def _rlistdir(dirname: StrOrBytesPath) -> Iterator[str | bytes]:
if not dirname:
if isinstance(dirname, bytes):
- dirname = os.curdir.encode('ASCII')
+ dirname = os.curdir.encode("ASCII")
else:
dirname = os.curdir
try:
@@ -155,8 +155,8 @@ def _rlistdir(dirname: StrOrBytesPath) -> Iterator[str | bytes]:
yield os.path.join(x, y) # type: ignore[arg-type]
-magic_check = re.compile('([*?[])')
-magic_check_bytes = re.compile(b'([*?[])')
+magic_check = re.compile("([*?[])")
+magic_check_bytes = re.compile(b"([*?[])")
def has_magic(s: str | bytes) -> bool:
@@ -168,9 +168,9 @@ def has_magic(s: str | bytes) -> bool:
def _isrecursive(pattern: str | bytes) -> bool:
if isinstance(pattern, bytes):
- return pattern == b'**'
+ return pattern == b"**"
else:
- return pattern == '**'
+ return pattern == "**"
def escape(pathname):
@@ -179,7 +179,7 @@ def escape(pathname):
# Metacharacters do not work in the drive part and shouldn't be escaped.
drive, pathname = os.path.splitdrive(pathname)
if isinstance(pathname, bytes):
- pathname = magic_check_bytes.sub(rb'[\1]', pathname)
+ pathname = magic_check_bytes.sub(rb"[\1]", pathname)
else:
- pathname = magic_check.sub(r'[\1]', pathname)
+ pathname = magic_check.sub(r"[\1]", pathname)
return drive + pathname
diff --git a/.venv3.10/Lib/site-packages/setuptools/installer.py b/.venv3.10/Lib/site-packages/setuptools/installer.py
index 2c26e3a1..8e0208ba 100644
--- a/.venv3.10/Lib/site-packages/setuptools/installer.py
+++ b/.venv3.10/Lib/site-packages/setuptools/installer.py
@@ -55,7 +55,7 @@ def _fetch_build_eggs(dist, requires: _reqs._StrOrIter) -> list[metadata.Distrib
for dist in resolved_dists:
# dist.locate_file('') is the directory containing EGG-INFO, where the importabl
# contents can be found.
- sys.path.insert(0, str(dist.locate_file('')))
+ sys.path.insert(0, str(dist.locate_file("")))
return resolved_dists
@@ -73,46 +73,46 @@ def _fetch_build_egg_no_warn(dist, req): # noqa: C901 # is too complex (16) #
# Take easy_install options into account, but do not override relevant
# pip environment variables (like PIP_INDEX_URL or PIP_QUIET); they'll
# take precedence.
- opts = dist.get_option_dict('easy_install')
- if 'allow_hosts' in opts:
+ opts = dist.get_option_dict("easy_install")
+ if "allow_hosts" in opts:
raise DistutilsError(
- 'the `allow-hosts` option is not supported '
- 'when using pip to install requirements.'
+ "the `allow-hosts` option is not supported "
+ "when using pip to install requirements."
)
- quiet = 'PIP_QUIET' not in os.environ and 'PIP_VERBOSE' not in os.environ
- if 'PIP_INDEX_URL' in os.environ:
+ quiet = "PIP_QUIET" not in os.environ and "PIP_VERBOSE" not in os.environ
+ if "PIP_INDEX_URL" in os.environ:
index_url = None
- elif 'index_url' in opts:
- index_url = opts['index_url'][1]
+ elif "index_url" in opts:
+ index_url = opts["index_url"][1]
else:
index_url = None
find_links = (
- _fixup_find_links(opts['find_links'][1])[:] if 'find_links' in opts else []
+ _fixup_find_links(opts["find_links"][1])[:] if "find_links" in opts else []
)
if dist.dependency_links:
find_links.extend(dist.dependency_links)
eggs_dir = os.path.realpath(dist.get_egg_cache_dir())
- cached_dists = metadata.Distribution.discover(path=glob.glob(f'{eggs_dir}/*.egg'))
+ cached_dists = metadata.Distribution.discover(path=glob.glob(f"{eggs_dir}/*.egg"))
for egg_dist in cached_dists:
if _dist_matches_req(egg_dist, req):
return egg_dist
with tempfile.TemporaryDirectory() as tmpdir:
cmd = [
sys.executable,
- '-m',
- 'pip',
- '--disable-pip-version-check',
- 'wheel',
- '--no-deps',
- '-w',
+ "-m",
+ "pip",
+ "--disable-pip-version-check",
+ "wheel",
+ "--no-deps",
+ "-w",
tmpdir,
]
if quiet:
- cmd.append('--quiet')
+ cmd.append("--quiet")
if index_url is not None:
- cmd.extend(('--index-url', index_url))
+ cmd.extend(("--index-url", index_url))
for link in find_links or []:
- cmd.extend(('--find-links', link))
+ cmd.extend(("--find-links", link))
# If requirement is a PEP 508 direct URL, directly pass
# the URL to pip, as `req @ url` does not work on the
# command line.
@@ -121,10 +121,10 @@ def _fetch_build_egg_no_warn(dist, req): # noqa: C901 # is too complex (16) #
subprocess.check_call(cmd)
except subprocess.CalledProcessError as e:
raise DistutilsError(str(e)) from e
- wheel = Wheel(glob.glob(os.path.join(tmpdir, '*.whl'))[0])
+ wheel = Wheel(glob.glob(os.path.join(tmpdir, "*.whl"))[0])
dist_location = os.path.join(eggs_dir, wheel.egg_name())
wheel.install_as_egg(dist_location)
- return metadata.Distribution.at(dist_location + '/EGG-INFO')
+ return metadata.Distribution.at(dist_location + "/EGG-INFO")
def strip_marker(req):
@@ -141,9 +141,9 @@ def strip_marker(req):
def _warn_wheel_not_available(dist):
try:
- metadata.distribution('wheel')
+ metadata.distribution("wheel")
except metadata.PackageNotFoundError:
- dist.announce('WARNING: The wheel package is not available.', log.WARN)
+ dist.announce("WARNING: The wheel package is not available.", log.WARN)
class _DeprecatedInstaller(SetuptoolsDeprecationWarning):
diff --git a/.venv3.10/Lib/site-packages/setuptools/launch.py b/.venv3.10/Lib/site-packages/setuptools/launch.py
index 0d162647..4e8540c6 100644
--- a/.venv3.10/Lib/site-packages/setuptools/launch.py
+++ b/.venv3.10/Lib/site-packages/setuptools/launch.py
@@ -19,18 +19,18 @@ def run() -> None:
script_name = sys.argv[1]
namespace = dict(
__file__=script_name,
- __name__='__main__',
+ __name__="__main__",
__doc__=None,
)
sys.argv[:] = sys.argv[1:]
- open_ = getattr(tokenize, 'open', open)
+ open_ = getattr(tokenize, "open", open)
with open_(script_name) as fid:
script = fid.read()
- norm_script = script.replace('\\r\\n', '\\n')
- code = compile(norm_script, script_name, 'exec')
+ norm_script = script.replace("\\r\\n", "\\n")
+ code = compile(norm_script, script_name, "exec")
exec(code, namespace)
-if __name__ == '__main__':
+if __name__ == "__main__":
run()
diff --git a/.venv3.10/Lib/site-packages/setuptools/logging.py b/.venv3.10/Lib/site-packages/setuptools/logging.py
index 532da899..ff6a35eb 100644
--- a/.venv3.10/Lib/site-packages/setuptools/logging.py
+++ b/.venv3.10/Lib/site-packages/setuptools/logging.py
@@ -24,10 +24,10 @@ def configure() -> None:
out_handler.addFilter(_not_warning)
handlers = err_handler, out_handler
logging.basicConfig(
- format="{message}", style='{', handlers=handlers, level=logging.DEBUG
+ format="{message}", style="{", handlers=handlers, level=logging.DEBUG
)
if inspect.ismodule(distutils.dist.log):
- monkey.patch_func(set_threshold, distutils.log, 'set_threshold')
+ monkey.patch_func(set_threshold, distutils.log, "set_threshold")
# For some reason `distutils.log` module is getting cached in `distutils.dist`
# and then loaded again when patched,
# implying: id(distutils.log) != id(distutils.dist.log).
diff --git a/.venv3.10/Lib/site-packages/setuptools/modified.py b/.venv3.10/Lib/site-packages/setuptools/modified.py
index 6ba02fab..0911f7b9 100644
--- a/.venv3.10/Lib/site-packages/setuptools/modified.py
+++ b/.venv3.10/Lib/site-packages/setuptools/modified.py
@@ -15,4 +15,4 @@
newer_pairwise_group,
)
-__all__ = ['newer', 'newer_pairwise', 'newer_group', 'newer_pairwise_group']
+__all__ = ["newer", "newer_pairwise", "newer_group", "newer_pairwise_group"]
diff --git a/.venv3.10/Lib/site-packages/setuptools/monkey.py b/.venv3.10/Lib/site-packages/setuptools/monkey.py
index 6ad1abac..e1bd4f64 100644
--- a/.venv3.10/Lib/site-packages/setuptools/monkey.py
+++ b/.venv3.10/Lib/site-packages/setuptools/monkey.py
@@ -58,12 +58,12 @@ def get_unpatched_class(cls: type[_T]) -> type[_T]:
first.
"""
external_bases = (
- cast(type[_T], cls)
+ cast("type[_T]", cls)
for cls in _get_mro(cls)
- if not cls.__module__.startswith('setuptools')
+ if not cls.__module__.startswith("setuptools")
)
base = next(external_bases)
- if not base.__module__.startswith('distutils'):
+ if not base.__module__.startswith("distutils"):
msg = f"distutils has already been patched by {cls!r}"
raise AssertionError(msg)
return base
@@ -84,9 +84,9 @@ def patch_all():
# Install the patched Extension
distutils.core.Extension = setuptools.extension.Extension # type: ignore[misc,assignment] # monkeypatching
distutils.extension.Extension = setuptools.extension.Extension # type: ignore[misc,assignment] # monkeypatching
- if 'distutils.command.build_ext' in sys.modules:
+ if "distutils.command.build_ext" in sys.modules:
sys.modules[
- 'distutils.command.build_ext'
+ "distutils.command.build_ext"
].Extension = setuptools.extension.Extension
@@ -95,11 +95,11 @@ def _patch_distribution_metadata():
"""Patch write_pkg_file and read_pkg_file for higher metadata standards"""
for attr in (
- 'write_pkg_info',
- 'write_pkg_file',
- 'read_pkg_file',
- 'get_metadata_version',
- 'get_fullname',
+ "write_pkg_info",
+ "write_pkg_file",
+ "read_pkg_file",
+ "get_metadata_version",
+ "get_fullname",
):
new_val = getattr(_core_metadata, attr)
setattr(distutils.dist.DistributionMetadata, attr, new_val)
@@ -116,7 +116,7 @@ def patch_func(replacement, target_mod, func_name):
# set the 'unpatched' attribute on the replacement to
# point to the original.
- vars(replacement).setdefault('unpatched', original)
+ vars(replacement).setdefault("unpatched", original)
# replace the function in the original module
setattr(target_mod, func_name, replacement)
diff --git a/.venv3.10/Lib/site-packages/setuptools/msvc.py b/.venv3.10/Lib/site-packages/setuptools/msvc.py
index 313a781a..519b2fb0 100644
--- a/.venv3.10/Lib/site-packages/setuptools/msvc.py
+++ b/.venv3.10/Lib/site-packages/setuptools/msvc.py
@@ -23,7 +23,7 @@
from typing_extensions import LiteralString, NotRequired
# https://github.com/python/mypy/issues/8166
-if not TYPE_CHECKING and platform.system() == 'Windows':
+if not TYPE_CHECKING and platform.system() == "Windows":
import winreg
from os import environ
else:
@@ -48,10 +48,10 @@ class PlatformInfo:
Target architecture.
"""
- current_cpu = environ.get('processor_architecture', '').lower()
+ current_cpu = environ.get("processor_architecture", "").lower()
def __init__(self, arch) -> None:
- self.arch = arch.lower().replace('x64', 'amd64')
+ self.arch = arch.lower().replace("x64", "amd64")
@property
def target_cpu(self):
@@ -63,7 +63,7 @@ def target_cpu(self):
str
Target CPU
"""
- return self.arch[self.arch.find('_') + 1 :]
+ return self.arch[self.arch.find("_") + 1 :]
def target_is_x86(self):
"""
@@ -74,7 +74,7 @@ def target_is_x86(self):
bool
CPU is x86 32 bits
"""
- return self.target_cpu == 'x86'
+ return self.target_cpu == "x86"
def current_is_x86(self):
"""
@@ -85,7 +85,7 @@ def current_is_x86(self):
bool
CPU is x86 32 bits
"""
- return self.current_cpu == 'x86'
+ return self.current_cpu == "x86"
def current_dir(self, hidex86=False, x64=False) -> str:
"""
@@ -104,11 +104,11 @@ def current_dir(self, hidex86=False, x64=False) -> str:
subfolder: '\target', or '' (see hidex86 parameter)
"""
return (
- ''
- if (self.current_cpu == 'x86' and hidex86)
- else r'\x64'
- if (self.current_cpu == 'amd64' and x64)
- else rf'\{self.current_cpu}'
+ ""
+ if (self.current_cpu == "x86" and hidex86)
+ else r"\x64"
+ if (self.current_cpu == "amd64" and x64)
+ else rf"\{self.current_cpu}"
)
def target_dir(self, hidex86=False, x64=False) -> str:
@@ -128,11 +128,11 @@ def target_dir(self, hidex86=False, x64=False) -> str:
subfolder: '\current', or '' (see hidex86 parameter)
"""
return (
- ''
- if (self.target_cpu == 'x86' and hidex86)
- else r'\x64'
- if (self.target_cpu == 'amd64' and x64)
- else rf'\{self.target_cpu}'
+ ""
+ if (self.target_cpu == "x86" and hidex86)
+ else r"\x64"
+ if (self.target_cpu == "amd64" and x64)
+ else rf"\{self.target_cpu}"
)
def cross_dir(self, forcex86=False):
@@ -151,11 +151,11 @@ def cross_dir(self, forcex86=False):
subfolder: '' if target architecture is current architecture,
'\current_target' if not.
"""
- current = 'x86' if forcex86 else self.current_cpu
+ current = "x86" if forcex86 else self.current_cpu
return (
- ''
+ ""
if self.target_cpu == current
- else self.target_dir().replace('\\', f'\\{current}_')
+ else self.target_dir().replace("\\", f"\\{current}_")
)
@@ -189,7 +189,7 @@ def visualstudio(self) -> str:
str
Registry key
"""
- return 'VisualStudio'
+ return "VisualStudio"
@property
def sxs(self):
@@ -201,7 +201,7 @@ def sxs(self):
str
Registry key
"""
- return os.path.join(self.visualstudio, 'SxS')
+ return os.path.join(self.visualstudio, "SxS")
@property
def vc(self):
@@ -213,7 +213,7 @@ def vc(self):
str
Registry key
"""
- return os.path.join(self.sxs, 'VC7')
+ return os.path.join(self.sxs, "VC7")
@property
def vs(self):
@@ -225,7 +225,7 @@ def vs(self):
str
Registry key
"""
- return os.path.join(self.sxs, 'VS7')
+ return os.path.join(self.sxs, "VS7")
@property
def vc_for_python(self) -> str:
@@ -237,7 +237,7 @@ def vc_for_python(self) -> str:
str
Registry key
"""
- return r'DevDiv\VCForPython'
+ return r"DevDiv\VCForPython"
@property
def microsoft_sdk(self) -> str:
@@ -249,7 +249,7 @@ def microsoft_sdk(self) -> str:
str
Registry key
"""
- return 'Microsoft SDKs'
+ return "Microsoft SDKs"
@property
def windows_sdk(self):
@@ -261,7 +261,7 @@ def windows_sdk(self):
str
Registry key
"""
- return os.path.join(self.microsoft_sdk, 'Windows')
+ return os.path.join(self.microsoft_sdk, "Windows")
@property
def netfx_sdk(self):
@@ -273,7 +273,7 @@ def netfx_sdk(self):
str
Registry key
"""
- return os.path.join(self.microsoft_sdk, 'NETFXSDK')
+ return os.path.join(self.microsoft_sdk, "NETFXSDK")
@property
def windows_kits_roots(self) -> str:
@@ -285,7 +285,7 @@ def windows_kits_roots(self) -> str:
str
Registry key
"""
- return r'Windows Kits\Installed Roots'
+ return r"Windows Kits\Installed Roots"
def microsoft(self, key, x86=False):
"""
@@ -303,8 +303,8 @@ def microsoft(self, key, x86=False):
str
Registry key
"""
- node64 = '' if self.pi.current_is_x86() or x86 else 'Wow6432Node'
- return os.path.join('Software', node64, 'Microsoft', key)
+ node64 = "" if self.pi.current_is_x86() or x86 else "Wow6432Node"
+ return os.path.join("Software", node64, "Microsoft", key)
def lookup(self, key, name):
"""
@@ -362,9 +362,9 @@ class SystemInfo:
# Variables and properties in this class use originals CamelCase variables
# names from Microsoft source files for more easy comparison.
- WinDir = environ.get('WinDir', '')
- ProgramFiles = environ.get('ProgramFiles', '')
- ProgramFilesx86 = environ.get('ProgramFiles(x86)', ProgramFiles)
+ WinDir = environ.get("WinDir", "")
+ ProgramFiles = environ.get("ProgramFiles", "")
+ ProgramFilesx86 = environ.get("ProgramFiles(x86)", ProgramFiles)
def __init__(self, registry_info, vc_ver=None) -> None:
self.ri = registry_info
@@ -388,7 +388,7 @@ def _find_latest_available_vs_ver(self):
if not (reg_vc_vers or self.known_vs_paths):
raise distutils.errors.DistutilsPlatformError(
- 'No Microsoft Visual C++ version found'
+ "No Microsoft Visual C++ version found"
)
vc_vers = set(reg_vc_vers)
@@ -437,7 +437,7 @@ def find_programdata_vs_vers(self) -> dict[float, str]:
float version as key, path as value.
"""
vs_versions: dict[float, str] = {}
- instances_dir = r'C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances'
+ instances_dir = r"C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances"
try:
hashed_names = os.listdir(instances_dir)
@@ -449,16 +449,16 @@ def find_programdata_vs_vers(self) -> dict[float, str]:
for name in hashed_names:
try:
# Get VS installation path from "state.json" file
- state_path = os.path.join(instances_dir, name, 'state.json')
- with open(state_path, 'rt', encoding='utf-8') as state_file:
+ state_path = os.path.join(instances_dir, name, "state.json")
+ with open(state_path, "rt", encoding="utf-8") as state_file:
state = json.load(state_file)
- vs_path = state['installationPath']
+ vs_path = state["installationPath"]
# Raises OSError if this VS installation does not contain VC
- os.listdir(os.path.join(vs_path, r'VC\Tools\MSVC'))
+ os.listdir(os.path.join(vs_path, r"VC\Tools\MSVC"))
# Store version and path
- vs_versions[self._as_float_version(state['installationVersion'])] = (
+ vs_versions[self._as_float_version(state["installationVersion"])] = (
vs_path
)
@@ -483,7 +483,7 @@ def _as_float_version(version):
float
version
"""
- return float('.'.join(version.split('.')[:2]))
+ return float(".".join(version.split(".")[:2]))
@property
def VSInstallDir(self):
@@ -497,11 +497,11 @@ def VSInstallDir(self):
"""
# Default path
default = os.path.join(
- self.ProgramFilesx86, f'Microsoft Visual Studio {self.vs_ver:0.1f}'
+ self.ProgramFilesx86, f"Microsoft Visual Studio {self.vs_ver:0.1f}"
)
# Try to get path from registry, if fail use default path
- return self.ri.lookup(self.ri.vs, f'{self.vs_ver:0.1f}') or default
+ return self.ri.lookup(self.ri.vs, f"{self.vs_ver:0.1f}") or default
@property
def VCInstallDir(self):
@@ -516,7 +516,7 @@ def VCInstallDir(self):
path = self._guess_vc() or self._guess_vc_legacy()
if not os.path.isdir(path):
- msg = 'Microsoft Visual C++ directory not found'
+ msg = "Microsoft Visual C++ directory not found"
raise distutils.errors.DistutilsPlatformError(msg)
return path
@@ -531,7 +531,7 @@ def _guess_vc(self):
path
"""
if self.vs_ver <= 14.0:
- return ''
+ return ""
try:
# First search in known VS paths
@@ -540,7 +540,7 @@ def _guess_vc(self):
# Else, search with path from registry
vs_dir = self.VSInstallDir
- guess_vc = os.path.join(vs_dir, r'VC\Tools\MSVC')
+ guess_vc = os.path.join(vs_dir, r"VC\Tools\MSVC")
# Subdir with VC exact version as name
try:
@@ -549,7 +549,7 @@ def _guess_vc(self):
self.vc_ver = self._as_float_version(vc_ver)
return os.path.join(guess_vc, vc_ver)
except (OSError, IndexError):
- return ''
+ return ""
def _guess_vc_legacy(self):
"""
@@ -562,16 +562,16 @@ def _guess_vc_legacy(self):
"""
default = os.path.join(
self.ProgramFilesx86,
- rf'Microsoft Visual Studio {self.vs_ver:0.1f}\VC',
+ rf"Microsoft Visual Studio {self.vs_ver:0.1f}\VC",
)
# Try to get "VC++ for Python" path from registry as default path
- reg_path = os.path.join(self.ri.vc_for_python, f'{self.vs_ver:0.1f}')
- python_vc = self.ri.lookup(reg_path, 'installdir')
- default_vc = os.path.join(python_vc, 'VC') if python_vc else default
+ reg_path = os.path.join(self.ri.vc_for_python, f"{self.vs_ver:0.1f}")
+ python_vc = self.ri.lookup(reg_path, "installdir")
+ default_vc = os.path.join(python_vc, "VC") if python_vc else default
# Try to get path from registry, if fail use default path
- return self.ri.lookup(self.ri.vc, f'{self.vs_ver:0.1f}') or default_vc
+ return self.ri.lookup(self.ri.vc, f"{self.vs_ver:0.1f}") or default_vc
@property
def WindowsSdkVersion(self) -> tuple[LiteralString, ...]:
@@ -584,15 +584,15 @@ def WindowsSdkVersion(self) -> tuple[LiteralString, ...]:
versions
"""
if self.vs_ver <= 9.0:
- return '7.0', '6.1', '6.0a'
+ return "7.0", "6.1", "6.0a"
elif self.vs_ver == 10.0:
- return '7.1', '7.0a'
+ return "7.1", "7.0a"
elif self.vs_ver == 11.0:
- return '8.0', '8.0a'
+ return "8.0", "8.0a"
elif self.vs_ver == 12.0:
- return '8.1', '8.1a'
+ return "8.1", "8.1a"
elif self.vs_ver >= 14.0:
- return '10.0', '8.1'
+ return "10.0", "8.1"
return ()
@property
@@ -605,7 +605,7 @@ def WindowsSdkLastVersion(self):
str
version
"""
- return self._use_last_dir_name(os.path.join(self.WindowsSdkDir, 'lib'))
+ return self._use_last_dir_name(os.path.join(self.WindowsSdkDir, "lib"))
@property
def WindowsSdkDir(self) -> str | None: # noqa: C901 # is too complex (12) # FIXME
@@ -617,37 +617,37 @@ def WindowsSdkDir(self) -> str | None: # noqa: C901 # is too complex (12) # F
str
path
"""
- sdkdir: str | None = ''
+ sdkdir: str | None = ""
for ver in self.WindowsSdkVersion:
# Try to get it from registry
- loc = os.path.join(self.ri.windows_sdk, f'v{ver}')
- sdkdir = self.ri.lookup(loc, 'installationfolder')
+ loc = os.path.join(self.ri.windows_sdk, f"v{ver}")
+ sdkdir = self.ri.lookup(loc, "installationfolder")
if sdkdir:
break
if not sdkdir or not os.path.isdir(sdkdir):
# Try to get "VC++ for Python" version from registry
- path = os.path.join(self.ri.vc_for_python, f'{self.vc_ver:0.1f}')
- install_base = self.ri.lookup(path, 'installdir')
+ path = os.path.join(self.ri.vc_for_python, f"{self.vc_ver:0.1f}")
+ install_base = self.ri.lookup(path, "installdir")
if install_base:
- sdkdir = os.path.join(install_base, 'WinSDK')
+ sdkdir = os.path.join(install_base, "WinSDK")
if not sdkdir or not os.path.isdir(sdkdir):
# If fail, use default new path
for ver in self.WindowsSdkVersion:
- intver = ver[: ver.rfind('.')]
- path = rf'Microsoft SDKs\Windows Kits\{intver}'
+ intver = ver[: ver.rfind(".")]
+ path = rf"Microsoft SDKs\Windows Kits\{intver}"
d = os.path.join(self.ProgramFiles, path)
if os.path.isdir(d):
sdkdir = d
if not sdkdir or not os.path.isdir(sdkdir):
# If fail, use default old path
for ver in self.WindowsSdkVersion:
- path = rf'Microsoft SDKs\Windows\v{ver}'
+ path = rf"Microsoft SDKs\Windows\v{ver}"
d = os.path.join(self.ProgramFiles, path)
if os.path.isdir(d):
sdkdir = d
if not sdkdir:
# If fail, use Platform SDK
- sdkdir = os.path.join(self.VCInstallDir, 'PlatformSDK')
+ sdkdir = os.path.join(self.VCInstallDir, "PlatformSDK")
return sdkdir
@property
@@ -663,12 +663,12 @@ def WindowsSDKExecutablePath(self):
# Find WinSDK NetFx Tools registry dir name
if self.vs_ver <= 11.0:
netfxver = 35
- arch = ''
+ arch = ""
else:
netfxver = 40
hidex86 = True if self.vs_ver <= 12.0 else False
- arch = self.pi.current_dir(x64=True, hidex86=hidex86).replace('\\', '-')
- fx = f'WinSDK-NetFx{netfxver}Tools{arch}'
+ arch = self.pi.current_dir(x64=True, hidex86=hidex86).replace("\\", "-")
+ fx = f"WinSDK-NetFx{netfxver}Tools{arch}"
# list all possibles registry paths
regpaths = []
@@ -677,11 +677,11 @@ def WindowsSDKExecutablePath(self):
regpaths += [os.path.join(self.ri.netfx_sdk, ver, fx)]
for ver in self.WindowsSdkVersion:
- regpaths += [os.path.join(self.ri.windows_sdk, f'v{ver}A', fx)]
+ regpaths += [os.path.join(self.ri.windows_sdk, f"v{ver}A", fx)]
# Return installation folder from the more recent path
for path in regpaths:
- execpath = self.ri.lookup(path, 'installationfolder')
+ execpath = self.ri.lookup(path, "installationfolder")
if execpath:
return execpath
@@ -697,8 +697,8 @@ def FSharpInstallDir(self):
str
path
"""
- path = os.path.join(self.ri.visualstudio, rf'{self.vs_ver:0.1f}\Setup\F#')
- return self.ri.lookup(path, 'productdir') or ''
+ path = os.path.join(self.ri.visualstudio, rf"{self.vs_ver:0.1f}\Setup\F#")
+ return self.ri.lookup(path, "productdir") or ""
@property
def UniversalCRTSdkDir(self):
@@ -711,13 +711,13 @@ def UniversalCRTSdkDir(self):
path
"""
# Set Kit Roots versions for specified MSVC++ version
- vers = ('10', '81') if self.vs_ver >= 14.0 else ()
+ vers = ("10", "81") if self.vs_ver >= 14.0 else ()
# Find path of the more recent Kit
for ver in vers:
- sdkdir = self.ri.lookup(self.ri.windows_kits_roots, f'kitsroot{ver}')
+ sdkdir = self.ri.lookup(self.ri.windows_kits_roots, f"kitsroot{ver}")
if sdkdir:
- return sdkdir or ''
+ return sdkdir or ""
return None
@@ -731,7 +731,7 @@ def UniversalCRTSdkLastVersion(self):
str
version
"""
- return self._use_last_dir_name(os.path.join(self.UniversalCRTSdkDir, 'lib'))
+ return self._use_last_dir_name(os.path.join(self.UniversalCRTSdkDir, "lib"))
@property
def NetFxSdkVersion(self):
@@ -745,7 +745,7 @@ def NetFxSdkVersion(self):
"""
# Set FxSdk versions for specified VS version
return (
- ('4.7.2', '4.7.1', '4.7', '4.6.2', '4.6.1', '4.6', '4.5.2', '4.5.1', '4.5')
+ ("4.7.2", "4.7.1", "4.7", "4.6.2", "4.6.1", "4.6", "4.5.2", "4.5.1", "4.5")
if self.vs_ver >= 14.0
else ()
)
@@ -760,10 +760,10 @@ def NetFxSdkDir(self):
str
path
"""
- sdkdir = ''
+ sdkdir = ""
for ver in self.NetFxSdkVersion:
loc = os.path.join(self.ri.netfx_sdk, ver)
- sdkdir = self.ri.lookup(loc, 'kitsinstallationfolder')
+ sdkdir = self.ri.lookup(loc, "kitsinstallationfolder")
if sdkdir:
break
return sdkdir
@@ -779,10 +779,10 @@ def FrameworkDir32(self):
path
"""
# Default path
- guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework')
+ guess_fw = os.path.join(self.WinDir, r"Microsoft.NET\Framework")
# Try to get path from registry, if fail use default path
- return self.ri.lookup(self.ri.vc, 'frameworkdir32') or guess_fw
+ return self.ri.lookup(self.ri.vc, "frameworkdir32") or guess_fw
@property
def FrameworkDir64(self):
@@ -795,10 +795,10 @@ def FrameworkDir64(self):
path
"""
# Default path
- guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework64')
+ guess_fw = os.path.join(self.WinDir, r"Microsoft.NET\Framework64")
# Try to get path from registry, if fail use default path
- return self.ri.lookup(self.ri.vc, 'frameworkdir64') or guess_fw
+ return self.ri.lookup(self.ri.vc, "frameworkdir64") or guess_fw
@property
def FrameworkVersion32(self) -> tuple[str, ...]:
@@ -839,23 +839,23 @@ def _find_dot_net_versions(self, bits) -> tuple[str, ...]:
versions
"""
# Find actual .NET version in registry
- reg_ver = self.ri.lookup(self.ri.vc, f'frameworkver{bits}')
- dot_net_dir = getattr(self, f'FrameworkDir{bits}')
- ver = reg_ver or self._use_last_dir_name(dot_net_dir, 'v') or ''
+ reg_ver = self.ri.lookup(self.ri.vc, f"frameworkver{bits}")
+ dot_net_dir = getattr(self, f"FrameworkDir{bits}")
+ ver = reg_ver or self._use_last_dir_name(dot_net_dir, "v") or ""
# Set .NET versions for specified MSVC++ version
if self.vs_ver >= 12.0:
- return ver, 'v4.0'
+ return ver, "v4.0"
elif self.vs_ver >= 10.0:
- return 'v4.0.30319' if ver.lower()[:2] != 'v4' else ver, 'v3.5'
+ return "v4.0.30319" if ver.lower()[:2] != "v4" else ver, "v3.5"
elif self.vs_ver == 9.0:
- return 'v3.5', 'v2.0.50727'
+ return "v3.5", "v2.0.50727"
elif self.vs_ver == 8.0:
- return 'v3.0', 'v2.0.50727'
+ return "v3.0", "v2.0.50727"
return ()
@staticmethod
- def _use_last_dir_name(path, prefix=''):
+ def _use_last_dir_name(path, prefix=""):
"""
Return name of the last dir in path or '' if no dir found.
@@ -877,7 +877,7 @@ def _use_last_dir_name(path, prefix=''):
if os.path.isdir(os.path.join(path, dir_name))
and dir_name.startswith(prefix)
)
- return next(matching_dirs, None) or ''
+ return next(matching_dirs, None) or ""
class _EnvironmentDict(TypedDict):
@@ -918,7 +918,7 @@ def __init__(self, arch, vc_ver=None, vc_min_ver=0) -> None:
self.si = SystemInfo(self.ri, vc_ver)
if self.vc_ver < vc_min_ver:
- err = 'No suitable Microsoft Visual C++ version found'
+ err = "No suitable Microsoft Visual C++ version found"
raise distutils.errors.DistutilsPlatformError(err)
@property
@@ -955,13 +955,13 @@ def VSTools(self):
list of str
paths
"""
- paths = [r'Common7\IDE', r'Common7\Tools']
+ paths = [r"Common7\IDE", r"Common7\Tools"]
if self.vs_ver >= 14.0:
arch_subdir = self.pi.current_dir(hidex86=True, x64=True)
- paths += [r'Common7\IDE\CommonExtensions\Microsoft\TestWindow']
- paths += [r'Team Tools\Performance Tools']
- paths += [rf'Team Tools\Performance Tools{arch_subdir}']
+ paths += [r"Common7\IDE\CommonExtensions\Microsoft\TestWindow"]
+ paths += [r"Team Tools\Performance Tools"]
+ paths += [rf"Team Tools\Performance Tools{arch_subdir}"]
return [os.path.join(self.si.VSInstallDir, path) for path in paths]
@@ -976,8 +976,8 @@ def VCIncludes(self):
paths
"""
return [
- os.path.join(self.si.VCInstallDir, 'Include'),
- os.path.join(self.si.VCInstallDir, r'ATLMFC\Include'),
+ os.path.join(self.si.VCInstallDir, "Include"),
+ os.path.join(self.si.VCInstallDir, r"ATLMFC\Include"),
]
@property
@@ -994,10 +994,10 @@ def VCLibraries(self):
arch_subdir = self.pi.target_dir(x64=True)
else:
arch_subdir = self.pi.target_dir(hidex86=True)
- paths = [f'Lib{arch_subdir}', rf'ATLMFC\Lib{arch_subdir}']
+ paths = [f"Lib{arch_subdir}", rf"ATLMFC\Lib{arch_subdir}"]
if self.vs_ver >= 14.0:
- paths += [rf'Lib\store{arch_subdir}']
+ paths += [rf"Lib\store{arch_subdir}"]
return [os.path.join(self.si.VCInstallDir, path) for path in paths]
@@ -1013,7 +1013,7 @@ def VCStoreRefs(self):
"""
if self.vs_ver < 14.0:
return []
- return [os.path.join(self.si.VCInstallDir, r'Lib\store\references')]
+ return [os.path.join(self.si.VCInstallDir, r"Lib\store\references")]
@property
def VCTools(self):
@@ -1036,20 +1036,20 @@ def VCTools(self):
True
"""
si = self.si
- tools = [os.path.join(si.VCInstallDir, 'VCPackages')]
+ tools = [os.path.join(si.VCInstallDir, "VCPackages")]
forcex86 = True if self.vs_ver <= 10.0 else False
arch_subdir = self.pi.cross_dir(forcex86)
if arch_subdir:
- tools += [os.path.join(si.VCInstallDir, f'Bin{arch_subdir}')]
+ tools += [os.path.join(si.VCInstallDir, f"Bin{arch_subdir}")]
if self.vs_ver == 14.0:
- path = f'Bin{self.pi.current_dir(hidex86=True)}'
+ path = f"Bin{self.pi.current_dir(hidex86=True)}"
tools += [os.path.join(si.VCInstallDir, path)]
elif self.vs_ver >= 15.0:
- host_id = self.pi.current_cpu.replace('amd64', 'x64').upper()
- host_dir = os.path.join('bin', f'Host{host_id}%s')
+ host_id = self.pi.current_cpu.replace("amd64", "x64").upper()
+ host_dir = os.path.join("bin", f"Host{host_id}%s")
tools += [
os.path.join(si.VCInstallDir, host_dir % self.pi.target_dir(x64=True))
]
@@ -1062,7 +1062,7 @@ def VCTools(self):
]
else:
- tools += [os.path.join(si.VCInstallDir, 'Bin')]
+ tools += [os.path.join(si.VCInstallDir, "Bin")]
return tools
@@ -1078,13 +1078,13 @@ def OSLibraries(self):
"""
if self.vs_ver <= 10.0:
arch_subdir = self.pi.target_dir(hidex86=True, x64=True)
- return [os.path.join(self.si.WindowsSdkDir, f'Lib{arch_subdir}')]
+ return [os.path.join(self.si.WindowsSdkDir, f"Lib{arch_subdir}")]
else:
arch_subdir = self.pi.target_dir(x64=True)
- lib = os.path.join(self.si.WindowsSdkDir, 'lib')
+ lib = os.path.join(self.si.WindowsSdkDir, "lib")
libver = self._sdk_subdir
- return [os.path.join(lib, f'{libver}um{arch_subdir}')]
+ return [os.path.join(lib, f"{libver}um{arch_subdir}")]
@property
def OSIncludes(self):
@@ -1096,20 +1096,20 @@ def OSIncludes(self):
list of str
paths
"""
- include = os.path.join(self.si.WindowsSdkDir, 'include')
+ include = os.path.join(self.si.WindowsSdkDir, "include")
if self.vs_ver <= 10.0:
- return [include, os.path.join(include, 'gl')]
+ return [include, os.path.join(include, "gl")]
else:
if self.vs_ver >= 14.0:
sdkver = self._sdk_subdir
else:
- sdkver = ''
+ sdkver = ""
return [
- os.path.join(include, f'{sdkver}shared'),
- os.path.join(include, f'{sdkver}um'),
- os.path.join(include, f'{sdkver}winrt'),
+ os.path.join(include, f"{sdkver}shared"),
+ os.path.join(include, f"{sdkver}um"),
+ os.path.join(include, f"{sdkver}winrt"),
]
@property
@@ -1122,32 +1122,32 @@ def OSLibpath(self):
list of str
paths
"""
- ref = os.path.join(self.si.WindowsSdkDir, 'References')
+ ref = os.path.join(self.si.WindowsSdkDir, "References")
libpath = []
if self.vs_ver <= 9.0:
libpath += self.OSLibraries
if self.vs_ver >= 11.0:
- libpath += [os.path.join(ref, r'CommonConfiguration\Neutral')]
+ libpath += [os.path.join(ref, r"CommonConfiguration\Neutral")]
if self.vs_ver >= 14.0:
libpath += [
ref,
- os.path.join(self.si.WindowsSdkDir, 'UnionMetadata'),
- os.path.join(ref, 'Windows.Foundation.UniversalApiContract', '1.0.0.0'),
- os.path.join(ref, 'Windows.Foundation.FoundationContract', '1.0.0.0'),
+ os.path.join(self.si.WindowsSdkDir, "UnionMetadata"),
+ os.path.join(ref, "Windows.Foundation.UniversalApiContract", "1.0.0.0"),
+ os.path.join(ref, "Windows.Foundation.FoundationContract", "1.0.0.0"),
os.path.join(
- ref, 'Windows.Networking.Connectivity.WwanContract', '1.0.0.0'
+ ref, "Windows.Networking.Connectivity.WwanContract", "1.0.0.0"
),
os.path.join(
self.si.WindowsSdkDir,
- 'ExtensionSDKs',
- 'Microsoft.VCLibs',
- f'{self.vs_ver:0.1f}',
- 'References',
- 'CommonConfiguration',
- 'neutral',
+ "ExtensionSDKs",
+ "Microsoft.VCLibs",
+ f"{self.vs_ver:0.1f}",
+ "References",
+ "CommonConfiguration",
+ "neutral",
),
]
return libpath
@@ -1174,27 +1174,27 @@ def _sdk_tools(self):
paths
"""
if self.vs_ver < 15.0:
- bin_dir = 'Bin' if self.vs_ver <= 11.0 else r'Bin\x86'
+ bin_dir = "Bin" if self.vs_ver <= 11.0 else r"Bin\x86"
yield os.path.join(self.si.WindowsSdkDir, bin_dir)
if not self.pi.current_is_x86():
arch_subdir = self.pi.current_dir(x64=True)
- path = f'Bin{arch_subdir}'
+ path = f"Bin{arch_subdir}"
yield os.path.join(self.si.WindowsSdkDir, path)
if self.vs_ver in (10.0, 11.0):
if self.pi.target_is_x86():
- arch_subdir = ''
+ arch_subdir = ""
else:
arch_subdir = self.pi.current_dir(hidex86=True, x64=True)
- path = rf'Bin\NETFX 4.0 Tools{arch_subdir}'
+ path = rf"Bin\NETFX 4.0 Tools{arch_subdir}"
yield os.path.join(self.si.WindowsSdkDir, path)
elif self.vs_ver >= 15.0:
- path = os.path.join(self.si.WindowsSdkDir, 'Bin')
+ path = os.path.join(self.si.WindowsSdkDir, "Bin")
arch_subdir = self.pi.current_dir(x64=True)
sdkver = self.si.WindowsSdkLastVersion
- yield os.path.join(path, f'{sdkver}{arch_subdir}')
+ yield os.path.join(path, f"{sdkver}{arch_subdir}")
if self.si.WindowsSDKExecutablePath:
yield self.si.WindowsSDKExecutablePath
@@ -1210,7 +1210,7 @@ def _sdk_subdir(self):
subdir
"""
ucrtver = self.si.WindowsSdkLastVersion
- return (f'{ucrtver}\\') if ucrtver else ''
+ return (f"{ucrtver}\\") if ucrtver else ""
@property
def SdkSetup(self):
@@ -1225,7 +1225,7 @@ def SdkSetup(self):
if self.vs_ver > 9.0:
return []
- return [os.path.join(self.si.WindowsSdkDir, 'Setup')]
+ return [os.path.join(self.si.WindowsSdkDir, "Setup")]
@property
def FxTools(self):
@@ -1245,7 +1245,7 @@ def FxTools(self):
include64 = not pi.target_is_x86() and not pi.current_is_x86()
else:
include32 = pi.target_is_x86() or pi.current_is_x86()
- include64 = pi.current_cpu == 'amd64' or pi.target_cpu == 'amd64'
+ include64 = pi.current_cpu == "amd64" or pi.target_cpu == "amd64"
tools = []
if include32:
@@ -1272,7 +1272,7 @@ def NetFxSDKLibraries(self):
return []
arch_subdir = self.pi.target_dir(x64=True)
- return [os.path.join(self.si.NetFxSdkDir, rf'lib\um{arch_subdir}')]
+ return [os.path.join(self.si.NetFxSdkDir, rf"lib\um{arch_subdir}")]
@property
def NetFxSDKIncludes(self):
@@ -1287,7 +1287,7 @@ def NetFxSDKIncludes(self):
if self.vs_ver < 14.0 or not self.si.NetFxSdkDir:
return []
- return [os.path.join(self.si.NetFxSdkDir, r'include\um')]
+ return [os.path.join(self.si.NetFxSdkDir, r"include\um")]
@property
def VsTDb(self):
@@ -1299,7 +1299,7 @@ def VsTDb(self):
list of str
paths
"""
- return [os.path.join(self.si.VSInstallDir, r'VSTSDB\Deploy')]
+ return [os.path.join(self.si.VSInstallDir, r"VSTSDB\Deploy")]
@property
def MSBuild(self):
@@ -1318,14 +1318,14 @@ def MSBuild(self):
arch_subdir = self.pi.current_dir(hidex86=True)
else:
base_path = self.si.VSInstallDir
- arch_subdir = ''
+ arch_subdir = ""
- path = rf'MSBuild\{self.vs_ver:0.1f}\bin{arch_subdir}'
+ path = rf"MSBuild\{self.vs_ver:0.1f}\bin{arch_subdir}"
build = [os.path.join(base_path, path)]
if self.vs_ver >= 15.0:
# Add Roslyn C# & Visual Basic Compiler
- build += [os.path.join(base_path, path, 'Roslyn')]
+ build += [os.path.join(base_path, path, "Roslyn")]
return build
@@ -1342,7 +1342,7 @@ def HTMLHelpWorkshop(self):
if self.vs_ver < 11.0:
return []
- return [os.path.join(self.si.ProgramFilesx86, 'HTML Help Workshop')]
+ return [os.path.join(self.si.ProgramFilesx86, "HTML Help Workshop")]
@property
def UCRTLibraries(self):
@@ -1358,9 +1358,9 @@ def UCRTLibraries(self):
return []
arch_subdir = self.pi.target_dir(x64=True)
- lib = os.path.join(self.si.UniversalCRTSdkDir, 'lib')
+ lib = os.path.join(self.si.UniversalCRTSdkDir, "lib")
ucrtver = self._ucrt_subdir
- return [os.path.join(lib, f'{ucrtver}ucrt{arch_subdir}')]
+ return [os.path.join(lib, f"{ucrtver}ucrt{arch_subdir}")]
@property
def UCRTIncludes(self):
@@ -1375,8 +1375,8 @@ def UCRTIncludes(self):
if self.vs_ver < 14.0:
return []
- include = os.path.join(self.si.UniversalCRTSdkDir, 'include')
- return [os.path.join(include, f'{self._ucrt_subdir}ucrt')]
+ include = os.path.join(self.si.UniversalCRTSdkDir, "include")
+ return [os.path.join(include, f"{self._ucrt_subdir}ucrt")]
@property
def _ucrt_subdir(self):
@@ -1389,7 +1389,7 @@ def _ucrt_subdir(self):
subdir
"""
ucrtver = self.si.UniversalCRTSdkLastVersion
- return (f'{ucrtver}\\') if ucrtver else ''
+ return (f"{ucrtver}\\") if ucrtver else ""
@property
def FSharp(self):
@@ -1413,25 +1413,25 @@ def VCRuntimeRedist(self) -> str | None:
Returns the first suitable path found or None.
"""
- vcruntime = f'vcruntime{self.vc_ver}0.dll'
- arch_subdir = self.pi.target_dir(x64=True).strip('\\')
+ vcruntime = f"vcruntime{self.vc_ver}0.dll"
+ arch_subdir = self.pi.target_dir(x64=True).strip("\\")
# Installation prefixes candidates
prefixes = []
tools_path = self.si.VCInstallDir
- redist_path = os.path.dirname(tools_path.replace(r'\Tools', r'\Redist'))
+ redist_path = os.path.dirname(tools_path.replace(r"\Tools", r"\Redist"))
if os.path.isdir(redist_path):
# Redist version may not be exactly the same as tools
redist_path = os.path.join(redist_path, os.listdir(redist_path)[-1])
- prefixes += [redist_path, os.path.join(redist_path, 'onecore')]
+ prefixes += [redist_path, os.path.join(redist_path, "onecore")]
- prefixes += [os.path.join(tools_path, 'redist')] # VS14 legacy path
+ prefixes += [os.path.join(tools_path, "redist")] # VS14 legacy path
# CRT directory
crt_dirs = (
- f'Microsoft.VC{self.vc_ver * 10}.CRT',
+ f"Microsoft.VC{self.vc_ver * 10}.CRT",
# Sometime store in directory with VS version instead of VC
- f'Microsoft.VC{int(self.vs_ver) * 10}.CRT',
+ f"Microsoft.VC{int(self.vs_ver) * 10}.CRT",
)
# vcruntime path
@@ -1457,7 +1457,7 @@ def return_env(self, exists: bool = True) -> _EnvironmentDict:
"""
env = _EnvironmentDict(
include=self._build_paths(
- 'include',
+ "include",
[
self.VCIncludes,
self.OSIncludes,
@@ -1467,7 +1467,7 @@ def return_env(self, exists: bool = True) -> _EnvironmentDict:
exists,
),
lib=self._build_paths(
- 'lib',
+ "lib",
[
self.VCLibraries,
self.OSLibraries,
@@ -1478,12 +1478,12 @@ def return_env(self, exists: bool = True) -> _EnvironmentDict:
exists,
),
libpath=self._build_paths(
- 'libpath',
+ "libpath",
[self.VCLibraries, self.FxTools, self.VCStoreRefs, self.OSLibpath],
exists,
),
path=self._build_paths(
- 'path',
+ "path",
[
self.VCTools,
self.VSTools,
@@ -1499,7 +1499,7 @@ def return_env(self, exists: bool = True) -> _EnvironmentDict:
),
)
if self.vs_ver >= 14 and self.VCRuntimeRedist:
- env['py_vcruntime_redist'] = self.VCRuntimeRedist
+ env["py_vcruntime_redist"] = self.VCRuntimeRedist
return env
def _build_paths(self, name, spec_path_lists, exists):
@@ -1526,7 +1526,7 @@ def _build_paths(self, name, spec_path_lists, exists):
"""
# flatten spec_path_lists
spec_paths = itertools.chain.from_iterable(spec_path_lists)
- env_paths = environ.get(name, '').split(os.pathsep)
+ env_paths = environ.get(name, "").split(os.pathsep)
paths = itertools.chain(spec_paths, env_paths)
extant_paths = list(filter(os.path.isdir, paths)) if exists else paths
if not extant_paths:
diff --git a/.venv3.10/Lib/site-packages/setuptools/namespaces.py b/.venv3.10/Lib/site-packages/setuptools/namespaces.py
index 85ea2ebd..5abcf088 100644
--- a/.venv3.10/Lib/site-packages/setuptools/namespaces.py
+++ b/.venv3.10/Lib/site-packages/setuptools/namespaces.py
@@ -9,7 +9,7 @@
class Installer:
- nspkg_ext = '-nspkg.pth'
+ nspkg_ext = "-nspkg.pth"
def install_namespaces(self) -> None:
nsp = self._get_all_ns_packages()
@@ -25,7 +25,7 @@ def install_namespaces(self) -> None:
list(lines)
return
- with open(filename, 'wt', encoding=py312.PTH_ENCODING) as f:
+ with open(filename, "wt", encoding=py312.PTH_ENCODING) as f:
# Python<3.13 requires encoding="locale" instead of "utf-8"
# See: python/cpython#77102
f.writelines(lines)
@@ -62,20 +62,20 @@ def _get_target(self):
)
"lines for the namespace installer"
- _nspkg_tmpl_multi = ('m and setattr(sys.modules[%(parent)r], %(child)r, m)',)
+ _nspkg_tmpl_multi = ("m and setattr(sys.modules[%(parent)r], %(child)r, m)",)
"additional line(s) when a parent package is indicated"
def _get_root(self):
return "sys._getframe(1).f_locals['sitedir']"
def _gen_nspkg_line(self, pkg):
- pth = tuple(pkg.split('.'))
+ pth = tuple(pkg.split("."))
root = self._get_root()
tmpl_lines = self._nspkg_tmpl
- parent, sep, child = pkg.rpartition('.')
+ parent, sep, child = pkg.rpartition(".")
if parent:
tmpl_lines += self._nspkg_tmpl_multi
- return ';'.join(tmpl_lines) % locals() + '\n'
+ return ";".join(tmpl_lines) % locals() + "\n"
def _get_all_ns_packages(self):
"""Return sorted list of all package namespaces"""
@@ -92,9 +92,9 @@ def _pkg_names(pkg):
>>> set(names) == set(['a', 'a.b', 'a.b.c'])
True
"""
- parts = pkg.split('.')
+ parts = pkg.split(".")
while parts:
- yield '.'.join(parts)
+ yield ".".join(parts)
parts.pop()
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/__init__.py b/.venv3.10/Lib/site-packages/setuptools/tests/__init__.py
index eb70bfb7..7687e856 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/__init__.py
@@ -3,11 +3,11 @@
import pytest
-__all__ = ['fail_on_ascii']
+__all__ = ["fail_on_ascii"]
if sys.version_info >= (3, 11):
locale_encoding = locale.getencoding()
else:
locale_encoding = locale.getpreferredencoding(False)
-is_ascii = locale_encoding == 'ANSI_X3.4-1968'
+is_ascii = locale_encoding == "ANSI_X3.4-1968"
fail_on_ascii = pytest.mark.xfail(is_ascii, reason="Test fails in this locale")
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/compat/py39.py b/.venv3.10/Lib/site-packages/setuptools/tests/compat/py39.py
index 1fdb9dac..c863aaad 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/compat/py39.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/compat/py39.py
@@ -1,3 +1,3 @@
from jaraco.test.cpython import from_test_support, try_import
-os_helper = try_import('os_helper') or from_test_support('can_symlink')
+os_helper = try_import("os_helper") or from_test_support("can_symlink")
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/config/downloads/__init__.py b/.venv3.10/Lib/site-packages/setuptools/tests/config/downloads/__init__.py
index 00a16423..26fa6d6f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/config/downloads/__init__.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/config/downloads/__init__.py
@@ -21,7 +21,7 @@
def output_file(url: str, download_dir: Path = DOWNLOAD_DIR) -> Path:
file_name = url.strip()
for part in NAME_REMOVE:
- file_name = file_name.replace(part, '').strip().strip('/:').strip()
+ file_name = file_name.replace(part, "").strip().strip("/:").strip()
return Path(download_dir, re.sub(r"[^\-_\.\w\d]+", "_", file_name))
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py b/.venv3.10/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py
index 489fd98e..d8171bb2 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/config/test_apply_pyprojecttoml.py
@@ -255,17 +255,17 @@ def test_no_explicit_content_type_for_missing_extension(tmp_path):
'Brett Cannon , "John X. Ãørçeč" , '
'Γαμα קּ 東 '
),
- id='non-international-emails',
+ id="non-international-emails",
),
pytest.param(
PEP621_INTERNATIONAL_EMAIL_EXAMPLE,
- 'Степан Бандера <криївка@оун-упа.укр>',
+ "Степан Бандера <криївка@оун-упа.укр>",
marks=pytest.mark.xfail(
reason="CPython's `email.headerregistry.Address` only supports "
- 'RFC 5322, as of Nov 10, 2022 and latest Python 3.11.0',
+ "RFC 5322, as of Nov 10, 2022 and latest Python 3.11.0",
strict=True,
),
- id='international-email',
+ id="international-email",
),
),
)
@@ -290,20 +290,20 @@ def test_utf8_maintainer_in_metadata( # issue-3663
@pytest.mark.parametrize(
(
- 'pyproject_text',
- 'license',
- 'license_expression',
- 'content_str',
- 'not_content_str',
+ "pyproject_text",
+ "license",
+ "license_expression",
+ "content_str",
+ "not_content_str",
),
(
pytest.param(
PEP639_LICENSE_TEXT,
- 'MIT',
+ "MIT",
None,
- 'License: MIT',
- 'License-Expression: ',
- id='license-text',
+ "License: MIT",
+ "License-Expression: ",
+ id="license-text",
marks=[
pytest.mark.filterwarnings(
"ignore:.project.license. as a TOML table is deprecated",
@@ -313,10 +313,10 @@ def test_utf8_maintainer_in_metadata( # issue-3663
pytest.param(
PEP639_LICENSE_EXPRESSION,
None,
- 'MIT OR Apache-2.0',
- 'License-Expression: MIT OR Apache-2.0',
- 'License: ',
- id='license-expression',
+ "MIT OR Apache-2.0",
+ "License-Expression: MIT OR Apache-2.0",
+ "License: ",
+ id="license-expression",
),
),
)
@@ -350,7 +350,7 @@ def test_license_classifier_with_license_expression(tmp_path):
pyproject = _pep621_example_project(
tmp_path,
"README",
- f"{text}\n \"License :: OSI Approved :: MIT License\"\n]",
+ f'{text}\n "License :: OSI Approved :: MIT License"\n]',
)
msg = "License classifiers have been superseded by license expressions"
with pytest.raises(InvalidConfigError, match=msg) as exc:
@@ -392,7 +392,7 @@ def base_pyproject(
# Sanity-check
assert 'license = "mit or apache-2.0"' in text
- assert 'license-files' not in text
+ assert "license-files" not in text
assert "[tool.setuptools]" not in text
text = re.sub(
@@ -461,7 +461,7 @@ def test_license_files_defined_twice(self, tmp_path):
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
def test_default_patterns(self, tmp_path):
- setuptools_config = '[tool.setuptools]\nzip-safe = false'
+ setuptools_config = "[tool.setuptools]\nzip-safe = false"
# ^ used just to trigger section validation
pyproject = self.base_pyproject(tmp_path, setuptools_config, license_toml="")
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/config/test_expand.py b/.venv3.10/Lib/site-packages/setuptools/tests/config/test_expand.py
index c5710ec6..f87a25c8 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/config/test_expand.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/config/test_expand.py
@@ -29,7 +29,7 @@ def test_glob_relative(tmp_path, monkeypatch):
"dir1/dir2/a.ini",
}
- write_files({k: "" for k in files}, tmp_path)
+ write_files(dict.fromkeys(files, ""), tmp_path)
patterns = ["**/*.txt", "[ab].*", "**/[ac].ini"]
monkeypatch.chdir(tmp_path)
assert set(expand.glob_relative(patterns)) == files
@@ -79,7 +79,7 @@ class TestReadAttr:
)
def test_read_attr_encoding_cookie(self, example, tmp_path):
(tmp_path / "mod.py").write_bytes(example)
- assert expand.read_attr('mod.__version__', root_dir=tmp_path) == 'é'
+ assert expand.read_attr("mod.__version__", root_dir=tmp_path) == "é"
def test_read_attr(self, tmp_path, monkeypatch):
files = {
@@ -94,20 +94,20 @@ def test_read_attr(self, tmp_path, monkeypatch):
with monkeypatch.context() as m:
m.chdir(tmp_path)
# Make sure it can read the attr statically without evaluating the module
- version = expand.read_attr('pkg.sub.VERSION')
- values = expand.read_attr('lib.mod.VALUES', {'lib': 'pkg/sub'})
+ version = expand.read_attr("pkg.sub.VERSION")
+ values = expand.read_attr("lib.mod.VALUES", {"lib": "pkg/sub"})
- assert version == '0.1.1'
+ assert version == "0.1.1"
assert is_static(values)
- assert values['a'] == 0
- assert values['b'] == {42}
+ assert values["a"] == 0
+ assert values["b"] == {42}
assert is_static(values)
# Make sure the same APIs work outside cwd
- assert expand.read_attr('pkg.sub.VERSION', root_dir=tmp_path) == '0.1.1'
- values = expand.read_attr('lib.mod.VALUES', {'lib': 'pkg/sub'}, tmp_path)
- assert values['c'] == (0, 1, 1)
+ assert expand.read_attr("pkg.sub.VERSION", root_dir=tmp_path) == "0.1.1"
+ values = expand.read_attr("lib.mod.VALUES", {"lib": "pkg/sub"}, tmp_path)
+ assert values["c"] == (0, 1, 1)
@pytest.mark.parametrize(
"example",
@@ -123,8 +123,8 @@ def test_read_annotated_attr(self, tmp_path, example):
}
write_files(files, tmp_path)
# Make sure this attribute can be read statically
- version = expand.read_attr('pkg.sub.VERSION', root_dir=tmp_path)
- assert version == '0.1.1'
+ version = expand.read_attr("pkg.sub.VERSION", root_dir=tmp_path)
+ assert version == "0.1.1"
assert is_static(version)
@pytest.mark.parametrize(
@@ -142,8 +142,8 @@ def test_read_dynamic_attr(self, tmp_path, monkeypatch, example):
}
write_files(files, tmp_path)
monkeypatch.chdir(tmp_path)
- version = expand.read_attr('pkg.sub.VERSION')
- assert version == '0.1.1'
+ version = expand.read_attr("pkg.sub.VERSION")
+ assert version == "0.1.1"
assert not is_static(version)
def test_import_order(self, tmp_path):
@@ -198,7 +198,7 @@ def test_find_packages(tmp_path, args, pkgs):
"other/__init__.py",
"dir1/dir2/__init__.py",
}
- write_files({k: "" for k in files}, tmp_path)
+ write_files(dict.fromkeys(files, ""), tmp_path)
package_dir = {}
kwargs = {"root_dir": tmp_path, "fill_package_dir": package_dir, **args}
@@ -237,7 +237,7 @@ def test_find_packages(tmp_path, args, pkgs):
],
)
def test_fill_package_dir(tmp_path, files, where, expected_package_dir):
- write_files({k: "" for k in files}, tmp_path)
+ write_files(dict.fromkeys(files, ""), tmp_path)
pkg_dir = {}
kwargs = {"root_dir": tmp_path, "fill_package_dir": pkg_dir, "namespaces": False}
pkgs = expand.find_packages(where=where, **kwargs)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/config/test_setupcfg.py b/.venv3.10/Lib/site-packages/setuptools/tests/config/test_setupcfg.py
index 61af9904..679583ec 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/config/test_setupcfg.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/config/test_setupcfg.py
@@ -25,24 +25,24 @@ class ErrConfigHandler(ConfigHandler[Target]):
def make_package_dir(name, base_dir, ns=False):
dir_package = base_dir
- for dir_name in name.split('/'):
+ for dir_name in name.split("/"):
dir_package = dir_package.mkdir(dir_name)
init_file = None
if not ns:
- init_file = dir_package.join('__init__.py')
- init_file.write('')
+ init_file = dir_package.join("__init__.py")
+ init_file.write("")
return dir_package, init_file
def fake_env(
- tmpdir, setup_cfg, setup_py=None, encoding='ascii', package_path='fake_package'
+ tmpdir, setup_cfg, setup_py=None, encoding="ascii", package_path="fake_package"
):
if setup_py is None:
- setup_py = 'from setuptools import setup\nsetup()\n'
+ setup_py = "from setuptools import setup\nsetup()\n"
- tmpdir.join('setup.py').write(setup_py)
- config = tmpdir.join('setup.cfg')
- config.write(setup_cfg.encode(encoding), mode='wb')
+ tmpdir.join("setup.py").write(setup_py)
+ config = tmpdir.join("setup.cfg")
+ config.write(setup_cfg.encode(encoding), mode="wb")
package_dir, init_file = make_package_dir(package_path, tmpdir)
@@ -65,7 +65,7 @@ def get_dist(tmpdir, kwargs_initial=None, parse=True):
with tmpdir.as_cwd():
dist = Distribution(kwargs_initial)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
parse and dist.parse_config_files()
yield dist
@@ -81,34 +81,34 @@ class TestConfigurationReader:
def test_basic(self, tmpdir):
_, config = fake_env(
tmpdir,
- '[metadata]\n'
- 'version = 10.1.1\n'
- 'keywords = one, two\n'
- '\n'
- '[options]\n'
- 'scripts = bin/a.py, bin/b.py\n',
+ "[metadata]\n"
+ "version = 10.1.1\n"
+ "keywords = one, two\n"
+ "\n"
+ "[options]\n"
+ "scripts = bin/a.py, bin/b.py\n",
)
config_dict = read_configuration(str(config))
- assert config_dict['metadata']['version'] == '10.1.1'
- assert config_dict['metadata']['keywords'] == ['one', 'two']
- assert config_dict['options']['scripts'] == ['bin/a.py', 'bin/b.py']
+ assert config_dict["metadata"]["version"] == "10.1.1"
+ assert config_dict["metadata"]["keywords"] == ["one", "two"]
+ assert config_dict["options"]["scripts"] == ["bin/a.py", "bin/b.py"]
def test_no_config(self, tmpdir):
with pytest.raises(DistutilsFileError):
- read_configuration(str(tmpdir.join('setup.cfg')))
+ read_configuration(str(tmpdir.join("setup.cfg")))
def test_ignore_errors(self, tmpdir):
_, config = fake_env(
tmpdir,
- '[metadata]\nversion = attr: none.VERSION\nkeywords = one, two\n',
+ "[metadata]\nversion = attr: none.VERSION\nkeywords = one, two\n",
)
with pytest.raises(ImportError):
read_configuration(str(config))
config_dict = read_configuration(str(config), ignore_option_errors=True)
- assert config_dict['metadata']['keywords'] == ['one', 'two']
- assert 'version' not in config_dict['metadata']
+ assert config_dict["metadata"]["keywords"] == ["one", "two"]
+ assert "version" not in config_dict["metadata"]
config.remove()
@@ -117,39 +117,39 @@ class TestMetadata:
def test_basic(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'version = 10.1.1\n'
- 'description = Some description\n'
- 'long_description_content_type = text/something\n'
- 'long_description = file: README\n'
- 'name = fake_name\n'
- 'keywords = one, two\n'
- 'provides = package, package.sub\n'
- 'license = otherlic\n'
- 'download_url = http://test.test.com/test/\n'
- 'maintainer_email = test@test.com\n',
+ "[metadata]\n"
+ "version = 10.1.1\n"
+ "description = Some description\n"
+ "long_description_content_type = text/something\n"
+ "long_description = file: README\n"
+ "name = fake_name\n"
+ "keywords = one, two\n"
+ "provides = package, package.sub\n"
+ "license = otherlic\n"
+ "download_url = http://test.test.com/test/\n"
+ "maintainer_email = test@test.com\n",
)
- tmpdir.join('README').write('readme contents\nline2')
+ tmpdir.join("README").write("readme contents\nline2")
meta_initial = {
# This will be used so `otherlic` won't replace it.
- 'license': 'BSD 3-Clause License',
+ "license": "BSD 3-Clause License",
}
with get_dist(tmpdir, meta_initial) as dist:
metadata = dist.metadata
- assert metadata.version == '10.1.1'
- assert metadata.description == 'Some description'
- assert metadata.long_description_content_type == 'text/something'
- assert metadata.long_description == 'readme contents\nline2'
- assert metadata.provides == ['package', 'package.sub']
- assert metadata.license == 'BSD 3-Clause License'
- assert metadata.name == 'fake_name'
- assert metadata.keywords == ['one', 'two']
- assert metadata.download_url == 'http://test.test.com/test/'
- assert metadata.maintainer_email == 'test@test.com'
+ assert metadata.version == "10.1.1"
+ assert metadata.description == "Some description"
+ assert metadata.long_description_content_type == "text/something"
+ assert metadata.long_description == "readme contents\nline2"
+ assert metadata.provides == ["package", "package.sub"]
+ assert metadata.license == "BSD 3-Clause License"
+ assert metadata.name == "fake_name"
+ assert metadata.keywords == ["one", "two"]
+ assert metadata.download_url == "http://test.test.com/test/"
+ assert metadata.maintainer_email == "test@test.com"
def test_license_cfg(self, tmpdir):
fake_env(
@@ -174,22 +174,22 @@ def test_license_cfg(self, tmpdir):
def test_file_mixed(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\nlong_description = file: README.rst, CHANGES.rst\n\n',
+ "[metadata]\nlong_description = file: README.rst, CHANGES.rst\n\n",
)
- tmpdir.join('README.rst').write('readme contents\nline2')
- tmpdir.join('CHANGES.rst').write('changelog contents\nand stuff')
+ tmpdir.join("README.rst").write("readme contents\nline2")
+ tmpdir.join("CHANGES.rst").write("changelog contents\nand stuff")
with get_dist(tmpdir) as dist:
assert dist.metadata.long_description == (
- 'readme contents\nline2\nchangelog contents\nand stuff'
+ "readme contents\nline2\nchangelog contents\nand stuff"
)
def test_file_sandboxed(self, tmpdir):
tmpdir.ensure("README")
- project = tmpdir.join('depth1', 'depth2')
+ project = tmpdir.join("depth1", "depth2")
project.ensure(dir=True)
- fake_env(project, '[metadata]\nlong_description = file: ../../README\n')
+ fake_env(project, "[metadata]\nlong_description = file: ../../README\n")
with get_dist(project, parse=False) as dist:
with pytest.raises(DistutilsOptionError):
@@ -198,104 +198,104 @@ def test_file_sandboxed(self, tmpdir):
def test_aliases(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'author_email = test@test.com\n'
- 'home_page = http://test.test.com/test/\n'
- 'summary = Short summary\n'
- 'platform = a, b\n'
- 'classifier =\n'
- ' Framework :: Django\n'
- ' Programming Language :: Python :: 3.5\n',
+ "[metadata]\n"
+ "author_email = test@test.com\n"
+ "home_page = http://test.test.com/test/\n"
+ "summary = Short summary\n"
+ "platform = a, b\n"
+ "classifier =\n"
+ " Framework :: Django\n"
+ " Programming Language :: Python :: 3.5\n",
)
with get_dist(tmpdir) as dist:
metadata = dist.metadata
- assert metadata.author_email == 'test@test.com'
- assert metadata.url == 'http://test.test.com/test/'
- assert metadata.description == 'Short summary'
- assert metadata.platforms == ['a', 'b']
+ assert metadata.author_email == "test@test.com"
+ assert metadata.url == "http://test.test.com/test/"
+ assert metadata.description == "Short summary"
+ assert metadata.platforms == ["a", "b"]
assert metadata.classifiers == [
- 'Framework :: Django',
- 'Programming Language :: Python :: 3.5',
+ "Framework :: Django",
+ "Programming Language :: Python :: 3.5",
]
def test_multiline(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'name = fake_name\n'
- 'keywords =\n'
- ' one\n'
- ' two\n'
- 'classifiers =\n'
- ' Framework :: Django\n'
- ' Programming Language :: Python :: 3.5\n',
+ "[metadata]\n"
+ "name = fake_name\n"
+ "keywords =\n"
+ " one\n"
+ " two\n"
+ "classifiers =\n"
+ " Framework :: Django\n"
+ " Programming Language :: Python :: 3.5\n",
)
with get_dist(tmpdir) as dist:
metadata = dist.metadata
- assert metadata.keywords == ['one', 'two']
+ assert metadata.keywords == ["one", "two"]
assert metadata.classifiers == [
- 'Framework :: Django',
- 'Programming Language :: Python :: 3.5',
+ "Framework :: Django",
+ "Programming Language :: Python :: 3.5",
]
def test_dict(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'project_urls =\n'
- ' Link One = https://example.com/one/\n'
- ' Link Two = https://example.com/two/\n',
+ "[metadata]\n"
+ "project_urls =\n"
+ " Link One = https://example.com/one/\n"
+ " Link Two = https://example.com/two/\n",
)
with get_dist(tmpdir) as dist:
metadata = dist.metadata
assert metadata.project_urls == {
- 'Link One': 'https://example.com/one/',
- 'Link Two': 'https://example.com/two/',
+ "Link One": "https://example.com/one/",
+ "Link Two": "https://example.com/two/",
}
def test_version(self, tmpdir):
package_dir, config = fake_env(
- tmpdir, '[metadata]\nversion = attr: fake_package.VERSION\n'
+ tmpdir, "[metadata]\nversion = attr: fake_package.VERSION\n"
)
- sub_a = package_dir.mkdir('subpkg_a')
- sub_a.join('__init__.py').write('')
- sub_a.join('mod.py').write('VERSION = (2016, 11, 26)')
+ sub_a = package_dir.mkdir("subpkg_a")
+ sub_a.join("__init__.py").write("")
+ sub_a.join("mod.py").write("VERSION = (2016, 11, 26)")
- sub_b = package_dir.mkdir('subpkg_b')
- sub_b.join('__init__.py').write('')
- sub_b.join('mod.py').write(
- 'import third_party_module\nVERSION = (2016, 11, 26)'
+ sub_b = package_dir.mkdir("subpkg_b")
+ sub_b.join("__init__.py").write("")
+ sub_b.join("mod.py").write(
+ "import third_party_module\nVERSION = (2016, 11, 26)"
)
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '1.2.3'
+ assert dist.metadata.version == "1.2.3"
- config.write('[metadata]\nversion = attr: fake_package.get_version\n')
+ config.write("[metadata]\nversion = attr: fake_package.get_version\n")
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '3.4.5.dev'
+ assert dist.metadata.version == "3.4.5.dev"
- config.write('[metadata]\nversion = attr: fake_package.VERSION_MAJOR\n')
+ config.write("[metadata]\nversion = attr: fake_package.VERSION_MAJOR\n")
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '1'
+ assert dist.metadata.version == "1"
- config.write('[metadata]\nversion = attr: fake_package.subpkg_a.mod.VERSION\n')
+ config.write("[metadata]\nversion = attr: fake_package.subpkg_a.mod.VERSION\n")
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '2016.11.26'
+ assert dist.metadata.version == "2016.11.26"
- config.write('[metadata]\nversion = attr: fake_package.subpkg_b.mod.VERSION\n')
+ config.write("[metadata]\nversion = attr: fake_package.subpkg_b.mod.VERSION\n")
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '2016.11.26'
+ assert dist.metadata.version == "2016.11.26"
def test_version_file(self, tmpdir):
- fake_env(tmpdir, '[metadata]\nversion = file: fake_package/version.txt\n')
- tmpdir.join('fake_package', 'version.txt').write('1.2.3\n')
+ fake_env(tmpdir, "[metadata]\nversion = file: fake_package/version.txt\n")
+ tmpdir.join("fake_package", "version.txt").write("1.2.3\n")
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '1.2.3'
+ assert dist.metadata.version == "1.2.3"
- tmpdir.join('fake_package', 'version.txt').write('1.2.3\n4.5.6\n')
+ tmpdir.join("fake_package", "version.txt").write("1.2.3\n4.5.6\n")
with pytest.raises(DistutilsOptionError):
with get_dist(tmpdir) as dist:
dist.metadata.version
@@ -303,70 +303,70 @@ def test_version_file(self, tmpdir):
def test_version_with_package_dir_simple(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'version = attr: fake_package_simple.VERSION\n'
- '[options]\n'
- 'package_dir =\n'
- ' = src\n',
- package_path='src/fake_package_simple',
+ "[metadata]\n"
+ "version = attr: fake_package_simple.VERSION\n"
+ "[options]\n"
+ "package_dir =\n"
+ " = src\n",
+ package_path="src/fake_package_simple",
)
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '1.2.3'
+ assert dist.metadata.version == "1.2.3"
def test_version_with_package_dir_rename(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'version = attr: fake_package_rename.VERSION\n'
- '[options]\n'
- 'package_dir =\n'
- ' fake_package_rename = fake_dir\n',
- package_path='fake_dir',
+ "[metadata]\n"
+ "version = attr: fake_package_rename.VERSION\n"
+ "[options]\n"
+ "package_dir =\n"
+ " fake_package_rename = fake_dir\n",
+ package_path="fake_dir",
)
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '1.2.3'
+ assert dist.metadata.version == "1.2.3"
def test_version_with_package_dir_complex(self, tmpdir):
fake_env(
tmpdir,
- '[metadata]\n'
- 'version = attr: fake_package_complex.VERSION\n'
- '[options]\n'
- 'package_dir =\n'
- ' fake_package_complex = src/fake_dir\n',
- package_path='src/fake_dir',
+ "[metadata]\n"
+ "version = attr: fake_package_complex.VERSION\n"
+ "[options]\n"
+ "package_dir =\n"
+ " fake_package_complex = src/fake_dir\n",
+ package_path="src/fake_dir",
)
with get_dist(tmpdir) as dist:
- assert dist.metadata.version == '1.2.3'
+ assert dist.metadata.version == "1.2.3"
def test_unknown_meta_item(self, tmpdir):
- fake_env(tmpdir, '[metadata]\nname = fake_name\nunknown = some\n')
+ fake_env(tmpdir, "[metadata]\nname = fake_name\nunknown = some\n")
with get_dist(tmpdir, parse=False) as dist:
dist.parse_config_files() # Skip unknown.
def test_usupported_section(self, tmpdir):
- fake_env(tmpdir, '[metadata.some]\nkey = val\n')
+ fake_env(tmpdir, "[metadata.some]\nkey = val\n")
with get_dist(tmpdir, parse=False) as dist:
with pytest.raises(DistutilsOptionError):
dist.parse_config_files()
def test_classifiers(self, tmpdir):
expected = set([
- 'Framework :: Django',
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.5',
+ "Framework :: Django",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.5",
])
# From file.
- _, config = fake_env(tmpdir, '[metadata]\nclassifiers = file: classifiers\n')
+ _, config = fake_env(tmpdir, "[metadata]\nclassifiers = file: classifiers\n")
- tmpdir.join('classifiers').write(
- 'Framework :: Django\n'
- 'Programming Language :: Python :: 3\n'
- 'Programming Language :: Python :: 3.5\n'
+ tmpdir.join("classifiers").write(
+ "Framework :: Django\n"
+ "Programming Language :: Python :: 3\n"
+ "Programming Language :: Python :: 3.5\n"
)
with get_dist(tmpdir) as dist:
@@ -374,39 +374,39 @@ def test_classifiers(self, tmpdir):
# From list notation
config.write(
- '[metadata]\n'
- 'classifiers =\n'
- ' Framework :: Django\n'
- ' Programming Language :: Python :: 3\n'
- ' Programming Language :: Python :: 3.5\n'
+ "[metadata]\n"
+ "classifiers =\n"
+ " Framework :: Django\n"
+ " Programming Language :: Python :: 3\n"
+ " Programming Language :: Python :: 3.5\n"
)
with get_dist(tmpdir) as dist:
assert set(dist.metadata.classifiers) == expected
def test_interpolation(self, tmpdir):
- fake_env(tmpdir, '[metadata]\ndescription = %(message)s\n')
+ fake_env(tmpdir, "[metadata]\ndescription = %(message)s\n")
with pytest.raises(configparser.InterpolationMissingOptionError):
with get_dist(tmpdir):
pass
def test_non_ascii_1(self, tmpdir):
- fake_env(tmpdir, '[metadata]\ndescription = éàïôñ\n', encoding='utf-8')
+ fake_env(tmpdir, "[metadata]\ndescription = éàïôñ\n", encoding="utf-8")
with get_dist(tmpdir):
pass
def test_non_ascii_3(self, tmpdir):
- fake_env(tmpdir, '\n# -*- coding: invalid\n')
+ fake_env(tmpdir, "\n# -*- coding: invalid\n")
with get_dist(tmpdir):
pass
def test_non_ascii_4(self, tmpdir):
fake_env(
tmpdir,
- '# -*- coding: utf-8\n[metadata]\ndescription = éàïôñ\n',
- encoding='utf-8',
+ "# -*- coding: utf-8\n[metadata]\ndescription = éàïôñ\n",
+ encoding="utf-8",
)
with get_dist(tmpdir) as dist:
- assert dist.metadata.description == 'éàïôñ'
+ assert dist.metadata.description == "éàïôñ"
def test_not_utf8(self, tmpdir):
"""
@@ -414,8 +414,8 @@ def test_not_utf8(self, tmpdir):
"""
fake_env(
tmpdir,
- '# vim: set fileencoding=iso-8859-15 :\n[metadata]\ndescription = éàïôñ\n',
- encoding='iso-8859-15',
+ "# vim: set fileencoding=iso-8859-15 :\n[metadata]\ndescription = éàïôñ\n",
+ encoding="iso-8859-15",
)
with pytest.raises(UnicodeDecodeError):
with get_dist(tmpdir):
@@ -458,7 +458,7 @@ def test_invalid_options_previously_deprecated(
with pytest.warns(SetuptoolsDeprecationWarning, match=re.escape(error_msg)):
dist = get_dist(tmpdir).__enter__()
- tmpdir.join('setup.cfg').remove()
+ tmpdir.join("setup.cfg").remove()
for field, value in invalid.items():
attr = field.replace("-", "_").lower()
@@ -469,100 +469,100 @@ class TestOptions:
def test_basic(self, tmpdir):
fake_env(
tmpdir,
- '[options]\n'
- 'zip_safe = True\n'
- 'include_package_data = yes\n'
- 'package_dir = b=c, =src\n'
- 'packages = pack_a, pack_b.subpack\n'
- 'namespace_packages = pack1, pack2\n'
- 'scripts = bin/one.py, bin/two.py\n'
- 'eager_resources = bin/one.py, bin/two.py\n'
- 'install_requires = docutils>=0.3; pack ==1.1, ==1.3; hey\n'
- 'setup_requires = docutils>=0.3; spack ==1.1, ==1.3; there\n'
- 'dependency_links = http://some.com/here/1, '
- 'http://some.com/there/2\n'
- 'python_requires = >=1.0, !=2.8\n'
- 'py_modules = module1, module2\n',
+ "[options]\n"
+ "zip_safe = True\n"
+ "include_package_data = yes\n"
+ "package_dir = b=c, =src\n"
+ "packages = pack_a, pack_b.subpack\n"
+ "namespace_packages = pack1, pack2\n"
+ "scripts = bin/one.py, bin/two.py\n"
+ "eager_resources = bin/one.py, bin/two.py\n"
+ "install_requires = docutils>=0.3; pack ==1.1, ==1.3; hey\n"
+ "setup_requires = docutils>=0.3; spack ==1.1, ==1.3; there\n"
+ "dependency_links = http://some.com/here/1, "
+ "http://some.com/there/2\n"
+ "python_requires = >=1.0, !=2.8\n"
+ "py_modules = module1, module2\n",
)
deprec = pytest.warns(SetuptoolsDeprecationWarning, match="namespace_packages")
with deprec, get_dist(tmpdir) as dist:
assert dist.zip_safe
assert dist.include_package_data
- assert dist.package_dir == {'': 'src', 'b': 'c'}
- assert dist.packages == ['pack_a', 'pack_b.subpack']
- assert dist.namespace_packages == ['pack1', 'pack2']
- assert dist.scripts == ['bin/one.py', 'bin/two.py']
+ assert dist.package_dir == {"": "src", "b": "c"}
+ assert dist.packages == ["pack_a", "pack_b.subpack"]
+ assert dist.namespace_packages == ["pack1", "pack2"]
+ assert dist.scripts == ["bin/one.py", "bin/two.py"]
assert dist.dependency_links == ([
- 'http://some.com/here/1',
- 'http://some.com/there/2',
+ "http://some.com/here/1",
+ "http://some.com/there/2",
])
assert dist.install_requires == ([
- 'docutils>=0.3',
- 'pack==1.1,==1.3',
- 'hey',
+ "docutils>=0.3",
+ "pack==1.1,==1.3",
+ "hey",
])
assert dist.setup_requires == ([
- 'docutils>=0.3',
- 'spack ==1.1, ==1.3',
- 'there',
+ "docutils>=0.3",
+ "spack ==1.1, ==1.3",
+ "there",
])
- assert dist.python_requires == '>=1.0, !=2.8'
- assert dist.py_modules == ['module1', 'module2']
+ assert dist.python_requires == ">=1.0, !=2.8"
+ assert dist.py_modules == ["module1", "module2"]
def test_multiline(self, tmpdir):
fake_env(
tmpdir,
- '[options]\n'
- 'package_dir = \n'
- ' b=c\n'
- ' =src\n'
- 'packages = \n'
- ' pack_a\n'
- ' pack_b.subpack\n'
- 'namespace_packages = \n'
- ' pack1\n'
- ' pack2\n'
- 'scripts = \n'
- ' bin/one.py\n'
- ' bin/two.py\n'
- 'eager_resources = \n'
- ' bin/one.py\n'
- ' bin/two.py\n'
- 'install_requires = \n'
- ' docutils>=0.3\n'
- ' pack ==1.1, ==1.3\n'
- ' hey\n'
- 'setup_requires = \n'
- ' docutils>=0.3\n'
- ' spack ==1.1, ==1.3\n'
- ' there\n'
- 'dependency_links = \n'
- ' http://some.com/here/1\n'
- ' http://some.com/there/2\n',
+ "[options]\n"
+ "package_dir = \n"
+ " b=c\n"
+ " =src\n"
+ "packages = \n"
+ " pack_a\n"
+ " pack_b.subpack\n"
+ "namespace_packages = \n"
+ " pack1\n"
+ " pack2\n"
+ "scripts = \n"
+ " bin/one.py\n"
+ " bin/two.py\n"
+ "eager_resources = \n"
+ " bin/one.py\n"
+ " bin/two.py\n"
+ "install_requires = \n"
+ " docutils>=0.3\n"
+ " pack ==1.1, ==1.3\n"
+ " hey\n"
+ "setup_requires = \n"
+ " docutils>=0.3\n"
+ " spack ==1.1, ==1.3\n"
+ " there\n"
+ "dependency_links = \n"
+ " http://some.com/here/1\n"
+ " http://some.com/there/2\n",
)
deprec = pytest.warns(SetuptoolsDeprecationWarning, match="namespace_packages")
with deprec, get_dist(tmpdir) as dist:
- assert dist.package_dir == {'': 'src', 'b': 'c'}
- assert dist.packages == ['pack_a', 'pack_b.subpack']
- assert dist.namespace_packages == ['pack1', 'pack2']
- assert dist.scripts == ['bin/one.py', 'bin/two.py']
+ assert dist.package_dir == {"": "src", "b": "c"}
+ assert dist.packages == ["pack_a", "pack_b.subpack"]
+ assert dist.namespace_packages == ["pack1", "pack2"]
+ assert dist.scripts == ["bin/one.py", "bin/two.py"]
assert dist.dependency_links == ([
- 'http://some.com/here/1',
- 'http://some.com/there/2',
+ "http://some.com/here/1",
+ "http://some.com/there/2",
])
assert dist.install_requires == ([
- 'docutils>=0.3',
- 'pack==1.1,==1.3',
- 'hey',
+ "docutils>=0.3",
+ "pack==1.1,==1.3",
+ "hey",
])
assert dist.setup_requires == ([
- 'docutils>=0.3',
- 'spack ==1.1, ==1.3',
- 'there',
+ "docutils>=0.3",
+ "spack ==1.1, ==1.3",
+ "there",
])
def test_package_dir_fail(self, tmpdir):
- fake_env(tmpdir, '[options]\npackage_dir = a b\n')
+ fake_env(tmpdir, "[options]\npackage_dir = a b\n")
with get_dist(tmpdir, parse=False) as dist:
with pytest.raises(DistutilsOptionError):
dist.parse_config_files()
@@ -570,123 +570,123 @@ def test_package_dir_fail(self, tmpdir):
def test_package_data(self, tmpdir):
fake_env(
tmpdir,
- '[options.package_data]\n'
- '* = *.txt, *.rst\n'
- 'hello = *.msg\n'
- '\n'
- '[options.exclude_package_data]\n'
- '* = fake1.txt, fake2.txt\n'
- 'hello = *.dat\n',
+ "[options.package_data]\n"
+ "* = *.txt, *.rst\n"
+ "hello = *.msg\n"
+ "\n"
+ "[options.exclude_package_data]\n"
+ "* = fake1.txt, fake2.txt\n"
+ "hello = *.dat\n",
)
with get_dist(tmpdir) as dist:
assert dist.package_data == {
- '': ['*.txt', '*.rst'],
- 'hello': ['*.msg'],
+ "": ["*.txt", "*.rst"],
+ "hello": ["*.msg"],
}
assert dist.exclude_package_data == {
- '': ['fake1.txt', 'fake2.txt'],
- 'hello': ['*.dat'],
+ "": ["fake1.txt", "fake2.txt"],
+ "hello": ["*.dat"],
}
def test_packages(self, tmpdir):
- fake_env(tmpdir, '[options]\npackages = find:\n')
+ fake_env(tmpdir, "[options]\npackages = find:\n")
with get_dist(tmpdir) as dist:
- assert dist.packages == ['fake_package']
+ assert dist.packages == ["fake_package"]
def test_find_directive(self, tmpdir):
- dir_package, config = fake_env(tmpdir, '[options]\npackages = find:\n')
+ dir_package, config = fake_env(tmpdir, "[options]\npackages = find:\n")
- make_package_dir('sub_one', dir_package)
- make_package_dir('sub_two', dir_package)
+ make_package_dir("sub_one", dir_package)
+ make_package_dir("sub_two", dir_package)
with get_dist(tmpdir) as dist:
assert set(dist.packages) == set([
- 'fake_package',
- 'fake_package.sub_two',
- 'fake_package.sub_one',
+ "fake_package",
+ "fake_package.sub_two",
+ "fake_package.sub_one",
])
config.write(
- '[options]\n'
- 'packages = find:\n'
- '\n'
- '[options.packages.find]\n'
- 'where = .\n'
- 'include =\n'
- ' fake_package.sub_one\n'
- ' two\n'
+ "[options]\n"
+ "packages = find:\n"
+ "\n"
+ "[options.packages.find]\n"
+ "where = .\n"
+ "include =\n"
+ " fake_package.sub_one\n"
+ " two\n"
)
with get_dist(tmpdir) as dist:
- assert dist.packages == ['fake_package.sub_one']
+ assert dist.packages == ["fake_package.sub_one"]
config.write(
- '[options]\n'
- 'packages = find:\n'
- '\n'
- '[options.packages.find]\n'
- 'exclude =\n'
- ' fake_package.sub_one\n'
+ "[options]\n"
+ "packages = find:\n"
+ "\n"
+ "[options.packages.find]\n"
+ "exclude =\n"
+ " fake_package.sub_one\n"
)
with get_dist(tmpdir) as dist:
- assert set(dist.packages) == set(['fake_package', 'fake_package.sub_two'])
+ assert set(dist.packages) == set(["fake_package", "fake_package.sub_two"])
def test_find_namespace_directive(self, tmpdir):
dir_package, config = fake_env(
- tmpdir, '[options]\npackages = find_namespace:\n'
+ tmpdir, "[options]\npackages = find_namespace:\n"
)
- make_package_dir('sub_one', dir_package)
- make_package_dir('sub_two', dir_package, ns=True)
+ make_package_dir("sub_one", dir_package)
+ make_package_dir("sub_two", dir_package, ns=True)
with get_dist(tmpdir) as dist:
assert set(dist.packages) == {
- 'fake_package',
- 'fake_package.sub_two',
- 'fake_package.sub_one',
+ "fake_package",
+ "fake_package.sub_two",
+ "fake_package.sub_one",
}
config.write(
- '[options]\n'
- 'packages = find_namespace:\n'
- '\n'
- '[options.packages.find]\n'
- 'where = .\n'
- 'include =\n'
- ' fake_package.sub_one\n'
- ' two\n'
+ "[options]\n"
+ "packages = find_namespace:\n"
+ "\n"
+ "[options.packages.find]\n"
+ "where = .\n"
+ "include =\n"
+ " fake_package.sub_one\n"
+ " two\n"
)
with get_dist(tmpdir) as dist:
- assert dist.packages == ['fake_package.sub_one']
+ assert dist.packages == ["fake_package.sub_one"]
config.write(
- '[options]\n'
- 'packages = find_namespace:\n'
- '\n'
- '[options.packages.find]\n'
- 'exclude =\n'
- ' fake_package.sub_one\n'
+ "[options]\n"
+ "packages = find_namespace:\n"
+ "\n"
+ "[options.packages.find]\n"
+ "exclude =\n"
+ " fake_package.sub_one\n"
)
with get_dist(tmpdir) as dist:
- assert set(dist.packages) == {'fake_package', 'fake_package.sub_two'}
+ assert set(dist.packages) == {"fake_package", "fake_package.sub_two"}
def test_extras_require(self, tmpdir):
fake_env(
tmpdir,
- '[options.extras_require]\n'
- 'pdf = ReportLab>=1.2; RXP\n'
- 'rest = \n'
- ' docutils>=0.3\n'
- ' pack ==1.1, ==1.3\n',
+ "[options.extras_require]\n"
+ "pdf = ReportLab>=1.2; RXP\n"
+ "rest = \n"
+ " docutils>=0.3\n"
+ " pack ==1.1, ==1.3\n",
)
with get_dist(tmpdir) as dist:
assert dist.extras_require == {
- 'pdf': ['ReportLab>=1.2', 'RXP'],
- 'rest': ['docutils>=0.3', 'pack==1.1,==1.3'],
+ "pdf": ["ReportLab>=1.2", "RXP"],
+ "rest": ["docutils>=0.3", "pack==1.1,==1.3"],
}
- assert set(dist.metadata.provides_extras) == {'pdf', 'rest'}
+ assert set(dist.metadata.provides_extras) == {"pdf", "rest"}
@pytest.mark.parametrize(
"config",
@@ -755,38 +755,38 @@ def test_nowarn_accidental_env_marker_misconfig(self, config, tmpdir, recwarn):
assert len(recwarn) == num_warnings
def test_dash_preserved_extras_require(self, tmpdir):
- fake_env(tmpdir, '[options.extras_require]\nfoo-a = foo\nfoo_b = test\n')
+ fake_env(tmpdir, "[options.extras_require]\nfoo-a = foo\nfoo_b = test\n")
with get_dist(tmpdir) as dist:
- assert dist.extras_require == {'foo-a': ['foo'], 'foo_b': ['test']}
+ assert dist.extras_require == {"foo-a": ["foo"], "foo_b": ["test"]}
def test_entry_points(self, tmpdir):
_, config = fake_env(
tmpdir,
- '[options.entry_points]\n'
- 'group1 = point1 = pack.module:func, '
- '.point2 = pack.module2:func_rest [rest]\n'
- 'group2 = point3 = pack.module:func2\n',
+ "[options.entry_points]\n"
+ "group1 = point1 = pack.module:func, "
+ ".point2 = pack.module2:func_rest [rest]\n"
+ "group2 = point3 = pack.module:func2\n",
)
with get_dist(tmpdir) as dist:
assert dist.entry_points == {
- 'group1': [
- 'point1 = pack.module:func',
- '.point2 = pack.module2:func_rest [rest]',
+ "group1": [
+ "point1 = pack.module:func",
+ ".point2 = pack.module2:func_rest [rest]",
],
- 'group2': ['point3 = pack.module:func2'],
+ "group2": ["point3 = pack.module:func2"],
}
expected = (
- '[blogtool.parsers]\n'
- '.rst = some.nested.module:SomeClass.some_classmethod[reST]\n'
+ "[blogtool.parsers]\n"
+ ".rst = some.nested.module:SomeClass.some_classmethod[reST]\n"
)
- tmpdir.join('entry_points').write(expected)
+ tmpdir.join("entry_points").write(expected)
# From file.
- config.write('[options]\nentry_points = file: entry_points\n')
+ config.write("[options]\nentry_points = file: entry_points\n")
with get_dist(tmpdir) as dist:
assert dist.entry_points == expected
@@ -794,70 +794,70 @@ def test_entry_points(self, tmpdir):
def test_case_sensitive_entry_points(self, tmpdir):
fake_env(
tmpdir,
- '[options.entry_points]\n'
- 'GROUP1 = point1 = pack.module:func, '
- '.point2 = pack.module2:func_rest [rest]\n'
- 'group2 = point3 = pack.module:func2\n',
+ "[options.entry_points]\n"
+ "GROUP1 = point1 = pack.module:func, "
+ ".point2 = pack.module2:func_rest [rest]\n"
+ "group2 = point3 = pack.module:func2\n",
)
with get_dist(tmpdir) as dist:
assert dist.entry_points == {
- 'GROUP1': [
- 'point1 = pack.module:func',
- '.point2 = pack.module2:func_rest [rest]',
+ "GROUP1": [
+ "point1 = pack.module:func",
+ ".point2 = pack.module2:func_rest [rest]",
],
- 'group2': ['point3 = pack.module:func2'],
+ "group2": ["point3 = pack.module:func2"],
}
def test_data_files(self, tmpdir):
fake_env(
tmpdir,
- '[options.data_files]\n'
- 'cfg =\n'
- ' a/b.conf\n'
- ' c/d.conf\n'
- 'data = e/f.dat, g/h.dat\n',
+ "[options.data_files]\n"
+ "cfg =\n"
+ " a/b.conf\n"
+ " c/d.conf\n"
+ "data = e/f.dat, g/h.dat\n",
)
with get_dist(tmpdir) as dist:
expected = [
- ('cfg', ['a/b.conf', 'c/d.conf']),
- ('data', ['e/f.dat', 'g/h.dat']),
+ ("cfg", ["a/b.conf", "c/d.conf"]),
+ ("data", ["e/f.dat", "g/h.dat"]),
]
assert sorted(dist.data_files) == sorted(expected)
def test_data_files_globby(self, tmpdir):
fake_env(
tmpdir,
- '[options.data_files]\n'
- 'cfg =\n'
- ' a/b.conf\n'
- ' c/d.conf\n'
- 'data = *.dat\n'
- 'icons = \n'
- ' *.ico\n'
- 'audio = \n'
- ' *.wav\n'
- ' sounds.db\n',
+ "[options.data_files]\n"
+ "cfg =\n"
+ " a/b.conf\n"
+ " c/d.conf\n"
+ "data = *.dat\n"
+ "icons = \n"
+ " *.ico\n"
+ "audio = \n"
+ " *.wav\n"
+ " sounds.db\n",
)
# Create dummy files for glob()'s sake:
- tmpdir.join('a.dat').write('')
- tmpdir.join('b.dat').write('')
- tmpdir.join('c.dat').write('')
- tmpdir.join('a.ico').write('')
- tmpdir.join('b.ico').write('')
- tmpdir.join('c.ico').write('')
- tmpdir.join('beep.wav').write('')
- tmpdir.join('boop.wav').write('')
- tmpdir.join('sounds.db').write('')
+ tmpdir.join("a.dat").write("")
+ tmpdir.join("b.dat").write("")
+ tmpdir.join("c.dat").write("")
+ tmpdir.join("a.ico").write("")
+ tmpdir.join("b.ico").write("")
+ tmpdir.join("c.ico").write("")
+ tmpdir.join("beep.wav").write("")
+ tmpdir.join("boop.wav").write("")
+ tmpdir.join("sounds.db").write("")
with get_dist(tmpdir) as dist:
expected = [
- ('cfg', ['a/b.conf', 'c/d.conf']),
- ('data', ['a.dat', 'b.dat', 'c.dat']),
- ('icons', ['a.ico', 'b.ico', 'c.ico']),
- ('audio', ['beep.wav', 'boop.wav', 'sounds.db']),
+ ("cfg", ["a/b.conf", "c/d.conf"]),
+ ("data", ["a.dat", "b.dat", "c.dat"]),
+ ("icons", ["a.ico", "b.ico", "c.ico"]),
+ ("audio", ["beep.wav", "boop.wav", "sounds.db"]),
]
assert sorted(dist.data_files) == sorted(expected)
@@ -917,7 +917,7 @@ def test_cmdclass(self, tmpdir):
fake_env(tmpdir, inspect.cleandoc(setup_cfg))
with get_dist(tmpdir) as dist:
- cmdclass = dist.cmdclass['customcmd']
+ cmdclass = dist.cmdclass["customcmd"]
assert cmdclass.__name__ == "CustomCmd"
assert cmdclass.__module__ == "custom_build"
assert module_path.samefile(inspect.getfile(cmdclass))
@@ -935,12 +935,12 @@ def test_requirements_file(self, tmpdir):
),
)
- tmpdir.join('requirements.txt').write('\ndocutils>=0.3\n\n')
- tmpdir.join('requirements-extra.txt').write('colorama')
+ tmpdir.join("requirements.txt").write("\ndocutils>=0.3\n\n")
+ tmpdir.join("requirements-extra.txt").write("colorama")
with get_dist(tmpdir) as dist:
- assert dist.install_requires == ['docutils>=0.3']
- assert dist.extras_require == {'colors': ['colorama']}
+ assert dist.install_requires == ["docutils>=0.3"]
+ assert dist.extras_require == {"colors": ["colorama"]}
saved_dist_init = _Distribution.__init__
@@ -960,21 +960,21 @@ class TestExternalSetters:
def _fake_distribution_init(self, dist, attrs):
saved_dist_init(dist, attrs)
# see self._DISTUTILS_UNSUPPORTED_METADATA
- dist.metadata.long_description_content_type = 'text/something'
+ dist.metadata.long_description_content_type = "text/something"
# Test overwrite setup() args
dist.metadata.project_urls = {
- 'Link One': 'https://example.com/one/',
- 'Link Two': 'https://example.com/two/',
+ "Link One": "https://example.com/one/",
+ "Link Two": "https://example.com/two/",
}
- @patch.object(_Distribution, '__init__', autospec=True)
+ @patch.object(_Distribution, "__init__", autospec=True)
def test_external_setters(self, mock_parent_init, tmpdir):
mock_parent_init.side_effect = self._fake_distribution_init
- dist = Distribution(attrs={'project_urls': {'will_be': 'ignored'}})
+ dist = Distribution(attrs={"project_urls": {"will_be": "ignored"}})
- assert dist.metadata.long_description_content_type == 'text/something'
+ assert dist.metadata.long_description_content_type == "text/something"
assert dist.metadata.project_urls == {
- 'Link One': 'https://example.com/one/',
- 'Link Two': 'https://example.com/two/',
+ "Link One": "https://example.com/one/",
+ "Link Two": "https://example.com/two/",
}
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/contexts.py b/.venv3.10/Lib/site-packages/setuptools/tests/contexts.py
index 3c931bbd..6fa3bc07 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/contexts.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/contexts.py
@@ -88,10 +88,10 @@ def multiproc(request):
workers are used.
"""
try:
- worker_id = request.getfixturevalue('worker_id')
+ worker_id = request.getfixturevalue("worker_id")
except Exception:
return False
- return worker_id != 'master'
+ return worker_id != "master"
@contextlib.contextmanager
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/environment.py b/.venv3.10/Lib/site-packages/setuptools/tests/environment.py
index ed5499ef..b52eb3c9 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/environment.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/environment.py
@@ -8,12 +8,12 @@
class VirtualEnv(jaraco.envs.VirtualEnv):
- name = '.env'
+ name = ".env"
# Some version of PyPy will import distutils on startup, implicitly
# importing setuptools, and thus leading to BackendInvalid errors
# when upgrading Setuptools. Bypass this behavior by avoiding the
# early availability and need to upgrade.
- create_opts = ['--no-setuptools']
+ create_opts = ["--no-setuptools"]
def run(self, cmd, *args, **kwargs):
cmd = [self.exe(cmd[0])] + cmd[1:]
@@ -36,7 +36,7 @@ def run(self, cmd, *args, **kwargs):
def _which_dirs(cmd):
result = set()
- for path in os.environ.get('PATH', '').split(os.pathsep):
+ for path in os.environ.get("PATH", "").split(os.pathsep):
filename = os.path.join(path, cmd)
if os.access(filename, os.X_OK):
result.add(path)
@@ -67,7 +67,7 @@ def run_setup_py(cmd, pypath=None, path=None, data_stream=0, env=None):
cmd = [sys.executable, "setup.py"] + list(cmd)
# https://bugs.python.org/issue8557
- shell = sys.platform == 'win32'
+ shell = sys.platform == "win32"
try:
proc = _Popen(
@@ -83,13 +83,13 @@ def run_setup_py(cmd, pypath=None, path=None, data_stream=0, env=None):
data_stream = slice(*data_stream)
data = proc.communicate()[data_stream]
except OSError:
- return 1, ''
+ return 1, ""
# decode the console string if needed
if hasattr(data, "decode"):
# use the default encoding
data = data.decode()
- data = unicodedata.normalize('NFC', data)
+ data = unicodedata.normalize("NFC", data)
# communicate calls wait()
return proc.returncode, data
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/fixtures.py b/.venv3.10/Lib/site-packages/setuptools/tests/fixtures.py
index 27a16989..83f1398c 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/fixtures.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/fixtures.py
@@ -24,9 +24,9 @@ def user_override(monkeypatch):
a context.
"""
with contexts.tempdir() as user_base:
- monkeypatch.setattr('site.USER_BASE', user_base)
+ monkeypatch.setattr("site.USER_BASE", user_base)
with contexts.tempdir() as user_site:
- monkeypatch.setattr('site.USER_SITE', user_site)
+ monkeypatch.setattr("site.USER_SITE", user_site)
with contexts.save_user_site_setting():
yield
@@ -47,11 +47,11 @@ def workaround_xdist_376(request):
Remove the entry so the import
machinery behaves the same irrespective of xdist.
"""
- if not request.config.pluginmanager.has_plugin('xdist'):
+ if not request.config.pluginmanager.has_plugin("xdist"):
return
with contextlib.suppress(ValueError):
- sys.path.remove('')
+ sys.path.remove("")
@pytest.fixture
@@ -59,12 +59,12 @@ def sample_project(tmp_path):
"""
Clone the 'sampleproject' and return a path to it.
"""
- cmd = ['git', 'clone', 'https://github.com/pypa/sampleproject']
+ cmd = ["git", "clone", "https://github.com/pypa/sampleproject"]
try:
subprocess.check_call(cmd, cwd=str(tmp_path))
except Exception:
pytest.skip("Unable to clone sampleproject")
- return tmp_path / 'sampleproject'
+ return tmp_path / "sampleproject"
@pytest.fixture
@@ -132,8 +132,8 @@ def setuptools_wheel(tmp_path_factory, request):
def venv(tmp_path, setuptools_wheel):
"""Virtual env with the version of setuptools under test installed"""
env = environment.VirtualEnv()
- env.root = path.Path(tmp_path / 'venv')
- env.create_opts = ['--no-setuptools', '--wheel=bundle']
+ env.root = path.Path(tmp_path / "venv")
+ env.create_opts = ["--no-setuptools", "--wheel=bundle"]
# TODO: Use `--no-wheel` when setuptools implements its own bdist_wheel
env.req = str(setuptools_wheel)
# In some environments (eg. downstream distro packaging),
@@ -154,8 +154,8 @@ def venv(tmp_path, setuptools_wheel):
def venv_without_setuptools(tmp_path):
"""Virtual env without any version of setuptools installed"""
env = environment.VirtualEnv()
- env.root = path.Path(tmp_path / 'venv_without_setuptools')
- env.create_opts = ['--no-setuptools', '--no-wheel']
+ env.root = path.Path(tmp_path / "venv_without_setuptools")
+ env.create_opts = ["--no-setuptools", "--no-wheel"]
env.ensure_env()
return env
@@ -164,8 +164,8 @@ def venv_without_setuptools(tmp_path):
def bare_venv(tmp_path):
"""Virtual env without any common packages installed"""
env = environment.VirtualEnv()
- env.root = path.Path(tmp_path / 'bare_venv')
- env.create_opts = ['--no-setuptools', '--no-pip', '--no-wheel', '--no-seed']
+ env.root = path.Path(tmp_path / "bare_venv")
+ env.create_opts = ["--no-setuptools", "--no-pip", "--no-wheel", "--no-seed"]
env.ensure_env()
return env
@@ -178,9 +178,9 @@ def make_sdist(dist_path, files):
# Distributions with only one file don't play well with pip.
assert len(files) > 1
- with tarfile.open(dist_path, 'w:gz') as dist:
+ with tarfile.open(dist_path, "w:gz") as dist:
for filename, content in files:
- file_bytes = io.BytesIO(content.encode('utf-8'))
+ file_bytes = io.BytesIO(content.encode("utf-8"))
file_info = tarfile.TarInfo(name=filename)
file_info.size = len(file_bytes.getvalue())
file_info.mtime = int(time.time())
@@ -197,7 +197,7 @@ def make_trivial_sdist(dist_path, distname, version):
dist_path,
[
(
- 'setup.py',
+ "setup.py",
DALS(
f"""\
import setuptools
@@ -208,7 +208,7 @@ def make_trivial_sdist(dist_path, distname, version):
"""
),
),
- ('setup.cfg', ''),
+ ("setup.cfg", ""),
],
)
@@ -220,12 +220,12 @@ def make_nspkg_sdist(dist_path, distname, version):
designated a namespace package).
"""
# Assert that the distname contains at least one period
- assert '.' in distname
+ assert "." in distname
- parts = distname.split('.')
+ parts = distname.split(".")
nspackage = parts[0]
- packages = ['.'.join(parts[:idx]) for idx in range(1, len(parts) + 1)]
+ packages = [".".join(parts[:idx]) for idx in range(1, len(parts) + 1)]
setup_py = DALS(
f"""\
@@ -241,10 +241,10 @@ def make_nspkg_sdist(dist_path, distname, version):
init = "__import__('pkg_resources').declare_namespace(__name__)"
- files = [('setup.py', setup_py), (os.path.join(nspackage, '__init__.py'), init)]
+ files = [("setup.py", setup_py), (os.path.join(nspackage, "__init__.py"), init)]
for package in packages[1:]:
- filename = os.path.join(*(package.split('.') + ['__init__.py']))
- files.append((filename, ''))
+ filename = os.path.join(*(package.split(".") + ["__init__.py"]))
+ files.append((filename, ""))
make_sdist(dist_path, files)
@@ -254,7 +254,7 @@ def make_python_requires_sdist(dist_path, distname, version, python_requires):
dist_path,
[
(
- 'setup.py',
+ "setup.py",
DALS(
"""\
import setuptools
@@ -268,15 +268,15 @@ def make_python_requires_sdist(dist_path, distname, version, python_requires):
name=distname, version=version, python_requires=python_requires
),
),
- ('setup.cfg', ''),
+ ("setup.cfg", ""),
],
)
def create_setup_requires_package(
path,
- distname='foobar',
- version='0.1',
+ distname="foobar",
+ version="0.1",
make_package=make_trivial_sdist,
setup_py_template=None,
setup_attrs=None,
@@ -293,15 +293,15 @@ def create_setup_requires_package(
normalized_distname = safer_name(distname)
test_setup_attrs = {
- 'name': 'test_pkg',
- 'version': '0.0',
- 'setup_requires': [f'{normalized_distname}=={version}'],
- 'dependency_links': [os.path.abspath(path)],
+ "name": "test_pkg",
+ "version": "0.0",
+ "setup_requires": [f"{normalized_distname}=={version}"],
+ "dependency_links": [os.path.abspath(path)],
}
if setup_attrs:
test_setup_attrs.update(setup_attrs)
- test_pkg = os.path.join(path, 'test_pkg')
+ test_pkg = os.path.join(path, "test_pkg")
os.mkdir(test_pkg)
# setup.cfg
@@ -310,13 +310,13 @@ def create_setup_requires_package(
metadata = []
for name in use_setup_cfg:
value = test_setup_attrs.pop(name)
- if name in 'name version'.split():
+ if name in "name version".split():
section = metadata
else:
section = options
if isinstance(value, (tuple, list)):
- value = ';'.join(value)
- section.append(f'{name}: {value}')
+ value = ";".join(value)
+ section.append(f"{name}: {value}")
test_setup_cfg_contents = DALS(
"""
[metadata]
@@ -325,12 +325,12 @@ def create_setup_requires_package(
{options}
"""
).format(
- options='\n'.join(options),
- metadata='\n'.join(metadata),
+ options="\n".join(options),
+ metadata="\n".join(metadata),
)
else:
- test_setup_cfg_contents = ''
- with open(os.path.join(test_pkg, 'setup.cfg'), 'w', encoding="utf-8") as f:
+ test_setup_cfg_contents = ""
+ with open(os.path.join(test_pkg, "setup.cfg"), "w", encoding="utf-8") as f:
f.write(test_setup_cfg_contents)
# setup.py
@@ -341,10 +341,10 @@ def create_setup_requires_package(
setuptools.setup(**%r)
"""
)
- with open(os.path.join(test_pkg, 'setup.py'), 'w', encoding="utf-8") as f:
+ with open(os.path.join(test_pkg, "setup.py"), "w", encoding="utf-8") as f:
f.write(setup_py_template % test_setup_attrs)
- foobar_path = os.path.join(path, f'{normalized_distname}-{version}.tar.gz')
+ foobar_path = os.path.join(path, f"{normalized_distname}-{version}.tar.gz")
make_package(foobar_path, distname, version)
return test_pkg
@@ -385,8 +385,8 @@ def pbr_package(tmp_path, monkeypatch, venv):
"other": {"test.txt": "Another file in here."},
}
venv.run(["python", "-m", "pip", "install", "pbr"])
- prefix = tmp_path / 'mypkg'
+ prefix = tmp_path / "mypkg"
prefix.mkdir()
jaraco.path.build(files, prefix=prefix)
- monkeypatch.setenv('PBR_VERSION', "0.42")
+ monkeypatch.setenv("PBR_VERSION", "0.42")
return prefix
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/integration/test_pbr.py b/.venv3.10/Lib/site-packages/setuptools/tests/integration/test_pbr.py
index f89e5b8b..74f794ce 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/integration/test_pbr.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/integration/test_pbr.py
@@ -7,12 +7,12 @@
def test_pbr_integration(pbr_package, venv):
"""Ensure pbr packages install."""
cmd = [
- 'python',
- '-m',
- 'pip',
- '-v',
- 'install',
- '--no-build-isolation',
+ "python",
+ "-m",
+ "pip",
+ "-v",
+ "install",
+ "--no-build-isolation",
pbr_package,
]
venv.run(cmd, stderr=subprocess.STDOUT)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/mod_with_constant.py b/.venv3.10/Lib/site-packages/setuptools/tests/mod_with_constant.py
index ef755dd1..9d17090d 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/mod_with_constant.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/mod_with_constant.py
@@ -1 +1 @@
-value = 'three, sir!'
+value = "three, sir!"
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/namespaces.py b/.venv3.10/Lib/site-packages/setuptools/tests/namespaces.py
index 248db98f..97fdff44 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/namespaces.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/namespaces.py
@@ -13,8 +13,8 @@ def iter_namespace_pkgs(namespace):
def build_namespace_package(tmpdir, name, version="1.0", impl="pkg_resources"):
src_dir = tmpdir / name
src_dir.mkdir()
- setup_py = src_dir / 'setup.py'
- namespace, _, rest = name.rpartition('.')
+ setup_py = src_dir / "setup.py"
+ namespace, _, rest = name.rpartition(".")
namespaces = list(iter_namespace_pkgs(namespace))
setup_args = {
"name": name,
@@ -40,18 +40,18 @@ def build_namespace_package(tmpdir, name, version="1.0", impl="pkg_resources"):
setuptools.setup(**args)
"""
).format(args=args)
- setup_py.write_text(script, encoding='utf-8')
+ setup_py.write_text(script, encoding="utf-8")
ns_pkg_dir = Path(src_dir, namespace.replace(".", "/"))
ns_pkg_dir.mkdir(parents=True)
for ns in namespaces:
- pkg_init = src_dir / ns.replace(".", "/") / '__init__.py'
- pkg_init.write_text(tmpl, encoding='utf-8')
+ pkg_init = src_dir / ns.replace(".", "/") / "__init__.py"
+ pkg_init.write_text(tmpl, encoding="utf-8")
- pkg_mod = ns_pkg_dir / (rest + '.py')
- some_functionality = 'name = {rest!r}'.format(**locals())
- pkg_mod.write_text(some_functionality, encoding='utf-8')
+ pkg_mod = ns_pkg_dir / (rest + ".py")
+ some_functionality = "name = {rest!r}".format(**locals())
+ pkg_mod.write_text(some_functionality, encoding="utf-8")
return src_dir
@@ -69,12 +69,12 @@ def build_pep420_namespace_package(tmpdir, name):
name = "{name}"
version = "3.14159"
"""
- pyproject.write_text(textwrap.dedent(script), encoding='utf-8')
+ pyproject.write_text(textwrap.dedent(script), encoding="utf-8")
ns_pkg_dir = Path(src_dir, namespace.replace(".", "/"))
ns_pkg_dir.mkdir(parents=True)
pkg_mod = ns_pkg_dir / (rest + ".py")
some_functionality = f"name = {rest!r}"
- pkg_mod.write_text(some_functionality, encoding='utf-8')
+ pkg_mod.write_text(some_functionality, encoding="utf-8")
return src_dir
@@ -84,7 +84,7 @@ def make_site_dir(target):
target to be added to site dirs such that .pth files
are processed there.
"""
- sc = target / 'sitecustomize.py'
+ sc = target / "sitecustomize.py"
target_str = str(target)
tmpl = '__import__("site").addsitedir({target_str!r})'
- sc.write_text(tmpl.format(**locals()), encoding='utf-8')
+ sc.write_text(tmpl.format(**locals()), encoding="utf-8")
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/script-with-bom.py b/.venv3.10/Lib/site-packages/setuptools/tests/script-with-bom.py
index c074d263..5162385c 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/script-with-bom.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/script-with-bom.py
@@ -1 +1 @@
-result = 'passed'
+result = "passed"
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_archive_util.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_archive_util.py
index e3efc628..ccb6fdd9 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_archive_util.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_archive_util.py
@@ -24,13 +24,13 @@ def tarfile_with_unicode(tmpdir):
tgz.addfile(t, io.BytesIO(data))
- target = tmpdir / 'unicode-pkg-1.0.tar.gz'
- with open(str(target), mode='wb') as tf:
+ target = tmpdir / "unicode-pkg-1.0.tar.gz"
+ with open(str(target), mode="wb") as tf:
tf.write(tarobj.getvalue())
return str(target)
@pytest.mark.xfail(reason="#710 and #712")
def test_unicode_files(tarfile_with_unicode, tmpdir):
- target = tmpdir / 'out'
+ target = tmpdir / "out"
archive_util.unpack_archive(tarfile_with_unicode, str(target))
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_deprecations.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_deprecations.py
index d9d67b06..fc6c3d1a 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_deprecations.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_deprecations.py
@@ -9,16 +9,16 @@
from setuptools.dist import Distribution
-@pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only')
+@pytest.mark.skipif(sys.platform == "win32", reason="non-Windows only")
@pytest.mark.xfail(reason="bdist_rpm is long deprecated, should we remove it? #1988")
-@mock.patch('distutils.command.bdist_rpm.bdist_rpm')
+@mock.patch("distutils.command.bdist_rpm.bdist_rpm")
def test_bdist_rpm_warning(distutils_cmd, tmpdir_cwd):
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['bdist_rpm'],
- name='foo',
- py_modules=['hi'],
+ script_name="setup.py",
+ script_args=["bdist_rpm"],
+ name="foo",
+ py_modules=["hi"],
)
)
dist.parse_command_line()
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_egg.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_egg.py
index 036167dd..d108d954 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_egg.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_egg.py
@@ -19,10 +19,10 @@
@pytest.fixture
def setup_context(tmpdir):
- with (tmpdir / 'setup.py').open('w') as f:
+ with (tmpdir / "setup.py").open("w") as f:
f.write(SETUP_PY)
- with (tmpdir / 'hi.py').open('w') as f:
- f.write('1\n')
+ with (tmpdir / "hi.py").open("w") as f:
+ f.write("1\n")
with tmpdir.as_cwd():
yield tmpdir
@@ -33,23 +33,23 @@ class Test:
def test_bdist_egg(self):
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['bdist_egg'],
- name='foo',
- py_modules=['hi'],
+ script_name="setup.py",
+ script_args=["bdist_egg"],
+ name="foo",
+ py_modules=["hi"],
)
)
- os.makedirs(os.path.join('build', 'src'))
+ os.makedirs(os.path.join("build", "src"))
with contexts.quiet():
dist.parse_command_line()
dist.run_commands()
# let's see if we got our egg link at the right place
- [content] = os.listdir('dist')
- assert re.match(r'foo-0.0.0-py[23].\d+.egg$', content)
+ [content] = os.listdir("dist")
+ assert re.match(r"foo-0.0.0-py[23].\d+.egg$", content)
@pytest.mark.xfail(
- os.environ.get('PYTHONDONTWRITEBYTECODE', False),
+ os.environ.get("PYTHONDONTWRITEBYTECODE", False),
reason="Byte code disabled",
)
@pytest.mark.usefixtures("user_override")
@@ -57,17 +57,17 @@ def test_bdist_egg(self):
def test_exclude_source_files(self):
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['bdist_egg', '--exclude-source-files'],
- py_modules=['hi'],
+ script_name="setup.py",
+ script_args=["bdist_egg", "--exclude-source-files"],
+ py_modules=["hi"],
)
)
with contexts.quiet():
dist.parse_command_line()
dist.run_commands()
- [dist_name] = os.listdir('dist')
- dist_filename = os.path.join('dist', dist_name)
+ [dist_name] = os.listdir("dist")
+ dist_filename = os.path.join("dist", dist_name)
zip = zipfile.ZipFile(dist_filename)
names = list(zi.filename for zi in zip.filelist)
- assert 'hi.pyc' in names
- assert 'hi.py' not in names
+ assert "hi.pyc" in names
+ assert "hi.py" not in names
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_wheel.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_wheel.py
index 2ab4e9cf..3da7692e 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_wheel.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_bdist_wheel.py
@@ -660,7 +660,7 @@ def test_dist_info_provided(dummy_dist, monkeypatch, tmp_path):
# Check that all expected files are there.
assert expected - files_found == set()
# Make sure there is no accidental egg-info bleeding into the wheel.
- assert not [path for path in files_found if 'egg-info' in str(path)]
+ assert not [path for path in files_found if "egg-info" in str(path)]
def test_allow_grace_period_parent_directory_license(monkeypatch, tmp_path):
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_build.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_build.py
index f0f1d9dc..da493cd6 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_build.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_build.py
@@ -11,10 +11,10 @@ def test_distribution_gives_setuptools_build_obj(tmpdir_cwd):
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['build'],
+ script_name="setup.py",
+ script_args=["build"],
packages=[],
- package_data={'': ['path/*']},
+ package_data={"": ["path/*"]},
)
)
assert isinstance(dist.get_command_obj("build"), build)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_clib.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_clib.py
index b5315df4..b1e9f4c4 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_clib.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_clib.py
@@ -10,29 +10,29 @@
class TestBuildCLib:
- @mock.patch('setuptools.command.build_clib.newer_pairwise_group')
+ @mock.patch("setuptools.command.build_clib.newer_pairwise_group")
def test_build_libraries(self, mock_newer):
dist = Distribution()
cmd = build_clib(dist)
# this will be a long section, just making sure all
# exceptions are properly raised
- libs = [('example', {'sources': 'broken.c'})]
+ libs = [("example", {"sources": "broken.c"})]
with pytest.raises(DistutilsSetupError):
cmd.build_libraries(libs)
- obj_deps = 'some_string'
- libs = [('example', {'sources': ['source.c'], 'obj_deps': obj_deps})]
+ obj_deps = "some_string"
+ libs = [("example", {"sources": ["source.c"], "obj_deps": obj_deps})]
with pytest.raises(DistutilsSetupError):
cmd.build_libraries(libs)
- obj_deps = {'': ''}
- libs = [('example', {'sources': ['source.c'], 'obj_deps': obj_deps})]
+ obj_deps = {"": ""}
+ libs = [("example", {"sources": ["source.c"], "obj_deps": obj_deps})]
with pytest.raises(DistutilsSetupError):
cmd.build_libraries(libs)
- obj_deps = {'source.c': ''}
- libs = [('example', {'sources': ['source.c'], 'obj_deps': obj_deps})]
+ obj_deps = {"source.c": ""}
+ libs = [("example", {"sources": ["source.c"], "obj_deps": obj_deps})]
with pytest.raises(DistutilsSetupError):
cmd.build_libraries(libs)
@@ -41,23 +41,23 @@ def test_build_libraries(self, mock_newer):
cmd.compiler = mock.MagicMock(spec=cmd.compiler)
mock_newer.return_value = ([], [])
- obj_deps = {'': ('global.h',), 'example.c': ('example.h',)}
- libs = [('example', {'sources': ['example.c'], 'obj_deps': obj_deps})]
+ obj_deps = {"": ("global.h",), "example.c": ("example.h",)}
+ libs = [("example", {"sources": ["example.c"], "obj_deps": obj_deps})]
cmd.build_libraries(libs)
- assert [['example.c', 'global.h', 'example.h']] in mock_newer.call_args[0]
+ assert [["example.c", "global.h", "example.h"]] in mock_newer.call_args[0]
assert not cmd.compiler.compile.called
assert cmd.compiler.create_static_lib.call_count == 1
# reset the call numbers so we can test again
cmd.compiler.reset_mock()
- mock_newer.return_value = '' # anything as long as it's not ([],[])
+ mock_newer.return_value = "" # anything as long as it's not ([],[])
cmd.build_libraries(libs)
assert cmd.compiler.compile.call_count == 1
assert cmd.compiler.create_static_lib.call_count == 1
- @mock.patch('setuptools.command.build_clib.newer_pairwise_group')
+ @mock.patch("setuptools.command.build_clib.newer_pairwise_group")
def test_build_libraries_reproducible(self, mock_newer):
dist = Distribution()
cmd = build_clib(dist)
@@ -67,18 +67,18 @@ def test_build_libraries_reproducible(self, mock_newer):
cmd.compiler = mock.MagicMock(spec=cmd.compiler)
mock_newer.return_value = ([], [])
- original_sources = ['a-example.c', 'example.c']
+ original_sources = ["a-example.c", "example.c"]
sources = original_sources
- obj_deps = {'': ('global.h',), 'example.c': ('example.h',)}
- libs = [('example', {'sources': sources, 'obj_deps': obj_deps})]
+ obj_deps = {"": ("global.h",), "example.c": ("example.h",)}
+ libs = [("example", {"sources": sources, "obj_deps": obj_deps})]
cmd.build_libraries(libs)
computed_call_args = mock_newer.call_args[0]
while sources == original_sources:
sources = random.sample(original_sources, len(original_sources))
- libs = [('example', {'sources': sources, 'obj_deps': obj_deps})]
+ libs = [("example", {"sources": sources, "obj_deps": obj_deps})]
cmd.build_libraries(libs)
assert computed_call_args == mock_newer.call_args[0]
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_ext.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_ext.py
index c7b60ac3..c5fa4f87 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_ext.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_ext.py
@@ -18,7 +18,7 @@
import distutils.command.build_ext as orig
from distutils.sysconfig import get_config_var
-IS_PYPY = '__pypy__' in sys.builtin_module_names
+IS_PYPY = "__pypy__" in sys.builtin_module_names
class TestBuildExt:
@@ -30,9 +30,9 @@ def test_get_ext_filename(self):
"""
dist = Distribution()
cmd = build_ext(dist)
- cmd.ext_map['foo/bar'] = ''
- res = cmd.get_ext_filename('foo')
- wanted = orig.build_ext.get_ext_filename(cmd, 'foo')
+ cmd.ext_map["foo/bar"] = ""
+ res = cmd.get_ext_filename("foo")
+ wanted = orig.build_ext.get_ext_filename(cmd, "foo")
assert res == wanted
def test_abi3_filename(self):
@@ -42,19 +42,19 @@ def test_abi3_filename(self):
"""
print(get_abi3_suffix())
- extension = Extension('spam.eggs', ['eggs.c'], py_limited_api=True)
+ extension = Extension("spam.eggs", ["eggs.c"], py_limited_api=True)
dist = Distribution(dict(ext_modules=[extension]))
cmd = build_ext(dist)
cmd.finalize_options()
- assert 'spam.eggs' in cmd.ext_map
- res = cmd.get_ext_filename('spam.eggs')
+ assert "spam.eggs" in cmd.ext_map
+ res = cmd.get_ext_filename("spam.eggs")
if not get_abi3_suffix():
- assert res.endswith(get_config_var('EXT_SUFFIX'))
- elif sys.platform == 'win32':
- assert res.endswith('eggs.pyd')
+ assert res.endswith(get_config_var("EXT_SUFFIX"))
+ elif sys.platform == "win32":
+ assert res.endswith("eggs.pyd")
else:
- assert 'abi3' in res
+ assert "abi3" in res
def test_ext_suffix_override(self):
"""
@@ -63,9 +63,9 @@ def test_ext_suffix_override(self):
"""
dist = Distribution()
cmd = build_ext(dist)
- cmd.ext_map['for_abi3'] = ext = Extension(
- 'for_abi3',
- ['s.c'],
+ cmd.ext_map["for_abi3"] = ext = Extension(
+ "for_abi3",
+ ["s.c"],
# Override shouldn't affect abi3 modules
py_limited_api=True,
)
@@ -73,20 +73,20 @@ def test_ext_suffix_override(self):
ext._links_to_dynamic = False
if not IS_PYPY:
- expect = cmd.get_ext_filename('for_abi3')
+ expect = cmd.get_ext_filename("for_abi3")
else:
# PyPy builds do not use ABI3 tag, so they will
# also get the overridden suffix.
- expect = 'for_abi3.test-suffix'
+ expect = "for_abi3.test-suffix"
try:
- os.environ['SETUPTOOLS_EXT_SUFFIX'] = '.test-suffix'
- res = cmd.get_ext_filename('normal')
- assert 'normal.test-suffix' == res
- res = cmd.get_ext_filename('for_abi3')
+ os.environ["SETUPTOOLS_EXT_SUFFIX"] = ".test-suffix"
+ res = cmd.get_ext_filename("normal")
+ assert "normal.test-suffix" == res
+ res = cmd.get_ext_filename("for_abi3")
assert expect == res
finally:
- del os.environ['SETUPTOOLS_EXT_SUFFIX']
+ del os.environ["SETUPTOOLS_EXT_SUFFIX"]
def dist_with_example(self):
files = {
@@ -106,8 +106,8 @@ def dist_with_example(self):
})
def test_get_outputs(self, tmpdir_cwd, monkeypatch):
- monkeypatch.setenv('SETUPTOOLS_EXT_SUFFIX', '.mp3') # make test OS-independent
- monkeypatch.setattr('setuptools.command.build_ext.use_stubs', False)
+ monkeypatch.setenv("SETUPTOOLS_EXT_SUFFIX", ".mp3") # make test OS-independent
+ monkeypatch.setattr("setuptools.command.build_ext.use_stubs", False)
dist = self.dist_with_example()
# Regular build: get_outputs not empty, but get_output_mappings is empty
@@ -138,8 +138,8 @@ def test_get_outputs(self, tmpdir_cwd, monkeypatch):
}
def test_get_output_mapping_with_stub(self, tmpdir_cwd, monkeypatch):
- monkeypatch.setenv('SETUPTOOLS_EXT_SUFFIX', '.mp3') # make test OS-independent
- monkeypatch.setattr('setuptools.command.build_ext.use_stubs', True)
+ monkeypatch.setenv("SETUPTOOLS_EXT_SUFFIX", ".mp3") # make test OS-independent
+ monkeypatch.setattr("setuptools.command.build_ext.use_stubs", True)
dist = self.dist_with_example()
# Editable build should create compiled stubs (.pyc files only, no .py)
@@ -186,9 +186,9 @@ def get_build_ext_cmd(self, optional: bool, **opts) -> build_ext:
".build": {"lib": {}, "tmp": {}},
}
path.build(files)
- extension = Extension('spam.eggs', ['eggs.c'], optional=optional)
+ extension = Extension("spam.eggs", ["eggs.c"], optional=optional)
dist = Distribution(dict(ext_modules=[extension]))
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = build_ext(dist)
vars(cmd).update(build_lib=".build/lib", build_temp=".build/tmp", **opts)
cmd.ensure_finalized()
@@ -225,7 +225,7 @@ def test_non_optional(self, tmpdir_cwd):
def test_build_ext_config_handling(tmpdir_cwd):
files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
from setuptools import Extension, setup
setup(
@@ -235,7 +235,7 @@ def test_build_ext_config_handling(tmpdir_cwd):
)
"""
),
- 'foo.c': DALS(
+ "foo.c": DALS(
"""
#include "Python.h"
@@ -278,7 +278,7 @@ def test_build_ext_config_handling(tmpdir_cwd):
}
"""
),
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[build]
build_base = foo_build
@@ -287,7 +287,7 @@ def test_build_ext_config_handling(tmpdir_cwd):
}
path.build(files)
code, (stdout, stderr) = environment.run_setup_py(
- cmd=['build'],
+ cmd=["build"],
data_stream=(0, 2),
)
- assert code == 0, f'\nSTDOUT:\n{stdout}\nSTDERR:\n{stderr}'
+ assert code == 0, f"\nSTDOUT:\n{stdout}\nSTDERR:\n{stderr}"
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_meta.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_meta.py
index 57162fd6..b1c6594d 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_meta.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_meta.py
@@ -24,7 +24,7 @@
TIMEOUT = int(os.getenv("TIMEOUT_BACKEND_TEST", "180")) # in seconds
-IS_PYPY = '__pypy__' in sys.builtin_module_names
+IS_PYPY = "__pypy__" in sys.builtin_module_names
pytestmark = pytest.mark.skipif(
@@ -35,7 +35,7 @@
class BuildBackendBase:
- def __init__(self, cwd='.', env=None, backend_name='setuptools.build_meta'):
+ def __init__(self, cwd=".", env=None, backend_name="setuptools.build_meta"):
self.cwd = cwd
self.env = env or {}
self.backend_name = backend_name
@@ -80,7 +80,7 @@ class BuildBackendCaller(BuildBackendBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- (self.backend_name, _, self.backend_obj) = self.backend_name.partition(':')
+ (self.backend_name, _, self.backend_obj) = self.backend_name.partition(":")
def __call__(self, name, *args, **kw):
"""Handles arbitrary function invocations on the build backend."""
@@ -98,7 +98,7 @@ def __call__(self, name, *args, **kw):
defns = [
{ # simple setup.py script
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
__import__('setuptools').setup(
name='foo',
@@ -108,7 +108,7 @@ def __call__(self, name, *args, **kw):
)
"""
),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -116,7 +116,7 @@ def run():
),
},
{ # setup.py that relies on __name__
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
assert __name__ == '__main__'
__import__('setuptools').setup(
@@ -127,7 +127,7 @@ def run():
)
"""
),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -135,7 +135,7 @@ def run():
),
},
{ # setup.py script that runs arbitrary code
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
variable = True
def function():
@@ -149,7 +149,7 @@ def function():
)
"""
),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -157,7 +157,7 @@ def run():
),
},
{ # setup.py script that constructs temp files to be included in the distribution
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
# Some packages construct files on the fly, include them in the package,
# and immediately remove them after `setup()` (e.g. pybind11==2.9.1).
@@ -182,7 +182,7 @@ def run():
),
},
{ # setup.cfg only
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
name = foo
@@ -193,7 +193,7 @@ def run():
setup_requires=six
"""
),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -201,7 +201,7 @@ def run():
),
},
{ # setup.cfg and setup.py
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
name = foo
@@ -212,8 +212,8 @@ def run():
setup_requires=six
"""
),
- 'setup.py': "__import__('setuptools').setup()",
- 'hello.py': DALS(
+ "setup.py": "__import__('setuptools').setup()",
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -224,7 +224,7 @@ def run():
class TestBuildMetaBackend:
- backend_name = 'setuptools.build_meta'
+ backend_name = "setuptools.build_meta"
def get_build_backend(self):
return BuildBackend(backend_name=self.backend_name)
@@ -237,16 +237,16 @@ def build_backend(self, tmpdir, request):
def test_get_requires_for_build_wheel(self, build_backend):
actual = build_backend.get_requires_for_build_wheel()
- expected = ['six']
+ expected = ["six"]
assert sorted(actual) == sorted(expected)
def test_get_requires_for_build_sdist(self, build_backend):
actual = build_backend.get_requires_for_build_sdist()
- expected = ['six']
+ expected = ["six"]
assert sorted(actual) == sorted(expected)
def test_build_wheel(self, build_backend):
- dist_dir = os.path.abspath('pip-wheel')
+ dist_dir = os.path.abspath("pip-wheel")
os.makedirs(dist_dir)
wheel_name = build_backend.build_wheel(dist_dir)
@@ -254,32 +254,32 @@ def test_build_wheel(self, build_backend):
assert os.path.isfile(wheel_file)
# Temporary files should be removed
- assert not os.path.isfile('world.py')
+ assert not os.path.isfile("world.py")
with ZipFile(wheel_file) as zipfile:
wheel_contents = set(zipfile.namelist())
# Each one of the examples have a single module
# that should be included in the distribution
- python_scripts = (f for f in wheel_contents if f.endswith('.py'))
- modules = [f for f in python_scripts if not f.endswith('setup.py')]
+ python_scripts = (f for f in wheel_contents if f.endswith(".py"))
+ modules = [f for f in python_scripts if not f.endswith("setup.py")]
assert len(modules) == 1
- @pytest.mark.parametrize('build_type', ('wheel', 'sdist'))
+ @pytest.mark.parametrize("build_type", ("wheel", "sdist"))
def test_build_with_existing_file_present(self, build_type, tmpdir_cwd):
# Building a sdist/wheel should still succeed if there's
# already a sdist/wheel in the destination directory.
files = {
- 'setup.py': "from setuptools import setup\nsetup()",
- 'VERSION': "0.0.1",
- 'setup.cfg': DALS(
+ "setup.py": "from setuptools import setup\nsetup()",
+ "VERSION": "0.0.1",
+ "setup.cfg": DALS(
"""
[metadata]
name = foo
version = file: VERSION
"""
),
- 'pyproject.toml': DALS(
+ "pyproject.toml": DALS(
"""
[build-system]
requires = ["setuptools", "wheel"]
@@ -290,10 +290,10 @@ def test_build_with_existing_file_present(self, build_type, tmpdir_cwd):
path.build(files)
- dist_dir = os.path.abspath('preexisting-' + build_type)
+ dist_dir = os.path.abspath("preexisting-" + build_type)
build_backend = self.get_build_backend()
- build_method = getattr(build_backend, 'build_' + build_type)
+ build_method = getattr(build_backend, "build_" + build_type)
# Build a first sdist/wheel.
# Note: this also check the destination directory is
@@ -311,7 +311,7 @@ def test_build_with_existing_file_present(self, build_type, tmpdir_cwd):
assert first_result != second_result
# And if rebuilding the exact same sdist/wheel?
- open(os.path.join(dist_dir, second_result), 'wb').close()
+ open(os.path.join(dist_dir, second_result), "wb").close()
third_result = build_method(dist_dir)
assert third_result == second_result
assert os.path.getsize(os.path.join(dist_dir, third_result)) > 0
@@ -319,7 +319,7 @@ def test_build_with_existing_file_present(self, build_type, tmpdir_cwd):
@pytest.mark.parametrize("setup_script", [None, SETUP_SCRIPT_STUB])
def test_build_with_pyproject_config(self, tmpdir, setup_script):
files = {
- 'pyproject.toml': DALS(
+ "pyproject.toml": DALS(
"""
[build-system]
requires = ["setuptools", "wheel"]
@@ -409,28 +409,28 @@ def test_build_with_pyproject_config(self, tmpdir, setup_script):
epoints = str(zipfile.read("foo-0.1.dist-info/entry_points.txt"), "utf-8")
assert sdist_contents - {"foo-0.1/setup.py"} == {
- 'foo-0.1',
- 'foo-0.1/LICENSE.txt',
- 'foo-0.1/MANIFEST.in',
- 'foo-0.1/PKG-INFO',
- 'foo-0.1/README.rst',
- 'foo-0.1/pyproject.toml',
- 'foo-0.1/setup.cfg',
- 'foo-0.1/src',
- 'foo-0.1/src/foo',
- 'foo-0.1/src/foo/__init__.py',
- 'foo-0.1/src/foo/__init__.pyi',
- 'foo-0.1/src/foo/cli.py',
- 'foo-0.1/src/foo/data.txt',
- 'foo-0.1/src/foo/py.typed',
- 'foo-0.1/src/foo.egg-info',
- 'foo-0.1/src/foo.egg-info/PKG-INFO',
- 'foo-0.1/src/foo.egg-info/SOURCES.txt',
- 'foo-0.1/src/foo.egg-info/dependency_links.txt',
- 'foo-0.1/src/foo.egg-info/entry_points.txt',
- 'foo-0.1/src/foo.egg-info/requires.txt',
- 'foo-0.1/src/foo.egg-info/top_level.txt',
- 'foo-0.1/src/foo.egg-info/not-zip-safe',
+ "foo-0.1",
+ "foo-0.1/LICENSE.txt",
+ "foo-0.1/MANIFEST.in",
+ "foo-0.1/PKG-INFO",
+ "foo-0.1/README.rst",
+ "foo-0.1/pyproject.toml",
+ "foo-0.1/setup.cfg",
+ "foo-0.1/src",
+ "foo-0.1/src/foo",
+ "foo-0.1/src/foo/__init__.py",
+ "foo-0.1/src/foo/__init__.pyi",
+ "foo-0.1/src/foo/cli.py",
+ "foo-0.1/src/foo/data.txt",
+ "foo-0.1/src/foo/py.typed",
+ "foo-0.1/src/foo.egg-info",
+ "foo-0.1/src/foo.egg-info/PKG-INFO",
+ "foo-0.1/src/foo.egg-info/SOURCES.txt",
+ "foo-0.1/src/foo.egg-info/dependency_links.txt",
+ "foo-0.1/src/foo.egg-info/entry_points.txt",
+ "foo-0.1/src/foo.egg-info/requires.txt",
+ "foo-0.1/src/foo.egg-info/top_level.txt",
+ "foo-0.1/src/foo.egg-info/not-zip-safe",
}
assert wheel_contents == {
"foo/__init__.py",
@@ -466,7 +466,7 @@ def test_static_metadata_in_pyproject_config(self, tmpdir):
# Make sure static metadata in pyproject.toml is not overwritten by setup.py
# as required by PEP 621
files = {
- 'pyproject.toml': DALS(
+ "pyproject.toml": DALS(
"""
[build-system]
requires = ["setuptools", "wheel"]
@@ -479,13 +479,13 @@ def test_static_metadata_in_pyproject_config(self, tmpdir):
dependencies = ["six"]
"""
),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
"""
),
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
__import__('setuptools').setup(
name='bar',
@@ -510,7 +510,7 @@ def run():
assert not (tmpdir / "temp/foo-13-py3-none-any.whl").exists()
with tarfile.open(os.path.join(tmpdir, "temp", sdist_path)) as tar:
- pkg_info = str(tar.extractfile('foo-42/PKG-INFO').read(), "utf-8")
+ pkg_info = str(tar.extractfile("foo-42/PKG-INFO").read(), "utf-8")
members = tar.getnames()
assert "bar-13/PKG-INFO" not in members
@@ -526,19 +526,19 @@ def run():
assert line not in file
def test_build_sdist(self, build_backend):
- dist_dir = os.path.abspath('pip-sdist')
+ dist_dir = os.path.abspath("pip-sdist")
os.makedirs(dist_dir)
sdist_name = build_backend.build_sdist(dist_dir)
assert os.path.isfile(os.path.join(dist_dir, sdist_name))
def test_prepare_metadata_for_build_wheel(self, build_backend):
- dist_dir = os.path.abspath('pip-dist-info')
+ dist_dir = os.path.abspath("pip-dist-info")
os.makedirs(dist_dir)
dist_info = build_backend.prepare_metadata_for_build_wheel(dist_dir)
- assert os.path.isfile(os.path.join(dist_dir, dist_info, 'METADATA'))
+ assert os.path.isfile(os.path.join(dist_dir, dist_info, "METADATA"))
def test_prepare_metadata_inplace(self, build_backend):
"""
@@ -555,12 +555,12 @@ def test_prepare_metadata_inplace(self, build_backend):
]:
os.makedirs(pre_existing, exist_ok=True)
dist_info = build_backend.prepare_metadata_for_build_wheel(".")
- assert os.path.isfile(os.path.join(dist_info, 'METADATA'))
+ assert os.path.isfile(os.path.join(dist_info, "METADATA"))
def test_build_sdist_explicit_dist(self, build_backend):
# explicitly specifying the dist folder should work
# the folder sdist_directory and the ``--dist-dir`` can be the same
- dist_dir = os.path.abspath('dist')
+ dist_dir = os.path.abspath("dist")
sdist_name = build_backend.build_sdist(dist_dir)
assert os.path.isfile(os.path.join(dist_dir, sdist_name))
@@ -578,9 +578,9 @@ def test_build_sdist_version_change(self, build_backend):
if not os.path.exists(setup_loc):
setup_loc = os.path.abspath("setup.cfg")
- with open(setup_loc, 'rt', encoding="utf-8") as file_handler:
+ with open(setup_loc, "rt", encoding="utf-8") as file_handler:
content = file_handler.read()
- with open(setup_loc, 'wt', encoding="utf-8") as file_handler:
+ with open(setup_loc, "wt", encoding="utf-8") as file_handler:
file_handler.write(content.replace("version='0.0.0'", "version='0.0.1'"))
shutil.rmtree(sdist_into_directory)
@@ -591,7 +591,7 @@ def test_build_sdist_version_change(self, build_backend):
def test_build_sdist_pyproject_toml_exists(self, tmpdir_cwd):
files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
__import__('setuptools').setup(
name='foo',
@@ -599,8 +599,8 @@ def test_build_sdist_pyproject_toml_exists(self, tmpdir_cwd):
py_modules=['hello']
)"""
),
- 'hello.py': '',
- 'pyproject.toml': DALS(
+ "hello.py": "",
+ "pyproject.toml": DALS(
"""
[build-system]
requires = ["setuptools", "wheel"]
@@ -612,7 +612,7 @@ def test_build_sdist_pyproject_toml_exists(self, tmpdir_cwd):
build_backend = self.get_build_backend()
targz_path = build_backend.build_sdist("temp")
with tarfile.open(os.path.join("temp", targz_path)) as tar:
- assert any('pyproject.toml' in name for name in tar.getnames())
+ assert any("pyproject.toml" in name for name in tar.getnames())
def test_build_sdist_setup_py_exists(self, tmpdir_cwd):
# If build_sdist is called from a script other than setup.py,
@@ -622,12 +622,12 @@ def test_build_sdist_setup_py_exists(self, tmpdir_cwd):
build_backend = self.get_build_backend()
targz_path = build_backend.build_sdist("temp")
with tarfile.open(os.path.join("temp", targz_path)) as tar:
- assert any('setup.py' in name for name in tar.getnames())
+ assert any("setup.py" in name for name in tar.getnames())
def test_build_sdist_setup_py_manifest_excluded(self, tmpdir_cwd):
# Ensure that MANIFEST.in can exclude setup.py
files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
__import__('setuptools').setup(
name='foo',
@@ -635,8 +635,8 @@ def test_build_sdist_setup_py_manifest_excluded(self, tmpdir_cwd):
py_modules=['hello']
)"""
),
- 'hello.py': '',
- 'MANIFEST.in': DALS(
+ "hello.py": "",
+ "MANIFEST.in": DALS(
"""
exclude setup.py
"""
@@ -648,11 +648,11 @@ def test_build_sdist_setup_py_manifest_excluded(self, tmpdir_cwd):
build_backend = self.get_build_backend()
targz_path = build_backend.build_sdist("temp")
with tarfile.open(os.path.join("temp", targz_path)) as tar:
- assert not any('setup.py' in name for name in tar.getnames())
+ assert not any("setup.py" in name for name in tar.getnames())
def test_build_sdist_builds_targz_even_if_zip_indicated(self, tmpdir_cwd):
files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
__import__('setuptools').setup(
name='foo',
@@ -660,8 +660,8 @@ def test_build_sdist_builds_targz_even_if_zip_indicated(self, tmpdir_cwd):
py_modules=['hello']
)"""
),
- 'hello.py': '',
- 'setup.cfg': DALS(
+ "hello.py": "",
+ "setup.cfg": DALS(
"""
[sdist]
formats=zip
@@ -675,7 +675,7 @@ def test_build_sdist_builds_targz_even_if_zip_indicated(self, tmpdir_cwd):
build_backend.build_sdist("temp")
_relative_path_import_files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
__import__('setuptools').setup(
name='foo',
@@ -683,8 +683,8 @@ def test_build_sdist_builds_targz_even_if_zip_indicated(self, tmpdir_cwd):
py_modules=['hello']
)"""
),
- 'hello.py': '__version__ = "0.0.0"',
- 'setup.cfg': DALS(
+ "hello.py": '__version__ = "0.0.0"',
+ "setup.cfg": DALS(
"""
[sdist]
formats=zip
@@ -742,7 +742,7 @@ def test_build_wheel_inplace(self, tmpdir_cwd):
@pytest.mark.parametrize("config_settings", [{"editable-mode": "strict"}])
def test_editable_with_config_settings(self, tmpdir_cwd, config_settings):
- path.build({**self._simple_pyproject_example, '_meta': {}})
+ path.build({**self._simple_pyproject_example, "_meta": {}})
assert not Path("build").exists()
build_backend = self.get_build_backend()
build_backend.prepare_metadata_for_build_editable("_meta", config_settings)
@@ -752,23 +752,23 @@ def test_editable_with_config_settings(self, tmpdir_cwd, config_settings):
@pytest.mark.parametrize(
("setup_literal", "requirements"),
[
- ("'foo'", ['foo']),
- ("['foo']", ['foo']),
- (r"'foo\n'", ['foo']),
- (r"'foo\n\n'", ['foo']),
- ("['foo', 'bar']", ['foo', 'bar']),
- (r"'# Has a comment line\nfoo'", ['foo']),
- (r"'foo # Has an inline comment'", ['foo']),
- (r"'foo \\\n >=3.0'", ['foo>=3.0']),
- (r"'foo\nbar'", ['foo', 'bar']),
- (r"'foo\nbar\n'", ['foo', 'bar']),
- (r"['foo\n', 'bar\n']", ['foo', 'bar']),
+ ("'foo'", ["foo"]),
+ ("['foo']", ["foo"]),
+ (r"'foo\n'", ["foo"]),
+ (r"'foo\n\n'", ["foo"]),
+ ("['foo', 'bar']", ["foo", "bar"]),
+ (r"'# Has a comment line\nfoo'", ["foo"]),
+ (r"'foo # Has an inline comment'", ["foo"]),
+ (r"'foo \\\n >=3.0'", ["foo>=3.0"]),
+ (r"'foo\nbar'", ["foo", "bar"]),
+ (r"'foo\nbar\n'", ["foo", "bar"]),
+ (r"['foo\n', 'bar\n']", ["foo", "bar"]),
],
)
- @pytest.mark.parametrize('use_wheel', [True, False])
+ @pytest.mark.parametrize("use_wheel", [True, False])
def test_setup_requires(self, setup_literal, requirements, use_wheel, tmpdir_cwd):
files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
from setuptools import setup
@@ -780,7 +780,7 @@ def test_setup_requires(self, setup_literal, requirements, use_wheel, tmpdir_cwd
)
"""
).format(setup_literal=setup_literal),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -808,7 +808,7 @@ def test_setup_requires_with_auto_discovery(self, tmpdir_cwd):
# activate auto-discovery and cause problems due to the incomplete set of
# attributes passed to MinimalDistribution
files = {
- 'pyproject.toml': DALS(
+ "pyproject.toml": DALS(
"""
[project]
name = "proj"
@@ -823,8 +823,8 @@ def test_setup_requires_with_auto_discovery(self, tmpdir_cwd):
)
"""
),
- 'hello.py': "'hello'",
- 'world.py': "'world'",
+ "hello.py": "'hello'",
+ "world.py": "'world'",
}
path.build(files)
build_backend = self.get_build_backend()
@@ -833,7 +833,7 @@ def test_setup_requires_with_auto_discovery(self, tmpdir_cwd):
def test_dont_install_setup_requires(self, tmpdir_cwd):
files = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
from setuptools import setup
@@ -845,7 +845,7 @@ def test_dont_install_setup_requires(self, tmpdir_cwd):
)
"""
),
- 'hello.py': DALS(
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -857,7 +857,7 @@ def run():
build_backend = self.get_build_backend()
- dist_dir = os.path.abspath('pip-dist-info')
+ dist_dir = os.path.abspath("pip-dist-info")
os.makedirs(dist_dir)
# does-not-exist can't be satisfied, so if it attempts to install
@@ -865,7 +865,7 @@ def run():
build_backend.prepare_metadata_for_build_wheel(dist_dir)
_sys_argv_0_passthrough = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
import os
import sys
@@ -889,7 +889,7 @@ def test_sys_argv_passthrough(self, tmpdir_cwd):
build_backend.build_sdist("temp")
_setup_py_file_abspath = {
- 'setup.py': DALS(
+ "setup.py": DALS(
"""
import os
assert os.path.isabs(__file__)
@@ -908,18 +908,18 @@ def test_setup_py_file_abspath(self, tmpdir_cwd):
build_backend = self.get_build_backend()
build_backend.build_sdist("temp")
- @pytest.mark.parametrize('build_hook', ('build_sdist', 'build_wheel'))
+ @pytest.mark.parametrize("build_hook", ("build_sdist", "build_wheel"))
def test_build_with_empty_setuppy(self, build_backend, build_hook):
- files = {'setup.py': ''}
+ files = {"setup.py": ""}
path.build(files)
- msg = re.escape('No distribution was found.')
+ msg = re.escape("No distribution was found.")
with pytest.raises(ValueError, match=msg):
getattr(build_backend, build_hook)("temp")
class TestBuildMetaLegacyBackend(TestBuildMetaBackend):
- backend_name = 'setuptools.build_meta:__legacy__'
+ backend_name = "setuptools.build_meta:__legacy__"
# build_meta_legacy-specific tests
def test_build_sdist_relative_path_import(self, tmpdir_cwd):
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_py.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_py.py
index 1e3a6608..b83147b5 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_build_py.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_build_py.py
@@ -23,13 +23,13 @@ def test_directories_in_package_data_glob(tmpdir_cwd):
"""
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['build_py'],
- packages=[''],
- package_data={'': ['path/*']},
+ script_name="setup.py",
+ script_args=["build_py"],
+ packages=[""],
+ package_data={"": ["path/*"]},
)
)
- os.makedirs('path/subpath')
+ os.makedirs("path/subpath")
dist.parse_command_line()
dist.run_commands()
@@ -43,19 +43,19 @@ def test_recursive_in_package_data_glob(tmpdir_cwd):
"""
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['build_py'],
- packages=[''],
- package_data={'': ['path/**/data']},
+ script_name="setup.py",
+ script_args=["build_py"],
+ packages=[""],
+ package_data={"": ["path/**/data"]},
)
)
- os.makedirs('path/subpath/subsubpath')
- open('path/subpath/subsubpath/data', 'wb').close()
+ os.makedirs("path/subpath/subsubpath")
+ open("path/subpath/subsubpath/data", "wb").close()
dist.parse_command_line()
dist.run_commands()
- assert stat.S_ISREG(os.stat('build/lib/path/subpath/subsubpath/data').st_mode), (
+ assert stat.S_ISREG(os.stat("build/lib/path/subpath/subsubpath/data").st_mode), (
"File is not included"
)
@@ -71,20 +71,20 @@ def test_read_only(tmpdir_cwd):
"""
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['build_py'],
- packages=['pkg'],
- package_data={'pkg': ['data.dat']},
+ script_name="setup.py",
+ script_args=["build_py"],
+ packages=["pkg"],
+ package_data={"pkg": ["data.dat"]},
)
)
- os.makedirs('pkg')
- open('pkg/__init__.py', 'wb').close()
- open('pkg/data.dat', 'wb').close()
- os.chmod('pkg/__init__.py', stat.S_IREAD)
- os.chmod('pkg/data.dat', stat.S_IREAD)
+ os.makedirs("pkg")
+ open("pkg/__init__.py", "wb").close()
+ open("pkg/data.dat", "wb").close()
+ os.chmod("pkg/__init__.py", stat.S_IREAD)
+ os.chmod("pkg/data.dat", stat.S_IREAD)
dist.parse_command_line()
dist.run_commands()
- shutil.rmtree('build')
+ shutil.rmtree("build")
@pytest.mark.xfail(
@@ -102,21 +102,21 @@ def test_executable_data(tmpdir_cwd):
"""
dist = Distribution(
dict(
- script_name='setup.py',
- script_args=['build_py'],
- packages=['pkg'],
- package_data={'pkg': ['run-me']},
+ script_name="setup.py",
+ script_args=["build_py"],
+ packages=["pkg"],
+ package_data={"pkg": ["run-me"]},
)
)
- os.makedirs('pkg')
- open('pkg/__init__.py', 'wb').close()
- open('pkg/run-me', 'wb').close()
- os.chmod('pkg/run-me', 0o700)
+ os.makedirs("pkg")
+ open("pkg/__init__.py", "wb").close()
+ open("pkg/run-me", "wb").close()
+ os.chmod("pkg/run-me", 0o700)
dist.parse_command_line()
dist.run_commands()
- assert os.stat('build/lib/pkg/run-me').st_mode & stat.S_IEXEC, (
+ assert os.stat("build/lib/pkg/run-me").st_mode & stat.S_IEXEC, (
"Script is not executable"
)
@@ -230,7 +230,7 @@ def test_existing_egg_info(tmpdir_cwd, monkeypatch):
# == Remove caches ==
# egg_info is called when build_py looks for data_files, which gets cached.
# We need to ensure it is not cached yet, otherwise it may impact on the tests
- build_py.__dict__.pop('data_files', None)
+ build_py.__dict__.pop("data_files", None)
dist.reinitialize_command(egg_info)
# == Sanity check ==
@@ -241,7 +241,7 @@ def test_existing_egg_info(tmpdir_cwd, monkeypatch):
# == Remove caches ==
egg_info_run.reset_mock()
- build_py.__dict__.pop('data_files', None)
+ build_py.__dict__.pop("data_files", None)
dist.reinitialize_command(egg_info)
# == Actual test ==
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_config_discovery.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_config_discovery.py
index b5df8203..468cfc29 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_config_discovery.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_config_discovery.py
@@ -103,12 +103,12 @@ def test_project(self, tmp_path, circumstance):
sdist_files = get_sdist_members(next(tmp_path.glob("dist/*.tar.gz")))
print("~~~~~ sdist_members ~~~~~")
- print('\n'.join(sdist_files))
+ print("\n".join(sdist_files))
assert sdist_files >= set(files)
wheel_files = get_wheel_members(next(tmp_path.glob("dist/*.whl")))
print("~~~~~ wheel_members ~~~~~")
- print('\n'.join(wheel_files))
+ print("\n".join(wheel_files))
orig_files = {f.replace("src/", "").replace("lib/", "") for f in files}
assert wheel_files >= orig_files
@@ -499,12 +499,12 @@ def test_include_package_data(self, tmp_path, src_root, files):
sdist_files = get_sdist_members(next(tmp_path.glob("dist/*.tar.gz")))
print("~~~~~ sdist_members ~~~~~")
- print('\n'.join(sdist_files))
+ print("\n".join(sdist_files))
assert sdist_files >= expected
wheel_files = get_wheel_members(next(tmp_path.glob("dist/*.whl")))
print("~~~~~ wheel_members ~~~~~")
- print('\n'.join(wheel_files))
+ print("\n".join(wheel_files))
orig_files = {f.replace("src/", "").replace("lib/", "") for f in expected}
assert wheel_files >= orig_files
@@ -610,17 +610,17 @@ def _write_setupcfg(root, options):
def _run_build(path, *flags):
cmd = [sys.executable, "-m", "build", "--no-isolation", *flags, str(path)]
- return run(cmd, env={'DISTUTILS_DEBUG': ''})
+ return run(cmd, env={"DISTUTILS_DEBUG": ""})
def _get_dist(dist_path, attrs):
root = "/".join(os.path.split(dist_path)) # POSIX-style
- script = dist_path / 'setup.py'
+ script = dist_path / "setup.py"
if script.exists():
with Path(dist_path):
dist = cast(
- Distribution,
+ "Distribution",
distutils.core.run_setup("setup.py", {}, stop_after="init"),
)
else:
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_core_metadata.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_core_metadata.py
index 0d925111..d7b7ad9e 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_core_metadata.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_core_metadata.py
@@ -76,93 +76,93 @@ def __read_test_cases():
params = functools.partial(dict, base)
return [
- ('Metadata version 1.0', params()),
+ ("Metadata version 1.0", params()),
(
- 'Metadata Version 1.0: Short long description',
+ "Metadata Version 1.0: Short long description",
params(
- long_description='Short long description',
+ long_description="Short long description",
),
),
(
- 'Metadata version 1.1: Classifiers',
+ "Metadata version 1.1: Classifiers",
params(
classifiers=[
- 'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.7',
- 'License :: OSI Approved :: MIT License',
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.7",
+ "License :: OSI Approved :: MIT License",
],
),
),
(
- 'Metadata version 1.1: Download URL',
+ "Metadata version 1.1: Download URL",
params(
- download_url='https://example.com',
+ download_url="https://example.com",
),
),
(
- 'Metadata Version 1.2: Requires-Python',
+ "Metadata Version 1.2: Requires-Python",
params(
- python_requires='>=3.7',
+ python_requires=">=3.7",
),
),
pytest.param(
- 'Metadata Version 1.2: Project-Url',
- params(project_urls=dict(Foo='https://example.bar')),
+ "Metadata Version 1.2: Project-Url",
+ params(project_urls=dict(Foo="https://example.bar")),
marks=pytest.mark.xfail(
reason="Issue #1578: project_urls not read",
),
),
(
- 'Metadata Version 2.1: Long Description Content Type',
+ "Metadata Version 2.1: Long Description Content Type",
params(
- long_description_content_type='text/x-rst; charset=UTF-8',
+ long_description_content_type="text/x-rst; charset=UTF-8",
),
),
(
- 'License',
+ "License",
params(
- license='MIT',
+ license="MIT",
),
),
(
- 'License multiline',
+ "License multiline",
params(
- license='This is a long license \nover multiple lines',
+ license="This is a long license \nover multiple lines",
),
),
pytest.param(
- 'Metadata Version 2.1: Provides Extra',
- params(provides_extras=['foo', 'bar']),
+ "Metadata Version 2.1: Provides Extra",
+ params(provides_extras=["foo", "bar"]),
marks=pytest.mark.xfail(reason="provides_extras not read"),
),
(
- 'Missing author',
+ "Missing author",
dict(
- name='foo',
- version='1.0.0',
- author_email='snorri@sturluson.name',
+ name="foo",
+ version="1.0.0",
+ author_email="snorri@sturluson.name",
),
),
(
- 'Missing author e-mail',
+ "Missing author e-mail",
dict(
- name='foo',
- version='1.0.0',
- author='Snorri Sturluson',
+ name="foo",
+ version="1.0.0",
+ author="Snorri Sturluson",
),
),
(
- 'Missing author and e-mail',
+ "Missing author and e-mail",
dict(
- name='foo',
- version='1.0.0',
+ name="foo",
+ version="1.0.0",
),
),
(
- 'Bypass normalized version',
+ "Bypass normalized version",
dict(
- name='foo',
- version=sic('1.0.0a'),
+ name="foo",
+ version=sic("1.0.0a"),
),
),
]
@@ -187,22 +187,22 @@ def test_read_metadata(name, attrs):
metadata_in.read_pkg_file(PKG_INFO)
tested_attrs = [
- ('name', dist_class.get_name),
- ('version', dist_class.get_version),
- ('author', dist_class.get_contact),
- ('author_email', dist_class.get_contact_email),
- ('metadata_version', dist_class.get_metadata_version),
- ('provides', dist_class.get_provides),
- ('description', dist_class.get_description),
- ('long_description', dist_class.get_long_description),
- ('download_url', dist_class.get_download_url),
- ('keywords', dist_class.get_keywords),
- ('platforms', dist_class.get_platforms),
- ('obsoletes', dist_class.get_obsoletes),
- ('requires', dist_class.get_requires),
- ('classifiers', dist_class.get_classifiers),
- ('project_urls', lambda s: getattr(s, 'project_urls', {})),
- ('provides_extras', lambda s: getattr(s, 'provides_extras', {})),
+ ("name", dist_class.get_name),
+ ("version", dist_class.get_version),
+ ("author", dist_class.get_contact),
+ ("author_email", dist_class.get_contact_email),
+ ("metadata_version", dist_class.get_metadata_version),
+ ("provides", dist_class.get_provides),
+ ("description", dist_class.get_description),
+ ("long_description", dist_class.get_long_description),
+ ("download_url", dist_class.get_download_url),
+ ("keywords", dist_class.get_keywords),
+ ("platforms", dist_class.get_platforms),
+ ("obsoletes", dist_class.get_obsoletes),
+ ("requires", dist_class.get_requires),
+ ("classifiers", dist_class.get_classifiers),
+ ("project_urls", lambda s: getattr(s, "project_urls", {})),
+ ("provides_extras", lambda s: getattr(s, "provides_extras", {})),
]
for attr, getter in tested_attrs:
@@ -219,81 +219,81 @@ def merge_dicts(d1, d2):
return d1
return [
- ('No author, no maintainer', attrs.copy()),
+ ("No author, no maintainer", attrs.copy()),
(
- 'Author (no e-mail), no maintainer',
- merge_dicts(attrs, {'author': 'Author Name'}),
+ "Author (no e-mail), no maintainer",
+ merge_dicts(attrs, {"author": "Author Name"}),
),
(
- 'Author (e-mail), no maintainer',
+ "Author (e-mail), no maintainer",
merge_dicts(
- attrs, {'author': 'Author Name', 'author_email': 'author@name.com'}
+ attrs, {"author": "Author Name", "author_email": "author@name.com"}
),
),
(
- 'No author, maintainer (no e-mail)',
- merge_dicts(attrs, {'maintainer': 'Maintainer Name'}),
+ "No author, maintainer (no e-mail)",
+ merge_dicts(attrs, {"maintainer": "Maintainer Name"}),
),
(
- 'No author, maintainer (e-mail)',
+ "No author, maintainer (e-mail)",
merge_dicts(
attrs,
{
- 'maintainer': 'Maintainer Name',
- 'maintainer_email': 'maintainer@name.com',
+ "maintainer": "Maintainer Name",
+ "maintainer_email": "maintainer@name.com",
},
),
),
(
- 'Author (no e-mail), Maintainer (no-email)',
+ "Author (no e-mail), Maintainer (no-email)",
merge_dicts(
- attrs, {'author': 'Author Name', 'maintainer': 'Maintainer Name'}
+ attrs, {"author": "Author Name", "maintainer": "Maintainer Name"}
),
),
(
- 'Author (e-mail), Maintainer (e-mail)',
+ "Author (e-mail), Maintainer (e-mail)",
merge_dicts(
attrs,
{
- 'author': 'Author Name',
- 'author_email': 'author@name.com',
- 'maintainer': 'Maintainer Name',
- 'maintainer_email': 'maintainer@name.com',
+ "author": "Author Name",
+ "author_email": "author@name.com",
+ "maintainer": "Maintainer Name",
+ "maintainer_email": "maintainer@name.com",
},
),
),
(
- 'No author (e-mail), no maintainer (e-mail)',
+ "No author (e-mail), no maintainer (e-mail)",
merge_dicts(
attrs,
{
- 'author_email': 'author@name.com',
- 'maintainer_email': 'maintainer@name.com',
+ "author_email": "author@name.com",
+ "maintainer_email": "maintainer@name.com",
},
),
),
- ('Author unicode', merge_dicts(attrs, {'author': '鉄沢寛'})),
- ('Maintainer unicode', merge_dicts(attrs, {'maintainer': 'Jan Łukasiewicz'})),
+ ("Author unicode", merge_dicts(attrs, {"author": "鉄沢寛"})),
+ ("Maintainer unicode", merge_dicts(attrs, {"maintainer": "Jan Łukasiewicz"})),
]
@pytest.mark.parametrize(("name", "attrs"), __maintainer_test_cases())
def test_maintainer_author(name, attrs, tmpdir):
tested_keys = {
- 'author': 'Author',
- 'author_email': 'Author-email',
- 'maintainer': 'Maintainer',
- 'maintainer_email': 'Maintainer-email',
+ "author": "Author",
+ "author_email": "Author-email",
+ "maintainer": "Maintainer",
+ "maintainer_email": "Maintainer-email",
}
# Generate a PKG-INFO file
dist = Distribution(attrs)
- fn = tmpdir.mkdir('pkg_info')
+ fn = tmpdir.mkdir("pkg_info")
fn_s = str(fn)
dist.metadata.write_pkg_info(fn_s)
- with open(str(fn.join('PKG-INFO')), 'r', encoding='utf-8') as f:
+ with open(str(fn.join("PKG-INFO")), "r", encoding="utf-8") as f:
pkg_info = f.read()
assert _valid_metadata(pkg_info)
@@ -311,9 +311,9 @@ def test_maintainer_author(name, attrs, tmpdir):
val = attrs.get(dkey, None)
if val is None:
for line in pkg_lines:
- assert not line.startswith(fkey + ':')
+ assert not line.startswith(fkey + ":")
else:
- line = f'{fkey}: {val}'
+ line = f"{fkey}: {val}"
assert line in pkg_lines_set
@@ -353,10 +353,10 @@ def test_requires_dist(self, tmp_path):
# Ensure Requires-Dist is present
expected = [
- 'Metadata-Version:',
- 'Requires-Python: >=3.8',
- 'Provides-Extra: other',
- 'Provides-Extra: testing',
+ "Metadata-Version:",
+ "Requires-Python: >=3.8",
+ "Provides-Extra: other",
+ "Provides-Extra: testing",
'Requires-Dist: tomli; python_version < "3.11" and extra == "testing"',
'Requires-Dist: more-itertools==8.8.0; extra == "other"',
'Requires-Dist: ini2toml[lite]>=0.9; extra == "testing"',
@@ -525,8 +525,8 @@ def test_license_files_dynamic(self, extra_toml, tmpdir_cwd):
dist = _makedist(license_expression="AGPL-3.0-or-later")
metadata = _get_metadata(dist)
assert set(metadata.get_all("Dynamic")) == {
- 'license-file',
- 'license-expression',
+ "license-file",
+ "license-expression",
}
assert metadata.get("License-Expression") == "AGPL-3.0-or-later"
assert set(metadata.get_all("License-File")) == {
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_depends.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_depends.py
index 1714c041..638e2283 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_depends.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_depends.py
@@ -9,7 +9,7 @@ def test_basic(self):
Invoke get_module_constant on a module in
the test package.
"""
- mod_name = 'setuptools.tests.mod_with_constant'
- val = depends.get_module_constant(mod_name, 'value')
- assert val == 'three, sir!'
- assert 'setuptools.tests.mod_with_constant' not in sys.modules
+ mod_name = "setuptools.tests.mod_with_constant"
+ val = depends.get_module_constant(mod_name, "value")
+ assert val == "three, sir!"
+ assert "setuptools.tests.mod_with_constant" not in sys.modules
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_develop.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_develop.py
index 354c51fc..18e93495 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_develop.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_develop.py
@@ -27,22 +27,22 @@
def temp_user(monkeypatch):
with contexts.tempdir() as user_base:
with contexts.tempdir() as user_site:
- monkeypatch.setattr('site.USER_BASE', user_base)
- monkeypatch.setattr('site.USER_SITE', user_site)
+ monkeypatch.setattr("site.USER_BASE", user_base)
+ monkeypatch.setattr("site.USER_SITE", user_site)
yield
@pytest.fixture
def test_env(tmpdir, temp_user):
target = tmpdir
- foo = target.mkdir('foo')
- setup = target / 'setup.py'
+ foo = target.mkdir("foo")
+ setup = target / "setup.py"
if setup.isfile():
raise ValueError(dir(target))
- with setup.open('w') as f:
+ with setup.open("w") as f:
f.write(SETUP_PY)
- init = foo / '__init__.py'
- with init.open('w') as f:
+ init = foo / "__init__.py"
+ with init.open("w") as f:
f.write(INIT_PY)
with target.as_cwd():
yield target
@@ -53,9 +53,9 @@ class TestNamespaces:
def install_develop(src_dir, target):
develop_cmd = [
sys.executable,
- 'setup.py',
- 'develop',
- '--install-dir',
+ "setup.py",
+ "develop",
+ "--install-dir",
str(target),
]
with src_dir.as_cwd():
@@ -67,7 +67,7 @@ def install_develop(src_dir, target):
reason="https://github.com/pypa/setuptools/issues/851",
)
@pytest.mark.skipif(
- platform.python_implementation() == 'PyPy',
+ platform.python_implementation() == "PyPy",
reason="https://github.com/pypa/setuptools/issues/1202",
)
@pytest.mark.uses_network
@@ -78,17 +78,17 @@ def test_namespace_package_importable(self, tmpdir):
and the other installed using `develop` should leave the namespace
in tact and both packages reachable by import.
"""
- pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
- pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
- target = tmpdir / 'packages'
+ pkg_A = namespaces.build_namespace_package(tmpdir, "myns.pkgA")
+ pkg_B = namespaces.build_namespace_package(tmpdir, "myns.pkgB")
+ target = tmpdir / "packages"
# use pip to install to the target directory
install_cmd = [
sys.executable,
- '-m',
- 'pip',
- 'install',
+ "-m",
+ "pip",
+ "install",
str(pkg_A),
- '-t',
+ "-t",
str(target),
]
subprocess.check_call(install_cmd)
@@ -96,8 +96,8 @@ def test_namespace_package_importable(self, tmpdir):
namespaces.make_site_dir(target)
try_import = [
sys.executable,
- '-c',
- 'import myns.pkgA; import myns.pkgB',
+ "-c",
+ "import myns.pkgA; import myns.pkgB",
]
with paths_on_pythonpath([str(target)]):
subprocess.check_call(try_import)
@@ -105,8 +105,8 @@ def test_namespace_package_importable(self, tmpdir):
# additionally ensure that pkg_resources import works
pkg_resources_imp = [
sys.executable,
- '-c',
- 'import pkg_resources',
+ "-c",
+ "import pkg_resources",
]
with paths_on_pythonpath([str(target)]):
subprocess.check_call(pkg_resources_imp)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_dist.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_dist.py
index 552ee2d2..dcd36318 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_dist.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_dist.py
@@ -19,14 +19,14 @@ def test_dist_fetch_build_egg(tmpdir):
"""
Check multiple calls to `Distribution.fetch_build_egg` work as expected.
"""
- index = tmpdir.mkdir('index')
- index_url = urllib.parse.urljoin('file://', urllib.request.pathname2url(str(index)))
+ index = tmpdir.mkdir("index")
+ index_url = urllib.parse.urljoin("file://", urllib.request.pathname2url(str(index)))
def sdist_with_index(distname, version):
dist_dir = index.mkdir(distname)
- dist_sdist = f'{distname}-{version}.tar.gz'
+ dist_sdist = f"{distname}-{version}.tar.gz"
make_trivial_sdist(str(dist_dir.join(dist_sdist)), distname, version)
- with dist_dir.join('index.html').open('w') as fp:
+ with dist_dir.join("index.html").open("w") as fp:
fp.write(
DALS(
"""
@@ -37,9 +37,9 @@ def sdist_with_index(distname, version):
).format(dist_sdist=dist_sdist)
)
- sdist_with_index('barbazquux', '3.2.0')
- sdist_with_index('barbazquux-runner', '2.11.1')
- with tmpdir.join('setup.cfg').open('w') as fp:
+ sdist_with_index("barbazquux", "3.2.0")
+ sdist_with_index("barbazquux-runner", "2.11.1")
+ with tmpdir.join("setup.cfg").open("w") as fp:
fp.write(
DALS(
"""
@@ -71,28 +71,28 @@ def sdist_with_index(distname, version):
def test_provides_extras_deterministic_order():
- attrs = dict(extras_require=dict(a=['foo'], b=['bar']))
+ attrs = dict(extras_require=dict(a=["foo"], b=["bar"]))
dist = Distribution(attrs)
- assert list(dist.metadata.provides_extras) == ['a', 'b']
- attrs['extras_require'] = dict(reversed(attrs['extras_require'].items()))
+ assert list(dist.metadata.provides_extras) == ["a", "b"]
+ attrs["extras_require"] = dict(reversed(attrs["extras_require"].items()))
dist = Distribution(attrs)
- assert list(dist.metadata.provides_extras) == ['b', 'a']
+ assert list(dist.metadata.provides_extras) == ["b", "a"]
CHECK_PACKAGE_DATA_TESTS = (
# Valid.
(
{
- '': ['*.txt', '*.rst'],
- 'hello': ['*.msg'],
+ "": ["*.txt", "*.rst"],
+ "hello": ["*.msg"],
},
None,
),
# Not a dictionary.
(
(
- ('', ['*.txt', '*.rst']),
- ('hello', ['*.msg']),
+ ("", ["*.txt", "*.rst"]),
+ ("hello", ["*.msg"]),
),
(
"'package_data' must be a dictionary mapping package"
@@ -102,14 +102,14 @@ def test_provides_extras_deterministic_order():
# Invalid key type.
(
{
- 400: ['*.txt', '*.rst'],
+ 400: ["*.txt", "*.rst"],
},
("keys of 'package_data' dict must be strings (got 400)"),
),
# Invalid value type.
(
{
- 'hello': '*.msg',
+ "hello": "*.msg",
},
(
"\"values of 'package_data' dict\" must be of type "
@@ -119,7 +119,7 @@ def test_provides_extras_deterministic_order():
# Invalid value type (generators are single use)
(
{
- 'hello': (x for x in "generator"),
+ "hello": (x for x in "generator"),
},
(
"\"values of 'package_data' dict\" must be of type "
@@ -129,38 +129,38 @@ def test_provides_extras_deterministic_order():
)
-@pytest.mark.parametrize(('package_data', 'expected_message'), CHECK_PACKAGE_DATA_TESTS)
+@pytest.mark.parametrize(("package_data", "expected_message"), CHECK_PACKAGE_DATA_TESTS)
def test_check_package_data(package_data, expected_message):
if expected_message is None:
- assert check_package_data(None, 'package_data', package_data) is None
+ assert check_package_data(None, "package_data", package_data) is None
else:
with pytest.raises(DistutilsSetupError, match=re.escape(expected_message)):
- check_package_data(None, 'package_data', package_data)
+ check_package_data(None, "package_data", package_data)
def test_check_specifier():
# valid specifier value
- attrs = {'name': 'foo', 'python_requires': '>=3.0, !=3.1'}
+ attrs = {"name": "foo", "python_requires": ">=3.0, !=3.1"}
dist = Distribution(attrs)
- check_specifier(dist, attrs, attrs['python_requires'])
+ check_specifier(dist, attrs, attrs["python_requires"])
- attrs = {'name': 'foo', 'python_requires': ['>=3.0', '!=3.1']}
+ attrs = {"name": "foo", "python_requires": [">=3.0", "!=3.1"]}
dist = Distribution(attrs)
- check_specifier(dist, attrs, attrs['python_requires'])
+ check_specifier(dist, attrs, attrs["python_requires"])
# invalid specifier value
- attrs = {'name': 'foo', 'python_requires': '>=invalid-version'}
+ attrs = {"name": "foo", "python_requires": ">=invalid-version"}
with pytest.raises(DistutilsSetupError):
dist = Distribution(attrs)
def test_metadata_name():
- with pytest.raises(DistutilsSetupError, match='missing.*name'):
+ with pytest.raises(DistutilsSetupError, match="missing.*name"):
Distribution()._validate_metadata()
@pytest.mark.parametrize(
- ('dist_name', 'py_module'),
+ ("dist_name", "py_module"),
[
("my.pkg", "my_pkg"),
("my-pkg", "my_pkg"),
@@ -191,7 +191,7 @@ def test_dist_default_py_modules(tmp_path, dist_name, py_module):
@pytest.mark.parametrize(
- ('dist_name', 'package_dir', 'package_files', 'packages'),
+ ("dist_name", "package_dir", "package_files", "packages"),
[
("my.pkg", None, ["my_pkg/__init__.py", "my_pkg/mod.py"], ["my_pkg"]),
("my-pkg", None, ["my_pkg/__init__.py", "my_pkg/mod.py"], ["my_pkg"]),
@@ -245,7 +245,7 @@ def test_dist_default_packages(
@pytest.mark.parametrize(
- ('dist_name', 'package_dir', 'package_files'),
+ ("dist_name", "package_dir", "package_files"),
[
("my.pkg.nested", None, ["my/pkg/nested/__init__.py"]),
("my.pkg", None, ["my/pkg/__init__.py", "my/pkg/file.py"]),
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_distutils_adoption.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_distutils_adoption.py
index f99a5884..8fa3acbd 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_distutils_adoption.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_distutils_adoption.py
@@ -5,7 +5,7 @@
import pytest
-IS_PYPY = '__pypy__' in sys.builtin_module_names
+IS_PYPY = "__pypy__" in sys.builtin_module_names
_TEXT_KWARGS = {"text": True, "encoding": "utf-8"} # For subprocess.run
@@ -17,14 +17,14 @@ def win_sr(env):
> Fatal Python error: _Py_HashRandomization_Init: failed to
> get random numbers to initialize Python
"""
- if env and platform.system() == 'Windows':
- env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
+ if env and platform.system() == "Windows":
+ env["SYSTEMROOT"] = os.environ["SYSTEMROOT"]
return env
-def find_distutils(venv, imports='distutils', env=None, **kwargs):
- py_cmd = 'import {imports}; print(distutils.__file__)'.format(**locals())
- cmd = ['python', '-c', py_cmd]
+def find_distutils(venv, imports="distutils", env=None, **kwargs):
+ py_cmd = "import {imports}; print(distutils.__file__)".format(**locals())
+ cmd = ["python", "-c", py_cmd]
return venv.run(cmd, env=win_sr(env), **_TEXT_KWARGS, **kwargs)
@@ -36,13 +36,13 @@ def count_meta_path(venv, env=None):
print(len(list(filter(is_distutils, sys.meta_path))))
"""
)
- cmd = ['python', '-c', py_cmd]
+ cmd = ["python", "-c", py_cmd]
return int(venv.run(cmd, env=win_sr(env), **_TEXT_KWARGS))
skip_without_stdlib_distutils = pytest.mark.skipif(
sys.version_info >= (3, 12),
- reason='stdlib distutils is removed from Python 3.12+',
+ reason="stdlib distutils is removed from Python 3.12+",
)
@@ -51,7 +51,7 @@ def test_distutils_stdlib(venv):
"""
Ensure stdlib distutils is used when appropriate.
"""
- env = dict(SETUPTOOLS_USE_DISTUTILS='stdlib')
+ env = dict(SETUPTOOLS_USE_DISTUTILS="stdlib")
assert venv.name not in find_distutils(venv, env=env).split(os.sep)
assert count_meta_path(venv, env=env) == 0
@@ -60,19 +60,19 @@ def test_distutils_local_with_setuptools(venv):
"""
Ensure local distutils is used when appropriate.
"""
- env = dict(SETUPTOOLS_USE_DISTUTILS='local')
- loc = find_distutils(venv, imports='setuptools, distutils', env=env)
+ env = dict(SETUPTOOLS_USE_DISTUTILS="local")
+ loc = find_distutils(venv, imports="setuptools, distutils", env=env)
assert venv.name in loc.split(os.sep)
assert count_meta_path(venv, env=env) <= 1
-@pytest.mark.xfail('IS_PYPY', reason='pypy imports distutils on startup')
+@pytest.mark.xfail("IS_PYPY", reason="pypy imports distutils on startup")
def test_distutils_local(venv):
"""
Even without importing, the setuptools-local copy of distutils is
preferred.
"""
- env = dict(SETUPTOOLS_USE_DISTUTILS='local')
+ env = dict(SETUPTOOLS_USE_DISTUTILS="local")
assert venv.name in find_distutils(venv, env=env).split(os.sep)
assert count_meta_path(venv, env=env) <= 1
@@ -82,7 +82,7 @@ def test_pip_import(venv):
Ensure pip can be imported.
Regression test for #3002.
"""
- cmd = ['python', '-c', 'import pip']
+ cmd = ["python", "-c", "import pip"]
venv.run(cmd, **_TEXT_KWARGS)
@@ -90,7 +90,7 @@ def test_distutils_has_origin():
"""
Distutils module spec should have an origin. #2990.
"""
- assert __import__('distutils').__spec__.origin
+ assert __import__("distutils").__spec__.origin
ENSURE_IMPORTS_ARE_NOT_DUPLICATED = r"""
@@ -116,7 +116,7 @@ def test_distutils_has_origin():
@pytest.mark.usefixtures("tmpdir_cwd")
@pytest.mark.parametrize(
- ('distutils_version', 'imported_module'),
+ ("distutils_version", "imported_module"),
[
pytest.param("stdlib", "dir_util", marks=skip_without_stdlib_distutils),
pytest.param("stdlib", "file_util", marks=skip_without_stdlib_distutils),
@@ -129,7 +129,7 @@ def test_distutils_has_origin():
def test_modules_are_not_duplicated_on_import(distutils_version, imported_module, venv):
env = dict(SETUPTOOLS_USE_DISTUTILS=distutils_version)
script = ENSURE_IMPORTS_ARE_NOT_DUPLICATED.format(imported_module=imported_module)
- cmd = ['python', '-c', script]
+ cmd = ["python", "-c", script]
output = venv.run(cmd, env=win_sr(env), **_TEXT_KWARGS).strip()
assert output == "success"
@@ -154,7 +154,7 @@ def test_modules_are_not_duplicated_on_import(distutils_version, imported_module
)
def test_log_module_is_not_duplicated_on_import(distutils_version, venv):
env = dict(SETUPTOOLS_USE_DISTUTILS=distutils_version)
- cmd = ['python', '-c', ENSURE_LOG_IMPORT_IS_NOT_DUPLICATED]
+ cmd = ["python", "-c", ENSURE_LOG_IMPORT_IS_NOT_DUPLICATED]
output = venv.run(cmd, env=win_sr(env), **_TEXT_KWARGS).strip()
assert output == "success"
@@ -175,7 +175,7 @@ def test_log_module_is_not_duplicated_on_import(distutils_version, venv):
@pytest.mark.usefixtures("tmpdir_cwd")
@pytest.mark.parametrize(
- ('distutils_version', 'imported_module'),
+ ("distutils_version", "imported_module"),
[
("local", "distutils"),
# Unfortunately we still get ._distutils.errors.DistutilsError with SETUPTOOLS_USE_DISTUTILS=stdlib
@@ -188,8 +188,8 @@ def test_log_module_is_not_duplicated_on_import(distutils_version, venv):
def test_consistent_error_from_modified_py(distutils_version, imported_module, venv):
env = dict(SETUPTOOLS_USE_DISTUTILS=distutils_version)
cmd = [
- 'python',
- '-c',
+ "python",
+ "-c",
ENSURE_CONSISTENT_ERROR_FROM_MODIFIED_PY.format(
imported_module=imported_module
),
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_editable_install.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_editable_install.py
index 225fc6a2..32a1d1fe 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_editable_install.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_editable_install.py
@@ -47,7 +47,7 @@ def editable_opts(request):
EXAMPLE = {
- 'pyproject.toml': dedent(
+ "pyproject.toml": dedent(
"""\
[build-system]
requires = ["setuptools"]
@@ -304,8 +304,8 @@ def test_namespace_package_importable(self, venv, tmp_path, editable_opts):
normally using pip and the other installed in editable mode
should allow importing both packages.
"""
- pkg_A = namespaces.build_pep420_namespace_package(tmp_path, 'myns.n.pkgA')
- pkg_B = namespaces.build_pep420_namespace_package(tmp_path, 'myns.n.pkgB')
+ pkg_A = namespaces.build_pep420_namespace_package(tmp_path, "myns.n.pkgA")
+ pkg_B = namespaces.build_pep420_namespace_package(tmp_path, "myns.n.pkgB")
# use pip to install to the target directory
opts = editable_opts[:]
opts.append("--no-build-isolation") # force current version of setuptools
@@ -336,8 +336,8 @@ def test_namespace_created_via_package_dir(self, venv, tmp_path, editable_opts):
}
jaraco.path.build(files, prefix=tmp_path)
pkg_A = tmp_path / "pkgA"
- pkg_B = namespaces.build_pep420_namespace_package(tmp_path, 'myns.n.pkgB')
- pkg_C = namespaces.build_pep420_namespace_package(tmp_path, 'myns.n.pkgC')
+ pkg_B = namespaces.build_pep420_namespace_package(tmp_path, "myns.n.pkgB")
+ pkg_C = namespaces.build_pep420_namespace_package(tmp_path, "myns.n.pkgC")
# use pip to install to the target directory
opts = editable_opts[:]
@@ -402,13 +402,13 @@ def test_editable_with_prefix(tmp_path, sample_project, editable_opts):
"""
Editable install to a prefix should be discoverable.
"""
- prefix = tmp_path / 'prefix'
+ prefix = tmp_path / "prefix"
# figure out where pip will likely install the package
site_packages_all = [
prefix / Path(path).relative_to(sys.prefix)
for path in sys.path
- if 'site-packages' in path and path.startswith(sys.prefix)
+ if "site-packages" in path and path.startswith(sys.prefix)
]
for sp in site_packages_all:
@@ -420,21 +420,21 @@ def test_editable_with_prefix(tmp_path, sample_project, editable_opts):
env = dict(os.environ, PYTHONPATH=os.pathsep.join(map(str, site_packages_all)))
cmd = [
sys.executable,
- '-m',
- 'pip',
- 'install',
- '--editable',
+ "-m",
+ "pip",
+ "install",
+ "--editable",
str(sample_project),
- '--prefix',
+ "--prefix",
str(prefix),
- '--no-build-isolation',
+ "--no-build-isolation",
*editable_opts,
]
subprocess.check_call(cmd, env=env)
# now run 'sample' with the prefix on the PYTHONPATH
- bin = 'Scripts' if platform.system() == 'Windows' else 'bin'
- exe = prefix / bin / 'sample'
+ bin = "Scripts" if platform.system() == "Windows" else "bin"
+ exe = prefix / bin / "sample"
subprocess.check_call([exe], env=env)
@@ -1071,12 +1071,12 @@ def test_compat_install(tmp_path, venv):
def test_pbr_integration(pbr_package, venv, editable_opts):
"""Ensure editable installs work with pbr, issue #3500"""
cmd = [
- 'python',
- '-m',
- 'pip',
- '-v',
- 'install',
- '--editable',
+ "python",
+ "-m",
+ "pip",
+ "-v",
+ "install",
+ "--editable",
pbr_package,
*editable_opts,
]
@@ -1152,7 +1152,7 @@ def test_access_plat_name(self, tmpdir_cwd):
cmd = editable_wheel(dist)
cmd.ensure_finalized()
cmd.run()
- wheel_file = str(next(Path().glob('dist/*.whl')))
+ wheel_file = str(next(Path().glob("dist/*.whl")))
assert "editable" in wheel_file
@@ -1180,7 +1180,7 @@ def test_distutils_leave_inplace_files(self, tmpdir_cwd):
cmd = editable_wheel(dist)
cmd.ensure_finalized()
cmd.run()
- wheel_file = str(next(Path().glob('dist/*.whl')))
+ wheel_file = str(next(Path().glob("dist/*.whl")))
assert "editable" in wheel_file
files = [p for p in Path().glob("module.*") if p.suffix != ".c"]
assert len(files) == 1
@@ -1203,7 +1203,7 @@ def test_debugging_tips(tmpdir_cwd, monkeypatch):
with pytest.raises(SimulatedErr) as ctx:
cmd.run()
- assert any('debugging-tips' in note for note in ctx.value.__notes__)
+ assert any("debugging-tips" in note for note in ctx.value.__notes__)
@pytest.mark.filterwarnings("error")
@@ -1231,7 +1231,7 @@ def _addsitedirs(new_dirs):
If we manipulate sys.path/PYTHONPATH, we can force it to run our code,
which invokes ``addsitedir`` and ensure ``.pth`` files are loaded.
"""
- content = '\n'.join(
+ content = "\n".join(
("import site",)
+ tuple(f"site.addsitedir({os.fspath(new_dir)!r})" for new_dir in new_dirs)
)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_egg_info.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_egg_info.py
index 3653be09..317cc13b 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_egg_info.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_egg_info.py
@@ -27,15 +27,15 @@ class Environment(str):
@pytest.fixture
def env():
- with contexts.tempdir(prefix='setuptools-test.') as env_dir:
+ with contexts.tempdir(prefix="setuptools-test.") as env_dir:
env = Environment(env_dir)
os.chmod(env_dir, stat.S_IRWXU)
- subs = 'home', 'lib', 'scripts', 'data', 'egg-base'
+ subs = "home", "lib", "scripts", "data", "egg-base"
env.paths = dict((dirname, os.path.join(env_dir, dirname)) for dirname in subs)
list(map(os.mkdir, env.paths.values()))
path.build({
- env.paths['home']: {
- '.pydistutils.cfg': DALS(
+ env.paths["home"]: {
+ ".pydistutils.cfg": DALS(
"""
[egg_info]
egg-base = {egg-base}
@@ -62,8 +62,8 @@ class TestEggInfo:
def _create_project(self):
path.build({
- 'setup.py': self.setup_script,
- 'hello.py': DALS(
+ "setup.py": self.setup_script,
+ "hello.py": DALS(
"""
def run():
print('hello')
@@ -73,8 +73,8 @@ def run():
@staticmethod
def _extract_mv_version(pkg_info_lines: list[str]) -> tuple[int, int]:
- version_str = pkg_info_lines[0].split(' ')[1]
- major, minor = map(int, version_str.split('.')[:2])
+ version_str = pkg_info_lines[0].split(" ")[1]
+ major, minor = map(int, version_str.split(".")[:2])
return major, minor
def test_egg_info_save_version_info_setup_empty(self, tmpdir_cwd, env):
@@ -83,22 +83,22 @@ def test_egg_info_save_version_info_setup_empty(self, tmpdir_cwd, env):
save_version_info should add the settings to the setup.cfg
in a deterministic order.
"""
- setup_cfg = os.path.join(env.paths['home'], 'setup.cfg')
+ setup_cfg = os.path.join(env.paths["home"], "setup.cfg")
dist = Distribution()
ei = egg_info(dist)
ei.initialize_options()
ei.save_version_info(setup_cfg)
- with open(setup_cfg, 'r', encoding="utf-8") as f:
+ with open(setup_cfg, "r", encoding="utf-8") as f:
content = f.read()
- assert '[egg_info]' in content
- assert 'tag_build =' in content
- assert 'tag_date = 0' in content
+ assert "[egg_info]" in content
+ assert "tag_build =" in content
+ assert "tag_date = 0" in content
expected_order = (
- 'tag_build',
- 'tag_date',
+ "tag_build",
+ "tag_date",
)
self._validate_content_order(content, expected_order)
@@ -109,7 +109,7 @@ def _validate_content_order(content, expected):
Assert that the strings in expected appear in content
in order.
"""
- pattern = '.*'.join(expected)
+ pattern = ".*".join(expected)
flags = re.MULTILINE | re.DOTALL
assert re.search(pattern, content, flags)
@@ -119,7 +119,7 @@ def test_egg_info_save_version_info_setup_defaults(self, tmpdir_cwd, env):
with the 'default' values present from a previous run,
the file should remain unchanged.
"""
- setup_cfg = os.path.join(env.paths['home'], 'setup.cfg')
+ setup_cfg = os.path.join(env.paths["home"], "setup.cfg")
path.build({
setup_cfg: DALS(
"""
@@ -134,16 +134,16 @@ def test_egg_info_save_version_info_setup_defaults(self, tmpdir_cwd, env):
ei.initialize_options()
ei.save_version_info(setup_cfg)
- with open(setup_cfg, 'r', encoding="utf-8") as f:
+ with open(setup_cfg, "r", encoding="utf-8") as f:
content = f.read()
- assert '[egg_info]' in content
- assert 'tag_build =' in content
- assert 'tag_date = 0' in content
+ assert "[egg_info]" in content
+ assert "tag_build =" in content
+ assert "tag_date = 0" in content
expected_order = (
- 'tag_build',
- 'tag_date',
+ "tag_build",
+ "tag_date",
)
self._validate_content_order(content, expected_order)
@@ -152,24 +152,24 @@ def test_expected_files_produced(self, tmpdir_cwd, env):
self._create_project()
self._run_egg_info_command(tmpdir_cwd, env)
- actual = os.listdir('foo.egg-info')
+ actual = os.listdir("foo.egg-info")
expected = [
- 'PKG-INFO',
- 'SOURCES.txt',
- 'dependency_links.txt',
- 'entry_points.txt',
- 'not-zip-safe',
- 'top_level.txt',
+ "PKG-INFO",
+ "SOURCES.txt",
+ "dependency_links.txt",
+ "entry_points.txt",
+ "not-zip-safe",
+ "top_level.txt",
]
assert sorted(actual) == expected
def test_handling_utime_error(self, tmpdir_cwd, env):
dist = Distribution()
ei = egg_info(dist)
- utime_patch = mock.patch('os.utime', side_effect=OSError("TEST"))
+ utime_patch = mock.patch("os.utime", side_effect=OSError("TEST"))
mkpath_patch = mock.patch(
- 'setuptools.command.egg_info.egg_info.mkpath', return_val=None
+ "setuptools.command.egg_info.egg_info.mkpath", return_val=None
)
with utime_patch, mkpath_patch:
@@ -198,8 +198,8 @@ def test_license_is_a_string(self, tmpdir_cwd, env):
)
path.build({
- 'setup.py': setup_script,
- 'setup.cfg': setup_config,
+ "setup.py": setup_script,
+ "setup.cfg": setup_config,
})
# This command should fail with a ValueError, but because it's
@@ -210,40 +210,40 @@ def test_license_is_a_string(self, tmpdir_cwd, env):
# The only argument to the assertion error should be a traceback
# containing a ValueError
- assert 'ValueError' in exc.value.args[0]
+ assert "ValueError" in exc.value.args[0]
def test_rebuilt(self, tmpdir_cwd, env):
"""Ensure timestamps are updated when the command is re-run."""
self._create_project()
self._run_egg_info_command(tmpdir_cwd, env)
- timestamp_a = os.path.getmtime('foo.egg-info')
+ timestamp_a = os.path.getmtime("foo.egg-info")
# arbitrary sleep just to handle *really* fast systems
time.sleep(0.001)
self._run_egg_info_command(tmpdir_cwd, env)
- timestamp_b = os.path.getmtime('foo.egg-info')
+ timestamp_b = os.path.getmtime("foo.egg-info")
assert timestamp_a != timestamp_b
def test_manifest_template_is_read(self, tmpdir_cwd, env):
self._create_project()
path.build({
- 'MANIFEST.in': DALS(
+ "MANIFEST.in": DALS(
"""
recursive-include docs *.rst
"""
),
- 'docs': {
- 'usage.rst': "Run 'hi'",
+ "docs": {
+ "usage.rst": "Run 'hi'",
},
})
self._run_egg_info_command(tmpdir_cwd, env)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- sources_txt = os.path.join(egg_info_dir, 'SOURCES.txt')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ sources_txt = os.path.join(egg_info_dir, "SOURCES.txt")
with open(sources_txt, encoding="utf-8") as f:
- assert 'docs/usage.rst' in f.read().split('\n')
+ assert "docs/usage.rst" in f.read().split("\n")
def _setup_script_with_requires(self, requires, use_setup_cfg=False):
setup_script = DALS(
@@ -252,11 +252,11 @@ def _setup_script_with_requires(self, requires, use_setup_cfg=False):
setup(name='foo', zip_safe=False, %s)
"""
- ) % ('' if use_setup_cfg else requires)
- setup_config = requires if use_setup_cfg else ''
+ ) % ("" if use_setup_cfg else requires)
+ setup_config = requires if use_setup_cfg else ""
path.build({
- 'setup.py': setup_script,
- 'setup.cfg': setup_config,
+ "setup.py": setup_script,
+ "setup.cfg": setup_config,
})
mismatch_marker = f"python_version<'{sys.version_info[0]}'"
@@ -270,8 +270,8 @@ def parametrize(*test_list, **format_dict):
idlist = []
argvalues = []
for test in test_list:
- test_params = test.lstrip().split('\n\n', 3)
- name_kwargs = test_params.pop(0).split('\n')
+ test_params = test.lstrip().split("\n\n", 3)
+ name_kwargs = test_params.pop(0).split("\n")
if len(name_kwargs) > 1:
val = name_kwargs[1].strip()
install_cmd_kwargs = ast.literal_eval(val)
@@ -283,11 +283,11 @@ def parametrize(*test_list, **format_dict):
]
for id_, requires, use_cfg in (
(name, setup_py_requires, False),
- (name + '_in_setup_cfg', setup_cfg_requires, True),
+ (name + "_in_setup_cfg", setup_cfg_requires, True),
):
idlist.append(id_)
marks = ()
- if requires.startswith('@xfail\n'):
+ if requires.startswith("@xfail\n"):
requires = requires[7:]
marks = pytest.mark.xfail
argvalues.append(
@@ -470,15 +470,15 @@ def test_requires(
):
self._setup_script_with_requires(requires, use_setup_cfg)
self._run_egg_info_command(tmpdir_cwd, env, **install_cmd_kwargs)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- requires_txt = os.path.join(egg_info_dir, 'requires.txt')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ requires_txt = os.path.join(egg_info_dir, "requires.txt")
if os.path.exists(requires_txt):
with open(requires_txt, encoding="utf-8") as fp:
install_requires = fp.read()
else:
- install_requires = ''
+ install_requires = ""
assert install_requires.lstrip() == expected_requires
- assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == []
+ assert glob.glob(os.path.join(env.paths["lib"], "barbazquux*")) == []
def test_install_requires_unordered_disallowed(self, tmpdir_cwd, env):
"""
@@ -497,7 +497,7 @@ def test_extras_require_with_invalid_marker(self, tmpdir_cwd, env):
self._setup_script_with_requires(req)
with pytest.raises(AssertionError):
self._run_egg_info_command(tmpdir_cwd, env)
- assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == []
+ assert glob.glob(os.path.join(env.paths["lib"], "barbazquux*")) == []
def test_extras_require_with_invalid_marker_in_req(self, tmpdir_cwd, env):
tmpl = 'extras_require={{"extra": ["barbazquux; {marker}"]}},'
@@ -505,102 +505,102 @@ def test_extras_require_with_invalid_marker_in_req(self, tmpdir_cwd, env):
self._setup_script_with_requires(req)
with pytest.raises(AssertionError):
self._run_egg_info_command(tmpdir_cwd, env)
- assert glob.glob(os.path.join(env.paths['lib'], 'barbazquux*')) == []
+ assert glob.glob(os.path.join(env.paths["lib"], "barbazquux*")) == []
def test_provides_extra(self, tmpdir_cwd, env):
self._setup_script_with_requires('extras_require={"foobar": ["barbazquux"]},')
environ = os.environ.copy().update(
- HOME=env.paths['home'],
+ HOME=env.paths["home"],
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
env=environ,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- assert 'Provides-Extra: foobar' in pkg_info_lines
- assert 'Metadata-Version: 2.4' in pkg_info_lines
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ assert "Provides-Extra: foobar" in pkg_info_lines
+ assert "Metadata-Version: 2.4" in pkg_info_lines
def test_doesnt_provides_extra(self, tmpdir_cwd, env):
self._setup_script_with_requires(
"""install_requires=["spam ; python_version<'3.6'"]"""
)
environ = os.environ.copy().update(
- HOME=env.paths['home'],
+ HOME=env.paths["home"],
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
env=environ,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
pkg_info_text = fp.read()
- assert 'Provides-Extra:' not in pkg_info_text
+ assert "Provides-Extra:" not in pkg_info_text
@pytest.mark.parametrize(
- ('files', 'license_in_sources'),
+ ("files", "license_in_sources"),
[
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE
"""
),
- 'LICENSE': "Test license",
+ "LICENSE": "Test license",
},
True,
), # with license
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = INVALID_LICENSE
"""
),
- 'LICENSE': "Test license",
+ "LICENSE": "Test license",
},
False,
), # with an invalid license
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
"""
),
- 'LICENSE': "Test license",
+ "LICENSE": "Test license",
},
True,
), # no license_file attribute, LICENSE auto-included
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE
"""
),
- 'MANIFEST.in': "exclude LICENSE",
- 'LICENSE': "Test license",
+ "MANIFEST.in": "exclude LICENSE",
+ "LICENSE": "Test license",
},
True,
), # manifest is overwritten by license_file
pytest.param(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICEN[CS]E*
"""
),
- 'LICENSE': "Test license",
+ "LICENSE": "Test license",
},
True,
id="glob_pattern",
@@ -612,26 +612,26 @@ def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources
path.build(files)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
sources_text = Path(egg_info_dir, "SOURCES.txt").read_text(encoding="utf-8")
if license_in_sources:
- assert 'LICENSE' in sources_text
+ assert "LICENSE" in sources_text
else:
- assert 'LICENSE' not in sources_text
+ assert "LICENSE" not in sources_text
# for invalid license test
- assert 'INVALID_LICENSE' not in sources_text
+ assert "INVALID_LICENSE" not in sources_text
@pytest.mark.parametrize(
- ('files', 'incl_licenses', 'excl_licenses'),
+ ("files", "incl_licenses", "excl_licenses"),
[
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
@@ -639,72 +639,72 @@ def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources
LICENSE-XYZ
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
},
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
[],
), # with licenses
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files = LICENSE-ABC, LICENSE-XYZ
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
},
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
[],
), # with commas
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
LICENSE-ABC
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
},
- ['LICENSE-ABC'],
- ['LICENSE-XYZ'],
+ ["LICENSE-ABC"],
+ ["LICENSE-XYZ"],
), # with one license
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
},
[],
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
), # empty
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files = LICENSE-XYZ
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
},
- ['LICENSE-XYZ'],
- ['LICENSE-ABC'],
+ ["LICENSE-XYZ"],
+ ["LICENSE-ABC"],
), # on same line
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
@@ -712,39 +712,39 @@ def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources
INVALID_LICENSE
"""
),
- 'LICENSE-ABC': "Test license",
+ "LICENSE-ABC": "Test license",
},
- ['LICENSE-ABC'],
- ['INVALID_LICENSE'],
+ ["LICENSE-ABC"],
+ ["INVALID_LICENSE"],
), # with an invalid license
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
"""
),
- 'LICENSE': "Test license",
+ "LICENSE": "Test license",
},
- ['LICENSE'],
+ ["LICENSE"],
[],
), # no license_files attribute, LICENSE auto-included
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files = LICENSE
"""
),
- 'MANIFEST.in': "exclude LICENSE",
- 'LICENSE': "Test license",
+ "MANIFEST.in": "exclude LICENSE",
+ "LICENSE": "Test license",
},
- ['LICENSE'],
+ ["LICENSE"],
[],
), # manifest is overwritten by license_files
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
@@ -752,56 +752,56 @@ def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources
LICENSE-XYZ
"""
),
- 'MANIFEST.in': "exclude LICENSE-XYZ",
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "MANIFEST.in": "exclude LICENSE-XYZ",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
# manifest is overwritten by license_files
},
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
[],
),
pytest.param(
{
- 'setup.cfg': "",
- 'LICENSE-ABC': "ABC license",
- 'COPYING-ABC': "ABC copying",
- 'NOTICE-ABC': "ABC notice",
- 'AUTHORS-ABC': "ABC authors",
- 'LICENCE-XYZ': "XYZ license",
- 'LICENSE': "License",
- 'INVALID-LICENSE': "Invalid license",
+ "setup.cfg": "",
+ "LICENSE-ABC": "ABC license",
+ "COPYING-ABC": "ABC copying",
+ "NOTICE-ABC": "ABC notice",
+ "AUTHORS-ABC": "ABC authors",
+ "LICENCE-XYZ": "XYZ license",
+ "LICENSE": "License",
+ "INVALID-LICENSE": "Invalid license",
},
[
- 'LICENSE-ABC',
- 'COPYING-ABC',
- 'NOTICE-ABC',
- 'AUTHORS-ABC',
- 'LICENCE-XYZ',
- 'LICENSE',
+ "LICENSE-ABC",
+ "COPYING-ABC",
+ "NOTICE-ABC",
+ "AUTHORS-ABC",
+ "LICENCE-XYZ",
+ "LICENSE",
],
- ['INVALID-LICENSE'],
+ ["INVALID-LICENSE"],
# ('LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*')
id="default_glob_patterns",
),
pytest.param(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
LICENSE*
"""
),
- 'LICENSE-ABC': "ABC license",
- 'NOTICE-XYZ': "XYZ notice",
+ "LICENSE-ABC": "ABC license",
+ "NOTICE-XYZ": "XYZ notice",
},
- ['LICENSE-ABC'],
- ['NOTICE-XYZ'],
+ ["LICENSE-ABC"],
+ ["NOTICE-XYZ"],
id="no_default_glob_patterns",
),
pytest.param(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files =
@@ -809,26 +809,26 @@ def test_setup_cfg_license_file(self, tmpdir_cwd, env, files, license_in_sources
LICENSE*
"""
),
- 'LICENSE-ABC': "ABC license",
+ "LICENSE-ABC": "ABC license",
},
- ['LICENSE-ABC'],
+ ["LICENSE-ABC"],
[],
id="files_only_added_once",
),
pytest.param(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_files = **/LICENSE
"""
),
- 'LICENSE': "ABC license",
- 'LICENSE-OTHER': "Don't include",
- 'vendor': {'LICENSE': "Vendor license"},
+ "LICENSE": "ABC license",
+ "LICENSE-OTHER": "Don't include",
+ "vendor": {"LICENSE": "Vendor license"},
},
- ['LICENSE', 'vendor/LICENSE'],
- ['LICENSE-OTHER'],
+ ["LICENSE", "vendor/LICENSE"],
+ ["LICENSE-OTHER"],
id="recursive_glob",
),
],
@@ -840,10 +840,10 @@ def test_setup_cfg_license_files(
path.build(files)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
sources_text = Path(egg_info_dir, "SOURCES.txt").read_text(encoding="utf-8")
sources_lines = [line.strip() for line in sources_text.splitlines()]
@@ -855,26 +855,26 @@ def test_setup_cfg_license_files(
assert sources_lines.count(lf) == 0
@pytest.mark.parametrize(
- ('files', 'incl_licenses', 'excl_licenses'),
+ ("files", "incl_licenses", "excl_licenses"),
[
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file =
license_files =
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
},
[],
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
), # both empty
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file =
@@ -882,16 +882,16 @@ def test_setup_cfg_license_files(
LICENSE-XYZ
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-XYZ": "XYZ license",
# license_file is still singular
},
[],
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
),
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE-ABC
@@ -900,16 +900,16 @@ def test_setup_cfg_license_files(
LICENSE-PQR
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-PQR': "PQR license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-PQR": "PQR license",
+ "LICENSE-XYZ": "XYZ license",
},
- ['LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-PQR", "LICENSE-XYZ"],
[],
), # combined
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE-ABC
@@ -919,17 +919,17 @@ def test_setup_cfg_license_files(
LICENSE-PQR
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-PQR': "PQR license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-PQR": "PQR license",
+ "LICENSE-XYZ": "XYZ license",
# duplicate license
},
- ['LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-PQR", "LICENSE-XYZ"],
[],
),
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE-ABC
@@ -937,17 +937,17 @@ def test_setup_cfg_license_files(
LICENSE-XYZ
"""
),
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-PQR': "PQR license",
- 'LICENSE-XYZ': "XYZ license",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-PQR": "PQR license",
+ "LICENSE-XYZ": "XYZ license",
# combined subset
},
- ['LICENSE-ABC', 'LICENSE-XYZ'],
- ['LICENSE-PQR'],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
+ ["LICENSE-PQR"],
),
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE-ABC
@@ -956,15 +956,15 @@ def test_setup_cfg_license_files(
LICENSE-PQR
"""
),
- 'LICENSE-PQR': "Test license",
+ "LICENSE-PQR": "Test license",
# with invalid licenses
},
- ['LICENSE-PQR'],
- ['LICENSE-ABC', 'LICENSE-XYZ'],
+ ["LICENSE-PQR"],
+ ["LICENSE-ABC", "LICENSE-XYZ"],
),
(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE-ABC
@@ -973,33 +973,33 @@ def test_setup_cfg_license_files(
LICENSE-XYZ
"""
),
- 'MANIFEST.in': "exclude LICENSE-ABC\nexclude LICENSE-PQR",
- 'LICENSE-ABC': "ABC license",
- 'LICENSE-PQR': "PQR license",
- 'LICENSE-XYZ': "XYZ license",
+ "MANIFEST.in": "exclude LICENSE-ABC\nexclude LICENSE-PQR",
+ "LICENSE-ABC": "ABC license",
+ "LICENSE-PQR": "PQR license",
+ "LICENSE-XYZ": "XYZ license",
# manifest is overwritten
},
- ['LICENSE-ABC', 'LICENSE-PQR', 'LICENSE-XYZ'],
+ ["LICENSE-ABC", "LICENSE-PQR", "LICENSE-XYZ"],
[],
),
pytest.param(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE*
"""
),
- 'LICENSE-ABC': "ABC license",
- 'NOTICE-XYZ': "XYZ notice",
+ "LICENSE-ABC": "ABC license",
+ "NOTICE-XYZ": "XYZ notice",
},
- ['LICENSE-ABC'],
- ['NOTICE-XYZ'],
+ ["LICENSE-ABC"],
+ ["NOTICE-XYZ"],
id="no_default_glob_patterns",
),
pytest.param(
{
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[metadata]
license_file = LICENSE*
@@ -1007,12 +1007,12 @@ def test_setup_cfg_license_files(
NOTICE*
"""
),
- 'LICENSE-ABC': "ABC license",
- 'NOTICE-ABC': "ABC notice",
- 'AUTHORS-ABC': "ABC authors",
+ "LICENSE-ABC": "ABC license",
+ "NOTICE-ABC": "ABC notice",
+ "AUTHORS-ABC": "ABC authors",
},
- ['LICENSE-ABC', 'NOTICE-ABC'],
- ['AUTHORS-ABC'],
+ ["LICENSE-ABC", "NOTICE-ABC"],
+ ["AUTHORS-ABC"],
id="combined_glob_patterrns",
),
],
@@ -1024,10 +1024,10 @@ def test_setup_cfg_license_file_license_files(
path.build(files)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
sources_text = Path(egg_info_dir, "SOURCES.txt").read_text(encoding="utf-8")
sources_lines = [line.strip() for line in sources_text.splitlines()]
@@ -1055,18 +1055,18 @@ def test_license_file_attr_pkg_info(self, tmpdir_cwd, env):
"LICENSE-XYZ": "XYZ license",
"NOTICE": "included",
"IGNORE": "not include",
- "vendor": {'LICENSE': "Vendor license"},
+ "vendor": {"LICENSE": "Vendor license"},
})
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
license_file_lines = [
- line for line in pkg_info_lines if line.startswith('License-File:')
+ line for line in pkg_info_lines if line.startswith("License-File:")
]
# Only 'NOTICE', LICENSE-ABC', and 'LICENSE-XYZ' should have been matched
@@ -1081,13 +1081,13 @@ def test_metadata_version(self, tmpdir_cwd, env):
"""Make sure latest metadata version is used by default."""
self._setup_script_with_requires("")
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
# Update metadata version if changed
assert self._extract_mv_version(pkg_info_lines) == (2, 4)
@@ -1103,20 +1103,20 @@ def test_long_description_content_type(self, tmpdir_cwd, env):
"""long_description_content_type='text/markdown',"""
)
environ = os.environ.copy().update(
- HOME=env.paths['home'],
+ HOME=env.paths["home"],
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
env=environ,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- expected_line = 'Description-Content-Type: text/markdown'
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ expected_line = "Description-Content-Type: text/markdown"
assert expected_line in pkg_info_lines
- assert 'Metadata-Version: 2.4' in pkg_info_lines
+ assert "Metadata-Version: 2.4" in pkg_info_lines
def test_long_description(self, tmpdir_cwd, env):
# Test that specifying `long_description` and `long_description_content_type`
@@ -1128,18 +1128,18 @@ def test_long_description(self, tmpdir_cwd, env):
"long_description_content_type='text/markdown',"
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- assert 'Metadata-Version: 2.4' in pkg_info_lines
- assert '' == pkg_info_lines[-1] # last line should be empty
- long_desc_lines = pkg_info_lines[pkg_info_lines.index('') :]
- assert 'This is a long description' in long_desc_lines
- assert 'over multiple lines' in long_desc_lines
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ assert "Metadata-Version: 2.4" in pkg_info_lines
+ assert "" == pkg_info_lines[-1] # last line should be empty
+ long_desc_lines = pkg_info_lines[pkg_info_lines.index("") :]
+ assert "This is a long description" in long_desc_lines
+ assert "over multiple lines" in long_desc_lines
def test_project_urls(self, tmpdir_cwd, env):
# Test that specifying a `project_urls` dict to the `setup`
@@ -1156,20 +1156,20 @@ def test_project_urls(self, tmpdir_cwd, env):
},"""
)
environ = os.environ.copy().update(
- HOME=env.paths['home'],
+ HOME=env.paths["home"],
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
env=environ,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- expected_line = 'Project-URL: Link One, https://example.com/one/'
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ expected_line = "Project-URL: Link One, https://example.com/one/"
assert expected_line in pkg_info_lines
- expected_line = 'Project-URL: Link Two, https://example.com/two/'
+ expected_line = "Project-URL: Link Two, https://example.com/two/"
assert expected_line in pkg_info_lines
assert self._extract_mv_version(pkg_info_lines) >= (1, 2)
@@ -1177,14 +1177,14 @@ def test_license(self, tmpdir_cwd, env):
"""Test single line license."""
self._setup_script_with_requires("license='MIT',")
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- assert 'License: MIT' in pkg_info_lines
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ assert "License: MIT" in pkg_info_lines
def test_license_escape(self, tmpdir_cwd, env):
"""Test license is escaped correctly if longer than one line."""
@@ -1192,33 +1192,33 @@ def test_license_escape(self, tmpdir_cwd, env):
"license='This is a long license text \\nover multiple lines',"
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
- assert 'License: This is a long license text ' in pkg_info_lines
- assert ' over multiple lines' in pkg_info_lines
- assert 'text \n over multiple' in '\n'.join(pkg_info_lines)
+ assert "License: This is a long license text " in pkg_info_lines
+ assert " over multiple lines" in pkg_info_lines
+ assert "text \n over multiple" in "\n".join(pkg_info_lines)
def test_python_requires_egg_info(self, tmpdir_cwd, env):
self._setup_script_with_requires("""python_requires='>=2.7.12',""")
environ = os.environ.copy().update(
- HOME=env.paths['home'],
+ HOME=env.paths["home"],
)
environment.run_setup_py(
- cmd=['egg_info'],
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ cmd=["egg_info"],
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
env=environ,
)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- assert 'Requires-Python: >=2.7.12' in pkg_info_lines
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ assert "Requires-Python: >=2.7.12" in pkg_info_lines
assert self._extract_mv_version(pkg_info_lines) >= (1, 2)
def test_manifest_maker_warning_suppression(self):
@@ -1238,23 +1238,23 @@ def test_egg_info_includes_setup_py(self, tmpdir_cwd):
egg_info_instance.finalize_options()
egg_info_instance.run()
- assert 'setup.py' in egg_info_instance.filelist.files
+ assert "setup.py" in egg_info_instance.filelist.files
with open(egg_info_instance.egg_info + "/SOURCES.txt", encoding="utf-8") as f:
- sources = f.read().split('\n')
- assert 'setup.py' in sources
+ sources = f.read().split("\n")
+ assert "setup.py" in sources
def _run_egg_info_command(self, tmpdir_cwd, env, cmd=None, output=None):
environ = os.environ.copy().update(
- HOME=env.paths['home'],
+ HOME=env.paths["home"],
)
if cmd is None:
cmd = [
- 'egg_info',
+ "egg_info",
]
code, data = environment.run_setup_py(
cmd=cmd,
- pypath=os.pathsep.join([env.paths['lib'], str(tmpdir_cwd)]),
+ pypath=os.pathsep.join([env.paths["lib"], str(tmpdir_cwd)]),
data_stream=1,
env=environ,
)
@@ -1266,7 +1266,7 @@ def _run_egg_info_command(self, tmpdir_cwd, env, cmd=None, output=None):
def test_egg_info_tag_only_once(self, tmpdir_cwd, env):
self._create_project()
path.build({
- 'setup.cfg': DALS(
+ "setup.cfg": DALS(
"""
[egg_info]
tag_build = dev
@@ -1276,10 +1276,10 @@ def test_egg_info_tag_only_once(self, tmpdir_cwd, env):
),
})
self._run_egg_info_command(tmpdir_cwd, env)
- egg_info_dir = os.path.join('.', 'foo.egg-info')
- with open(os.path.join(egg_info_dir, 'PKG-INFO'), encoding="utf-8") as fp:
- pkg_info_lines = fp.read().split('\n')
- assert 'Version: 0.0.0.dev0' in pkg_info_lines
+ egg_info_dir = os.path.join(".", "foo.egg-info")
+ with open(os.path.join(egg_info_dir, "PKG-INFO"), encoding="utf-8") as fp:
+ pkg_info_lines = fp.read().split("\n")
+ assert "Version: 0.0.0.dev0" in pkg_info_lines
class TestWriteEntries:
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_find_packages.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_find_packages.py
index 9fd9f8f6..04be61fb 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_find_packages.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_find_packages.py
@@ -37,17 +37,17 @@ def _make_pkg_structure(self):
setup.py
"""
- self.docs_dir = self._mkdir('docs', self.dist_dir)
- self._touch('conf.py', self.docs_dir)
- self.pkg_dir = self._mkdir('pkg', self.dist_dir)
- self._mkdir('__pycache__', self.pkg_dir)
- self.ns_pkg_dir = self._mkdir('nspkg', self.pkg_dir)
- self._touch('mod.py', self.ns_pkg_dir)
- self.sub_pkg_dir = self._mkdir('subpkg', self.pkg_dir)
- self.asset_dir = self._mkdir('assets', self.sub_pkg_dir)
- self._touch('asset', self.asset_dir)
- self._touch('__init__.py', self.sub_pkg_dir)
- self._touch('setup.py', self.dist_dir)
+ self.docs_dir = self._mkdir("docs", self.dist_dir)
+ self._touch("conf.py", self.docs_dir)
+ self.pkg_dir = self._mkdir("pkg", self.dist_dir)
+ self._mkdir("__pycache__", self.pkg_dir)
+ self.ns_pkg_dir = self._mkdir("nspkg", self.pkg_dir)
+ self._touch("mod.py", self.ns_pkg_dir)
+ self.sub_pkg_dir = self._mkdir("subpkg", self.pkg_dir)
+ self.asset_dir = self._mkdir("assets", self.sub_pkg_dir)
+ self._touch("asset", self.asset_dir)
+ self._touch("__init__.py", self.sub_pkg_dir)
+ self._touch("setup.py", self.dist_dir)
def _mkdir(self, path, parent_dir=None):
if parent_dir:
@@ -58,58 +58,58 @@ def _mkdir(self, path, parent_dir=None):
def _touch(self, path, dir_=None):
if dir_:
path = os.path.join(dir_, path)
- open(path, 'wb').close()
+ open(path, "wb").close()
return path
def test_regular_package(self):
- self._touch('__init__.py', self.pkg_dir)
+ self._touch("__init__.py", self.pkg_dir)
packages = find_packages(self.dist_dir)
- assert packages == ['pkg', 'pkg.subpkg']
+ assert packages == ["pkg", "pkg.subpkg"]
def test_exclude(self):
- self._touch('__init__.py', self.pkg_dir)
- packages = find_packages(self.dist_dir, exclude=('pkg.*',))
- assert packages == ['pkg']
+ self._touch("__init__.py", self.pkg_dir)
+ packages = find_packages(self.dist_dir, exclude=("pkg.*",))
+ assert packages == ["pkg"]
def test_exclude_recursive(self):
"""
Excluding a parent package should not exclude child packages as well.
"""
- self._touch('__init__.py', self.pkg_dir)
- self._touch('__init__.py', self.sub_pkg_dir)
- packages = find_packages(self.dist_dir, exclude=('pkg',))
- assert packages == ['pkg.subpkg']
+ self._touch("__init__.py", self.pkg_dir)
+ self._touch("__init__.py", self.sub_pkg_dir)
+ packages = find_packages(self.dist_dir, exclude=("pkg",))
+ assert packages == ["pkg.subpkg"]
def test_include_excludes_other(self):
"""
If include is specified, other packages should be excluded.
"""
- self._touch('__init__.py', self.pkg_dir)
- alt_dir = self._mkdir('other_pkg', self.dist_dir)
- self._touch('__init__.py', alt_dir)
- packages = find_packages(self.dist_dir, include=['other_pkg'])
- assert packages == ['other_pkg']
+ self._touch("__init__.py", self.pkg_dir)
+ alt_dir = self._mkdir("other_pkg", self.dist_dir)
+ self._touch("__init__.py", alt_dir)
+ packages = find_packages(self.dist_dir, include=["other_pkg"])
+ assert packages == ["other_pkg"]
def test_dir_with_dot_is_skipped(self):
- shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets'))
- data_dir = self._mkdir('some.data', self.pkg_dir)
- self._touch('__init__.py', data_dir)
- self._touch('file.dat', data_dir)
+ shutil.rmtree(os.path.join(self.dist_dir, "pkg/subpkg/assets"))
+ data_dir = self._mkdir("some.data", self.pkg_dir)
+ self._touch("__init__.py", data_dir)
+ self._touch("file.dat", data_dir)
packages = find_packages(self.dist_dir)
- assert 'pkg.some.data' not in packages
+ assert "pkg.some.data" not in packages
def test_dir_with_packages_in_subdir_is_excluded(self):
"""
Ensure that a package in a non-package such as build/pkg/__init__.py
is excluded.
"""
- build_dir = self._mkdir('build', self.dist_dir)
- build_pkg_dir = self._mkdir('pkg', build_dir)
- self._touch('__init__.py', build_pkg_dir)
+ build_dir = self._mkdir("build", self.dist_dir)
+ build_pkg_dir = self._mkdir("pkg", build_dir)
+ self._touch("__init__.py", build_pkg_dir)
packages = find_packages(self.dist_dir)
- assert 'build.pkg' not in packages
+ assert "build.pkg" not in packages
- @pytest.mark.skipif(not os_helper.can_symlink(), reason='Symlink support required')
+ @pytest.mark.skipif(not os_helper.can_symlink(), reason="Symlink support required")
def test_symlinked_packages_are_included(self):
"""
A symbolically-linked directory should be treated like any other
@@ -117,43 +117,43 @@ def test_symlinked_packages_are_included(self):
Create a link from lpkg -> pkg.
"""
- self._touch('__init__.py', self.pkg_dir)
- linked_pkg = os.path.join(self.dist_dir, 'lpkg')
- os.symlink('pkg', linked_pkg)
+ self._touch("__init__.py", self.pkg_dir)
+ linked_pkg = os.path.join(self.dist_dir, "lpkg")
+ os.symlink("pkg", linked_pkg)
assert os.path.isdir(linked_pkg)
packages = find_packages(self.dist_dir)
- assert 'lpkg' in packages
+ assert "lpkg" in packages
def _assert_packages(self, actual, expected):
assert set(actual) == set(expected)
def test_pep420_ns_package(self):
packages = find_namespace_packages(
- self.dist_dir, include=['pkg*'], exclude=['pkg.subpkg.assets']
+ self.dist_dir, include=["pkg*"], exclude=["pkg.subpkg.assets"]
)
- self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])
+ self._assert_packages(packages, ["pkg", "pkg.nspkg", "pkg.subpkg"])
def test_pep420_ns_package_no_includes(self):
- packages = find_namespace_packages(self.dist_dir, exclude=['pkg.subpkg.assets'])
- self._assert_packages(packages, ['docs', 'pkg', 'pkg.nspkg', 'pkg.subpkg'])
+ packages = find_namespace_packages(self.dist_dir, exclude=["pkg.subpkg.assets"])
+ self._assert_packages(packages, ["docs", "pkg", "pkg.nspkg", "pkg.subpkg"])
def test_pep420_ns_package_no_includes_or_excludes(self):
packages = find_namespace_packages(self.dist_dir)
- expected = ['docs', 'pkg', 'pkg.nspkg', 'pkg.subpkg', 'pkg.subpkg.assets']
+ expected = ["docs", "pkg", "pkg.nspkg", "pkg.subpkg", "pkg.subpkg.assets"]
self._assert_packages(packages, expected)
def test_regular_package_with_nested_pep420_ns_packages(self):
- self._touch('__init__.py', self.pkg_dir)
+ self._touch("__init__.py", self.pkg_dir)
packages = find_namespace_packages(
- self.dist_dir, exclude=['docs', 'pkg.subpkg.assets']
+ self.dist_dir, exclude=["docs", "pkg.subpkg.assets"]
)
- self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])
+ self._assert_packages(packages, ["pkg", "pkg.nspkg", "pkg.subpkg"])
def test_pep420_ns_package_no_non_package_dirs(self):
shutil.rmtree(self.docs_dir)
- shutil.rmtree(os.path.join(self.dist_dir, 'pkg/subpkg/assets'))
+ shutil.rmtree(os.path.join(self.dist_dir, "pkg/subpkg/assets"))
packages = find_namespace_packages(self.dist_dir)
- self._assert_packages(packages, ['pkg', 'pkg.nspkg', 'pkg.subpkg'])
+ self._assert_packages(packages, ["pkg", "pkg.nspkg", "pkg.subpkg"])
class TestFlatLayoutPackageFinder:
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_find_py_modules.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_find_py_modules.py
index 8034b544..95c197db 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_find_py_modules.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_find_py_modules.py
@@ -40,7 +40,7 @@ def test_finder(self, tmp_path, example):
ensure_files(tmp_path, files)
assert self.find(tmp_path, **kwargs) == set(expected_modules)
- @pytest.mark.skipif(not os_helper.can_symlink(), reason='Symlink support required')
+ @pytest.mark.skipif(not os_helper.can_symlink(), reason="Symlink support required")
def test_symlinked_packages_are_included(self, tmp_path):
src = "_myfiles/file.py"
ensure_files(tmp_path, [src])
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_glob.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_glob.py
index 8d225a44..197e1a94 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_glob.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_glob.py
@@ -5,10 +5,10 @@
@pytest.mark.parametrize(
- ('tree', 'pattern', 'matches'),
+ ("tree", "pattern", "matches"),
(
- ('', b'', []),
- ('', '', []),
+ ("", b"", []),
+ ("", "", []),
(
"""
appveyor.yml
@@ -20,8 +20,8 @@
setup.cfg
setup.py
""",
- '*.rst',
- ('CHANGES.rst', 'README.rst'),
+ "*.rst",
+ ("CHANGES.rst", "README.rst"),
),
(
"""
@@ -34,12 +34,12 @@
setup.cfg
setup.py
""",
- b'*.rst',
- (b'CHANGES.rst', b'README.rst'),
+ b"*.rst",
+ (b"CHANGES.rst", b"README.rst"),
),
),
)
def test_glob(monkeypatch, tmpdir, tree, pattern, matches):
monkeypatch.chdir(tmpdir)
- path.build({name: '' for name in tree.split()})
- assert list(sorted(glob(pattern))) == list(sorted(matches))
+ path.build(dict.fromkeys(tree.split(), ""))
+ assert sorted(glob(pattern)) == sorted(matches)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_install_scripts.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_install_scripts.py
index e62a6b7f..f36ac8e4 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_install_scripts.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_install_scripts.py
@@ -12,69 +12,69 @@
class TestInstallScripts:
settings = dict(
- name='foo',
- entry_points={'console_scripts': ['foo=foo:foo']},
- version='0.0',
+ name="foo",
+ entry_points={"console_scripts": ["foo=foo:foo"]},
+ version="0.0",
)
- unix_exe = '/usr/dummy-test-path/local/bin/python'
- unix_spaces_exe = '/usr/bin/env dummy-test-python'
- win32_exe = 'C:\\Dummy Test Path\\Program Files\\Python 3.6\\python.exe'
+ unix_exe = "/usr/dummy-test-path/local/bin/python"
+ unix_spaces_exe = "/usr/bin/env dummy-test-python"
+ win32_exe = "C:\\Dummy Test Path\\Program Files\\Python 3.6\\python.exe"
def _run_install_scripts(self, install_dir, executable=None):
dist = Distribution(self.settings)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = install_scripts(dist)
cmd.install_dir = install_dir
if executable is not None:
- bs = cmd.get_finalized_command('build_scripts')
+ bs = cmd.get_finalized_command("build_scripts")
bs.executable = executable
cmd.ensure_finalized()
with contexts.quiet():
cmd.run()
- @pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only')
+ @pytest.mark.skipif(sys.platform == "win32", reason="non-Windows only")
def test_sys_executable_escaping_unix(self, tmpdir, monkeypatch):
"""
Ensure that shebang is not quoted on Unix when getting the Python exe
from sys.executable.
"""
- expected = f'#!{self.unix_exe}\n'
- monkeypatch.setattr('sys.executable', self.unix_exe)
+ expected = f"#!{self.unix_exe}\n"
+ monkeypatch.setattr("sys.executable", self.unix_exe)
with tmpdir.as_cwd():
self._run_install_scripts(str(tmpdir))
- with open(str(tmpdir.join('foo')), 'r', encoding="utf-8") as f:
+ with open(str(tmpdir.join("foo")), "r", encoding="utf-8") as f:
actual = f.readline()
assert actual == expected
- @pytest.mark.skipif(sys.platform != 'win32', reason='Windows only')
+ @pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
def test_sys_executable_escaping_win32(self, tmpdir, monkeypatch):
"""
Ensure that shebang is quoted on Windows when getting the Python exe
from sys.executable and it contains a space.
"""
expected = f'#!"{self.win32_exe}"\n'
- monkeypatch.setattr('sys.executable', self.win32_exe)
+ monkeypatch.setattr("sys.executable", self.win32_exe)
with tmpdir.as_cwd():
self._run_install_scripts(str(tmpdir))
- with open(str(tmpdir.join('foo-script.py')), 'r', encoding="utf-8") as f:
+ with open(str(tmpdir.join("foo-script.py")), "r", encoding="utf-8") as f:
actual = f.readline()
assert actual == expected
- @pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only')
+ @pytest.mark.skipif(sys.platform == "win32", reason="non-Windows only")
def test_executable_with_spaces_escaping_unix(self, tmpdir):
"""
Ensure that shebang on Unix is not quoted, even when
a value with spaces
is specified using --executable.
"""
- expected = f'#!{self.unix_spaces_exe}\n'
+ expected = f"#!{self.unix_spaces_exe}\n"
with tmpdir.as_cwd():
self._run_install_scripts(str(tmpdir), self.unix_spaces_exe)
- with open(str(tmpdir.join('foo')), 'r', encoding="utf-8") as f:
+ with open(str(tmpdir.join("foo")), "r", encoding="utf-8") as f:
actual = f.readline()
assert actual == expected
- @pytest.mark.skipif(sys.platform != 'win32', reason='Windows only')
+ @pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
def test_executable_arg_escaping_win32(self, tmpdir):
"""
Ensure that shebang on Windows is quoted when
@@ -84,6 +84,6 @@ def test_executable_arg_escaping_win32(self, tmpdir):
expected = f'#!"{self.win32_exe}"\n'
with tmpdir.as_cwd():
self._run_install_scripts(str(tmpdir), '"' + self.win32_exe + '"')
- with open(str(tmpdir.join('foo-script.py')), 'r', encoding="utf-8") as f:
+ with open(str(tmpdir.join("foo-script.py")), "r", encoding="utf-8") as f:
actual = f.readline()
assert actual == expected
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_logging.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_logging.py
index ea58001e..b09201b7 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_logging.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_logging.py
@@ -5,7 +5,7 @@
import pytest
-IS_PYPY = '__pypy__' in sys.builtin_module_names
+IS_PYPY = "__pypy__" in sys.builtin_module_names
setup_py = """\
@@ -19,7 +19,7 @@
@pytest.mark.parametrize(
- ('flag', 'expected_level'), [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
+ ("flag", "expected_level"), [("--dry-run", "INFO"), ("--verbose", "DEBUG")]
)
def test_verbosity_level(tmp_path, monkeypatch, flag, expected_level):
"""Make sure the correct verbosity level is set (issue #3038)"""
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_manifest.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_manifest.py
index 903a528d..8d453675 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_manifest.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_manifest.py
@@ -20,18 +20,18 @@
from distutils import log
from distutils.errors import DistutilsTemplateError
-IS_PYPY = '__pypy__' in sys.builtin_module_names
+IS_PYPY = "__pypy__" in sys.builtin_module_names
def make_local_path(s):
"""Converts '/' in a string to os.sep"""
- return s.replace('/', os.sep)
+ return s.replace("/", os.sep)
SETUP_ATTRS = {
- 'name': 'app',
- 'version': '0.0',
- 'packages': ['app'],
+ "name": "app",
+ "version": "0.0",
+ "packages": ["app"],
}
SETUP_PY = f"""\
@@ -52,7 +52,7 @@ def quiet():
def touch(filename):
- open(filename, 'wb').close()
+ open(filename, "wb").close()
# The set of files always in the manifest, including all files in the
@@ -61,63 +61,63 @@ def touch(filename):
map(
make_local_path,
[
- 'README.rst',
- 'MANIFEST.in',
- 'setup.py',
- 'app.egg-info/PKG-INFO',
- 'app.egg-info/SOURCES.txt',
- 'app.egg-info/dependency_links.txt',
- 'app.egg-info/top_level.txt',
- 'app/__init__.py',
+ "README.rst",
+ "MANIFEST.in",
+ "setup.py",
+ "app.egg-info/PKG-INFO",
+ "app.egg-info/SOURCES.txt",
+ "app.egg-info/dependency_links.txt",
+ "app.egg-info/top_level.txt",
+ "app/__init__.py",
],
)
)
translate_specs: list[tuple[str, list[str], list[str]]] = [
- ('foo', ['foo'], ['bar', 'foobar']),
- ('foo/bar', ['foo/bar'], ['foo/bar/baz', './foo/bar', 'foo']),
+ ("foo", ["foo"], ["bar", "foobar"]),
+ ("foo/bar", ["foo/bar"], ["foo/bar/baz", "./foo/bar", "foo"]),
# Glob matching
- ('*.txt', ['foo.txt', 'bar.txt'], ['foo/foo.txt']),
- ('dir/*.txt', ['dir/foo.txt', 'dir/bar.txt', 'dir/.txt'], ['notdir/foo.txt']),
- ('*/*.py', ['bin/start.py'], []),
- ('docs/page-?.txt', ['docs/page-9.txt'], ['docs/page-10.txt']),
+ ("*.txt", ["foo.txt", "bar.txt"], ["foo/foo.txt"]),
+ ("dir/*.txt", ["dir/foo.txt", "dir/bar.txt", "dir/.txt"], ["notdir/foo.txt"]),
+ ("*/*.py", ["bin/start.py"], []),
+ ("docs/page-?.txt", ["docs/page-9.txt"], ["docs/page-10.txt"]),
# Globstars change what they mean depending upon where they are
(
- 'foo/**/bar',
- ['foo/bing/bar', 'foo/bing/bang/bar', 'foo/bar'],
- ['foo/abar'],
+ "foo/**/bar",
+ ["foo/bing/bar", "foo/bing/bang/bar", "foo/bar"],
+ ["foo/abar"],
),
(
- 'foo/**',
- ['foo/bar/bing.py', 'foo/x'],
- ['/foo/x'],
+ "foo/**",
+ ["foo/bar/bing.py", "foo/x"],
+ ["/foo/x"],
),
(
- '**',
- ['x', 'abc/xyz', '@nything'],
+ "**",
+ ["x", "abc/xyz", "@nything"],
[],
),
# Character classes
(
- 'pre[one]post',
- ['preopost', 'prenpost', 'preepost'],
- ['prepost', 'preonepost'],
+ "pre[one]post",
+ ["preopost", "prenpost", "preepost"],
+ ["prepost", "preonepost"],
),
(
- 'hello[!one]world',
- ['helloxworld', 'helloyworld'],
- ['hellooworld', 'helloworld', 'hellooneworld'],
+ "hello[!one]world",
+ ["helloxworld", "helloyworld"],
+ ["hellooworld", "helloworld", "hellooneworld"],
),
(
- '[]one].txt',
- ['o.txt', '].txt', 'e.txt'],
- ['one].txt'],
+ "[]one].txt",
+ ["o.txt", "].txt", "e.txt"],
+ ["one].txt"],
),
(
- 'foo[!]one]bar',
- ['fooybar'],
- ['foo]bar', 'fooobar', 'fooebar'],
+ "foo[!]one]bar",
+ ["fooybar"],
+ ["foo]bar", "fooobar", "fooebar"],
),
]
"""
@@ -172,7 +172,7 @@ class TestManifestTest(TempDirTestCase):
def setup_method(self, method):
super().setup_method(method)
- f = open(os.path.join(self.temp_dir, 'setup.py'), 'w', encoding="utf-8")
+ f = open(os.path.join(self.temp_dir, "setup.py"), "w", encoding="utf-8")
f.write(SETUP_PY)
f.close()
"""
@@ -193,31 +193,31 @@ def setup_method(self, method):
- app.css.map
"""
- for fname in ['README.rst', '.hidden.rst', 'testing.rst', 'LICENSE']:
+ for fname in ["README.rst", ".hidden.rst", "testing.rst", "LICENSE"]:
touch(os.path.join(self.temp_dir, fname))
# Set up the rest of the test package
- test_pkg = os.path.join(self.temp_dir, 'app')
+ test_pkg = os.path.join(self.temp_dir, "app")
os.mkdir(test_pkg)
- for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst']:
+ for fname in ["__init__.py", "a.txt", "b.txt", "c.rst"]:
touch(os.path.join(test_pkg, fname))
# Some compiled front-end assets to include
- static = os.path.join(test_pkg, 'static')
+ static = os.path.join(test_pkg, "static")
os.mkdir(static)
- for fname in ['app.js', 'app.js.map', 'app.css', 'app.css.map']:
+ for fname in ["app.js", "app.js.map", "app.css", "app.css.map"]:
touch(os.path.join(static, fname))
def make_manifest(self, contents):
"""Write a MANIFEST.in."""
- manifest = os.path.join(self.temp_dir, 'MANIFEST.in')
- with open(manifest, 'w', encoding="utf-8") as f:
+ manifest = os.path.join(self.temp_dir, "MANIFEST.in")
+ with open(manifest, "w", encoding="utf-8") as f:
f.write(DALS(contents))
def get_files(self):
"""Run egg_info and get all the files to include, as a set"""
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = egg_info(dist)
cmd.ensure_finalized()
@@ -227,7 +227,7 @@ def get_files(self):
def test_no_manifest(self):
"""Check a missing MANIFEST.in includes only the standard files."""
- assert (default_files - set(['MANIFEST.in'])) == self.get_files()
+ assert (default_files - set(["MANIFEST.in"])) == self.get_files()
def test_empty_files(self):
"""Check an empty MANIFEST.in includes only the standard files."""
@@ -237,7 +237,7 @@ def test_empty_files(self):
def test_include(self):
"""Include extra rst files in the project root."""
self.make_manifest("include *.rst")
- files = default_files | set(['testing.rst', '.hidden.rst'])
+ files = default_files | set(["testing.rst", ".hidden.rst"])
assert files == self.get_files()
def test_exclude(self):
@@ -249,7 +249,7 @@ def test_exclude(self):
exclude app/*.txt
"""
)
- files = default_files | set([ml('app/c.rst')])
+ files = default_files | set([ml("app/c.rst")])
assert files == self.get_files()
def test_include_multiple(self):
@@ -257,12 +257,12 @@ def test_include_multiple(self):
ml = make_local_path
self.make_manifest("include app/*.txt app/static/*")
files = default_files | set([
- ml('app/a.txt'),
- ml('app/b.txt'),
- ml('app/static/app.js'),
- ml('app/static/app.js.map'),
- ml('app/static/app.css'),
- ml('app/static/app.css.map'),
+ ml("app/a.txt"),
+ ml("app/b.txt"),
+ ml("app/static/app.js"),
+ ml("app/static/app.js.map"),
+ ml("app/static/app.css"),
+ ml("app/static/app.css.map"),
])
assert files == self.get_files()
@@ -271,10 +271,10 @@ def test_graft(self):
ml = make_local_path
self.make_manifest("graft app/static")
files = default_files | set([
- ml('app/static/app.js'),
- ml('app/static/app.js.map'),
- ml('app/static/app.css'),
- ml('app/static/app.css.map'),
+ ml("app/static/app.js"),
+ ml("app/static/app.js.map"),
+ ml("app/static/app.css"),
+ ml("app/static/app.css.map"),
])
assert files == self.get_files()
@@ -283,10 +283,10 @@ def test_graft_glob_syntax(self):
ml = make_local_path
self.make_manifest("graft */static")
files = default_files | set([
- ml('app/static/app.js'),
- ml('app/static/app.js.map'),
- ml('app/static/app.css'),
- ml('app/static/app.css.map'),
+ ml("app/static/app.js"),
+ ml("app/static/app.js.map"),
+ ml("app/static/app.css"),
+ ml("app/static/app.css.map"),
])
assert files == self.get_files()
@@ -299,7 +299,7 @@ def test_graft_global_exclude(self):
global-exclude *.map
"""
)
- files = default_files | set([ml('app/static/app.js'), ml('app/static/app.css')])
+ files = default_files | set([ml("app/static/app.js"), ml("app/static/app.css")])
assert files == self.get_files()
def test_global_include(self):
@@ -311,11 +311,11 @@ def test_global_include(self):
"""
)
files = default_files | set([
- '.hidden.rst',
- 'testing.rst',
- ml('app/c.rst'),
- ml('app/static/app.js'),
- ml('app/static/app.css'),
+ ".hidden.rst",
+ "testing.rst",
+ ml("app/c.rst"),
+ ml("app/static/app.js"),
+ ml("app/static/app.css"),
])
assert files == self.get_files()
@@ -328,7 +328,7 @@ def test_graft_prune(self):
prune app/static
"""
)
- files = default_files | set([ml('app/a.txt'), ml('app/b.txt'), ml('app/c.rst')])
+ files = default_files | set([ml("app/a.txt"), ml("app/b.txt"), ml("app/c.rst")])
assert files == self.get_files()
@@ -377,23 +377,23 @@ def test_process_template_line(self):
# simulated file list
self.make_files([
- 'foo.tmp',
- 'ok',
- 'xo',
- 'four.txt',
- 'buildout.cfg',
+ "foo.tmp",
+ "ok",
+ "xo",
+ "four.txt",
+ "buildout.cfg",
# filelist does not filter out VCS directories,
# it's sdist that does
- ml('.hg/last-message.txt'),
- ml('global/one.txt'),
- ml('global/two.txt'),
- ml('global/files.x'),
- ml('global/here.tmp'),
- ml('f/o/f.oo'),
- ml('dir/graft-one'),
- ml('dir/dir2/graft2'),
- ml('dir3/ok'),
- ml('dir3/sub/ok.txt'),
+ ml(".hg/last-message.txt"),
+ ml("global/one.txt"),
+ ml("global/two.txt"),
+ ml("global/files.x"),
+ ml("global/here.tmp"),
+ ml("f/o/f.oo"),
+ ml("dir/graft-one"),
+ ml("dir/dir2/graft2"),
+ ml("dir3/ok"),
+ ml("dir3/sub/ok.txt"),
])
MANIFEST_IN = DALS(
@@ -413,21 +413,21 @@ def test_process_template_line(self):
"""
)
- for line in MANIFEST_IN.split('\n'):
+ for line in MANIFEST_IN.split("\n"):
if not line:
continue
file_list.process_template_line(line)
wanted = [
- 'buildout.cfg',
- 'four.txt',
- 'ok',
- ml('.hg/last-message.txt'),
- ml('dir/graft-one'),
- ml('dir/dir2/graft2'),
- ml('f/o/f.oo'),
- ml('global/one.txt'),
- ml('global/two.txt'),
+ "buildout.cfg",
+ "four.txt",
+ "ok",
+ ml(".hg/last-message.txt"),
+ ml("dir/graft-one"),
+ ml("dir/dir2/graft2"),
+ ml("f/o/f.oo"),
+ ml("global/one.txt"),
+ ml("global/two.txt"),
]
file_list.sort()
@@ -436,51 +436,51 @@ def test_process_template_line(self):
def test_exclude_pattern(self):
# return False if no match
file_list = FileList()
- assert not file_list.exclude_pattern('*.py')
+ assert not file_list.exclude_pattern("*.py")
# return True if files match
file_list = FileList()
- file_list.files = ['a.py', 'b.py']
- assert file_list.exclude_pattern('*.py')
+ file_list.files = ["a.py", "b.py"]
+ assert file_list.exclude_pattern("*.py")
# test excludes
file_list = FileList()
- file_list.files = ['a.py', 'a.txt']
- file_list.exclude_pattern('*.py')
+ file_list.files = ["a.py", "a.txt"]
+ file_list.exclude_pattern("*.py")
file_list.sort()
- assert file_list.files == ['a.txt']
+ assert file_list.files == ["a.txt"]
def test_include_pattern(self):
# return False if no match
file_list = FileList()
self.make_files([])
- assert not file_list.include_pattern('*.py')
+ assert not file_list.include_pattern("*.py")
# return True if files match
file_list = FileList()
- self.make_files(['a.py', 'b.txt'])
- assert file_list.include_pattern('*.py')
+ self.make_files(["a.py", "b.txt"])
+ assert file_list.include_pattern("*.py")
# test * matches all files
file_list = FileList()
- self.make_files(['a.py', 'b.txt'])
- file_list.include_pattern('*')
+ self.make_files(["a.py", "b.txt"])
+ file_list.include_pattern("*")
file_list.sort()
- assert file_list.files == ['a.py', 'b.txt']
+ assert file_list.files == ["a.py", "b.txt"]
def test_process_template_line_invalid(self):
# invalid lines
file_list = FileList()
for action in (
- 'include',
- 'exclude',
- 'global-include',
- 'global-exclude',
- 'recursive-include',
- 'recursive-exclude',
- 'graft',
- 'prune',
- 'blarg',
+ "include",
+ "exclude",
+ "global-include",
+ "global-exclude",
+ "recursive-include",
+ "recursive-exclude",
+ "graft",
+ "prune",
+ "blarg",
):
with pytest.raises(DistutilsTemplateError):
file_list.process_template_line(action)
@@ -490,16 +490,16 @@ def test_include(self, caplog):
ml = make_local_path
# include
file_list = FileList()
- self.make_files(['a.py', 'b.txt', ml('d/c.py')])
+ self.make_files(["a.py", "b.txt", ml("d/c.py")])
- file_list.process_template_line('include *.py')
+ file_list.process_template_line("include *.py")
file_list.sort()
- assert file_list.files == ['a.py']
+ assert file_list.files == ["a.py"]
self.assertNoWarnings(caplog)
- file_list.process_template_line('include *.rb')
+ file_list.process_template_line("include *.rb")
file_list.sort()
- assert file_list.files == ['a.py']
+ assert file_list.files == ["a.py"]
self.assertWarnings(caplog)
def test_exclude(self, caplog):
@@ -507,16 +507,16 @@ def test_exclude(self, caplog):
ml = make_local_path
# exclude
file_list = FileList()
- file_list.files = ['a.py', 'b.txt', ml('d/c.py')]
+ file_list.files = ["a.py", "b.txt", ml("d/c.py")]
- file_list.process_template_line('exclude *.py')
+ file_list.process_template_line("exclude *.py")
file_list.sort()
- assert file_list.files == ['b.txt', ml('d/c.py')]
+ assert file_list.files == ["b.txt", ml("d/c.py")]
self.assertNoWarnings(caplog)
- file_list.process_template_line('exclude *.rb')
+ file_list.process_template_line("exclude *.rb")
file_list.sort()
- assert file_list.files == ['b.txt', ml('d/c.py')]
+ assert file_list.files == ["b.txt", ml("d/c.py")]
self.assertWarnings(caplog)
def test_global_include(self, caplog):
@@ -524,16 +524,16 @@ def test_global_include(self, caplog):
ml = make_local_path
# global-include
file_list = FileList()
- self.make_files(['a.py', 'b.txt', ml('d/c.py')])
+ self.make_files(["a.py", "b.txt", ml("d/c.py")])
- file_list.process_template_line('global-include *.py')
+ file_list.process_template_line("global-include *.py")
file_list.sort()
- assert file_list.files == ['a.py', ml('d/c.py')]
+ assert file_list.files == ["a.py", ml("d/c.py")]
self.assertNoWarnings(caplog)
- file_list.process_template_line('global-include *.rb')
+ file_list.process_template_line("global-include *.rb")
file_list.sort()
- assert file_list.files == ['a.py', ml('d/c.py')]
+ assert file_list.files == ["a.py", ml("d/c.py")]
self.assertWarnings(caplog)
def test_global_exclude(self, caplog):
@@ -541,16 +541,16 @@ def test_global_exclude(self, caplog):
ml = make_local_path
# global-exclude
file_list = FileList()
- file_list.files = ['a.py', 'b.txt', ml('d/c.py')]
+ file_list.files = ["a.py", "b.txt", ml("d/c.py")]
- file_list.process_template_line('global-exclude *.py')
+ file_list.process_template_line("global-exclude *.py")
file_list.sort()
- assert file_list.files == ['b.txt']
+ assert file_list.files == ["b.txt"]
self.assertNoWarnings(caplog)
- file_list.process_template_line('global-exclude *.rb')
+ file_list.process_template_line("global-exclude *.rb")
file_list.sort()
- assert file_list.files == ['b.txt']
+ assert file_list.files == ["b.txt"]
self.assertWarnings(caplog)
def test_recursive_include(self, caplog):
@@ -558,16 +558,16 @@ def test_recursive_include(self, caplog):
ml = make_local_path
# recursive-include
file_list = FileList()
- self.make_files(['a.py', ml('d/b.py'), ml('d/c.txt'), ml('d/d/e.py')])
+ self.make_files(["a.py", ml("d/b.py"), ml("d/c.txt"), ml("d/d/e.py")])
- file_list.process_template_line('recursive-include d *.py')
+ file_list.process_template_line("recursive-include d *.py")
file_list.sort()
- assert file_list.files == [ml('d/b.py'), ml('d/d/e.py')]
+ assert file_list.files == [ml("d/b.py"), ml("d/d/e.py")]
self.assertNoWarnings(caplog)
- file_list.process_template_line('recursive-include e *.py')
+ file_list.process_template_line("recursive-include e *.py")
file_list.sort()
- assert file_list.files == [ml('d/b.py'), ml('d/d/e.py')]
+ assert file_list.files == [ml("d/b.py"), ml("d/d/e.py")]
self.assertWarnings(caplog)
def test_recursive_exclude(self, caplog):
@@ -575,16 +575,16 @@ def test_recursive_exclude(self, caplog):
ml = make_local_path
# recursive-exclude
file_list = FileList()
- file_list.files = ['a.py', ml('d/b.py'), ml('d/c.txt'), ml('d/d/e.py')]
+ file_list.files = ["a.py", ml("d/b.py"), ml("d/c.txt"), ml("d/d/e.py")]
- file_list.process_template_line('recursive-exclude d *.py')
+ file_list.process_template_line("recursive-exclude d *.py")
file_list.sort()
- assert file_list.files == ['a.py', ml('d/c.txt')]
+ assert file_list.files == ["a.py", ml("d/c.txt")]
self.assertNoWarnings(caplog)
- file_list.process_template_line('recursive-exclude e *.py')
+ file_list.process_template_line("recursive-exclude e *.py")
file_list.sort()
- assert file_list.files == ['a.py', ml('d/c.txt')]
+ assert file_list.files == ["a.py", ml("d/c.txt")]
self.assertWarnings(caplog)
def test_graft(self, caplog):
@@ -592,16 +592,16 @@ def test_graft(self, caplog):
ml = make_local_path
# graft
file_list = FileList()
- self.make_files(['a.py', ml('d/b.py'), ml('d/d/e.py'), ml('f/f.py')])
+ self.make_files(["a.py", ml("d/b.py"), ml("d/d/e.py"), ml("f/f.py")])
- file_list.process_template_line('graft d')
+ file_list.process_template_line("graft d")
file_list.sort()
- assert file_list.files == [ml('d/b.py'), ml('d/d/e.py')]
+ assert file_list.files == [ml("d/b.py"), ml("d/d/e.py")]
self.assertNoWarnings(caplog)
- file_list.process_template_line('graft e')
+ file_list.process_template_line("graft e")
file_list.sort()
- assert file_list.files == [ml('d/b.py'), ml('d/d/e.py')]
+ assert file_list.files == [ml("d/b.py"), ml("d/d/e.py")]
self.assertWarnings(caplog)
def test_prune(self, caplog):
@@ -609,14 +609,14 @@ def test_prune(self, caplog):
ml = make_local_path
# prune
file_list = FileList()
- file_list.files = ['a.py', ml('d/b.py'), ml('d/d/e.py'), ml('f/f.py')]
+ file_list.files = ["a.py", ml("d/b.py"), ml("d/d/e.py"), ml("f/f.py")]
- file_list.process_template_line('prune d')
+ file_list.process_template_line("prune d")
file_list.sort()
- assert file_list.files == ['a.py', ml('f/f.py')]
+ assert file_list.files == ["a.py", ml("f/f.py")]
self.assertNoWarnings(caplog)
- file_list.process_template_line('prune e')
+ file_list.process_template_line("prune e")
file_list.sort()
- assert file_list.files == ['a.py', ml('f/f.py')]
+ assert file_list.files == ["a.py", ml("f/f.py")]
self.assertWarnings(caplog)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_namespaces.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_namespaces.py
index a0f4120b..8c9f1edc 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_namespaces.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_namespaces.py
@@ -14,37 +14,37 @@ def test_mixed_site_and_non_site(self, tmpdir):
should leave the namespace in tact and both packages reachable by
import.
"""
- pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
- pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
- site_packages = tmpdir / 'site-packages'
- path_packages = tmpdir / 'path-packages'
+ pkg_A = namespaces.build_namespace_package(tmpdir, "myns.pkgA")
+ pkg_B = namespaces.build_namespace_package(tmpdir, "myns.pkgB")
+ site_packages = tmpdir / "site-packages"
+ path_packages = tmpdir / "path-packages"
targets = site_packages, path_packages
# use pip to install to the target directory
install_cmd = [
sys.executable,
- '-m',
- 'pip.__main__',
- 'install',
+ "-m",
+ "pip.__main__",
+ "install",
str(pkg_A),
- '-t',
+ "-t",
str(site_packages),
]
subprocess.check_call(install_cmd)
namespaces.make_site_dir(site_packages)
install_cmd = [
sys.executable,
- '-m',
- 'pip.__main__',
- 'install',
+ "-m",
+ "pip.__main__",
+ "install",
str(pkg_B),
- '-t',
+ "-t",
str(path_packages),
]
subprocess.check_call(install_cmd)
try_import = [
sys.executable,
- '-c',
- 'import myns.pkgA; import myns.pkgB',
+ "-c",
+ "import myns.pkgA; import myns.pkgB",
]
with paths_on_pythonpath(map(str, targets)):
subprocess.check_call(try_import)
@@ -54,15 +54,15 @@ def test_pkg_resources_import(self, tmpdir):
Ensure that a namespace package doesn't break on import
of pkg_resources.
"""
- pkg = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
- target = tmpdir / 'packages'
+ pkg = namespaces.build_namespace_package(tmpdir, "myns.pkgA")
+ target = tmpdir / "packages"
target.mkdir()
install_cmd = [
sys.executable,
- '-m',
- 'pip',
- 'install',
- '-t',
+ "-m",
+ "pip",
+ "install",
+ "-t",
str(target),
str(pkg),
]
@@ -71,8 +71,8 @@ def test_pkg_resources_import(self, tmpdir):
namespaces.make_site_dir(target)
try_import = [
sys.executable,
- '-c',
- 'import pkg_resources',
+ "-c",
+ "import pkg_resources",
]
with paths_on_pythonpath([str(target)]):
subprocess.check_call(try_import)
@@ -82,16 +82,16 @@ def test_namespace_package_installed_and_cwd(self, tmpdir):
Installing a namespace packages but also having it in the current
working directory, only one version should take precedence.
"""
- pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
- target = tmpdir / 'packages'
+ pkg_A = namespaces.build_namespace_package(tmpdir, "myns.pkgA")
+ target = tmpdir / "packages"
# use pip to install to the target directory
install_cmd = [
sys.executable,
- '-m',
- 'pip.__main__',
- 'install',
+ "-m",
+ "pip.__main__",
+ "install",
str(pkg_A),
- '-t',
+ "-t",
str(target),
]
subprocess.check_call(install_cmd)
@@ -100,8 +100,8 @@ def test_namespace_package_installed_and_cwd(self, tmpdir):
# ensure that package imports and pkg_resources imports
pkg_resources_imp = [
sys.executable,
- '-c',
- 'import pkg_resources; import myns.pkgA',
+ "-c",
+ "import pkg_resources; import myns.pkgA",
]
with paths_on_pythonpath([str(target)]):
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_A))
@@ -112,17 +112,17 @@ def test_packages_in_the_same_namespace_installed_and_cwd(self, tmpdir):
namespace in the current working directory, both of them must be
importable.
"""
- pkg_A = namespaces.build_namespace_package(tmpdir, 'myns.pkgA')
- pkg_B = namespaces.build_namespace_package(tmpdir, 'myns.pkgB')
- target = tmpdir / 'packages'
+ pkg_A = namespaces.build_namespace_package(tmpdir, "myns.pkgA")
+ pkg_B = namespaces.build_namespace_package(tmpdir, "myns.pkgB")
+ target = tmpdir / "packages"
# use pip to install to the target directory
install_cmd = [
sys.executable,
- '-m',
- 'pip.__main__',
- 'install',
+ "-m",
+ "pip.__main__",
+ "install",
str(pkg_A),
- '-t',
+ "-t",
str(target),
]
subprocess.check_call(install_cmd)
@@ -131,8 +131,8 @@ def test_packages_in_the_same_namespace_installed_and_cwd(self, tmpdir):
# ensure that all packages import and pkg_resources imports
pkg_resources_imp = [
sys.executable,
- '-c',
- 'import pkg_resources; import myns.pkgA; import myns.pkgB',
+ "-c",
+ "import pkg_resources; import myns.pkgA; import myns.pkgB",
]
with paths_on_pythonpath([str(target)]):
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_B))
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_scripts.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_scripts.py
index 8641f7b6..164fb32d 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_scripts.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_scripts.py
@@ -3,10 +3,10 @@
class TestWindowsScriptWriter:
def test_header(self):
- hdr = _scripts.WindowsScriptWriter.get_header('')
- assert hdr.startswith('#!')
- assert hdr.endswith('\n')
- hdr = hdr.lstrip('#!')
- hdr = hdr.rstrip('\n')
+ hdr = _scripts.WindowsScriptWriter.get_header("")
+ assert hdr.startswith("#!")
+ assert hdr.endswith("\n")
+ hdr = hdr.lstrip("#!")
+ hdr = hdr.rstrip("\n")
# header should not start with an escaped quote
assert not hdr.startswith('\\"')
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_sdist.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_sdist.py
index 19d8ddf6..fed5cfca 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_sdist.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_sdist.py
@@ -30,11 +30,11 @@
from distutils.core import run_setup
SETUP_ATTRS = {
- 'name': 'sdist_test',
- 'version': '0.0',
- 'packages': ['sdist_test'],
- 'package_data': {'sdist_test': ['*.txt']},
- 'data_files': [("data", [os.path.join("d", "e.dat")])],
+ "name": "sdist_test",
+ "version": "0.0",
+ "packages": ["sdist_test"],
+ "package_data": {"sdist_test": ["*.txt"]},
+ "data_files": [("data", [os.path.join("d", "e.dat")])],
}
SETUP_PY = f"""\
@@ -64,26 +64,26 @@ def quiet():
# Convert to POSIX path
def posix(path):
if not isinstance(path, str):
- return path.replace(os.sep.encode('ascii'), b'/')
+ return path.replace(os.sep.encode("ascii"), b"/")
else:
- return path.replace(os.sep, '/')
+ return path.replace(os.sep, "/")
# HFS Plus uses decomposed UTF-8
def decompose(path):
if isinstance(path, str):
- return unicodedata.normalize('NFD', path)
+ return unicodedata.normalize("NFD", path)
try:
- path = path.decode('utf-8')
- path = unicodedata.normalize('NFD', path)
- path = path.encode('utf-8')
+ path = path.decode("utf-8")
+ path = unicodedata.normalize("NFD", path)
+ path = path.encode("utf-8")
except UnicodeError:
pass # Not UTF-8
return path
def read_all_bytes(filename):
- with open(filename, 'rb') as fp:
+ with open(filename, "rb") as fp:
return fp.read()
@@ -107,13 +107,13 @@ def latin1_fail():
reason="pytest-dev/pytest-xdist#843",
)
skip_under_stdlib_distutils = pytest.mark.skipif(
- not distutils.__package__.startswith('setuptools'),
+ not distutils.__package__.startswith("setuptools"),
reason="the test is not supported with stdlib distutils",
)
def touch(path):
- open(path, 'wb').close()
+ open(path, "wb").close()
return path
@@ -132,18 +132,18 @@ def source_dir(self, tmpdir):
tmpdir = tmpdir / "project_root"
tmpdir.mkdir()
- (tmpdir / 'setup.py').write_text(SETUP_PY, encoding='utf-8')
+ (tmpdir / "setup.py").write_text(SETUP_PY, encoding="utf-8")
# Set up the rest of the test package
- test_pkg = tmpdir / 'sdist_test'
+ test_pkg = tmpdir / "sdist_test"
test_pkg.mkdir()
- data_folder = tmpdir / 'd'
+ data_folder = tmpdir / "d"
data_folder.mkdir()
# *.rst was not included in package_data, so c.rst should not be
# automatically added to the manifest when not under version control
- for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst']:
+ for fname in ["__init__.py", "a.txt", "b.txt", "c.rst"]:
touch(test_pkg / fname)
- touch(data_folder / 'e.dat')
+ touch(data_folder / "e.dat")
# C sources are not included by default, but they will be,
# if an extension module uses them as sources or depends
for fname in EXTENSION_SOURCES:
@@ -154,16 +154,16 @@ def source_dir(self, tmpdir):
def assert_package_data_in_manifest(self, cmd):
manifest = cmd.filelist.files
- assert os.path.join('sdist_test', 'a.txt') in manifest
- assert os.path.join('sdist_test', 'b.txt') in manifest
- assert os.path.join('sdist_test', 'c.rst') not in manifest
- assert os.path.join('d', 'e.dat') in manifest
+ assert os.path.join("sdist_test", "a.txt") in manifest
+ assert os.path.join("sdist_test", "b.txt") in manifest
+ assert os.path.join("sdist_test", "c.rst") not in manifest
+ assert os.path.join("d", "e.dat") in manifest
def setup_with_extension(self):
- setup_attrs = {**SETUP_ATTRS, 'ext_modules': [EXTENSION]}
+ setup_attrs = {**SETUP_ATTRS, "ext_modules": [EXTENSION]}
dist = Distribution(setup_attrs)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -179,7 +179,7 @@ def test_package_data_in_sdist(self):
"""
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -193,11 +193,11 @@ def test_package_data_and_include_package_data_in_sdist(self):
Ensure package_data and include_package_data work
together.
"""
- setup_attrs = {**SETUP_ATTRS, 'include_package_data': True}
- assert setup_attrs['package_data']
+ setup_attrs = {**SETUP_ATTRS, "include_package_data": True}
+ assert setup_attrs["package_data"]
dist = Distribution(setup_attrs)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -290,10 +290,10 @@ def test_invalid_extension_depends(self, reason, caplog):
sources=[],
depends=[invalid_path],
)
- setup_attrs = {**SETUP_ATTRS, 'ext_modules': [extension]}
+ setup_attrs = {**SETUP_ATTRS, "ext_modules": [extension]}
dist = Distribution(setup_attrs)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -335,18 +335,18 @@ def get_data_files(self):
using_custom_command_guard()
return super().get_data_files()
- setup_attrs = {**SETUP_ATTRS, 'include_package_data': True}
- assert setup_attrs['package_data']
+ setup_attrs = {**SETUP_ATTRS, "include_package_data": True}
+ assert setup_attrs["package_data"]
dist = Distribution(setup_attrs)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
# Make sure we use the custom command
- cmd.cmdclass = {'build_py': CustomBuildPy}
- cmd.distribution.cmdclass = {'build_py': CustomBuildPy}
- assert cmd.distribution.get_command_class('build_py') == CustomBuildPy
+ cmd.cmdclass = {"build_py": CustomBuildPy}
+ cmd.distribution.cmdclass = {"build_py": CustomBuildPy}
+ assert cmd.distribution.get_command_class("build_py") == CustomBuildPy
msg = "setuptools instead of distutils"
with quiet(), pytest.warns(SetuptoolsDeprecationWarning, match=msg):
@@ -357,7 +357,7 @@ def get_data_files(self):
def test_setup_py_exists(self):
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'foo.py'
+ dist.script_name = "foo.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -365,11 +365,11 @@ def test_setup_py_exists(self):
cmd.run()
manifest = cmd.filelist.files
- assert 'setup.py' in manifest
+ assert "setup.py" in manifest
def test_setup_py_missing(self):
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'foo.py'
+ dist.script_name = "foo.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -379,14 +379,14 @@ def test_setup_py_missing(self):
cmd.run()
manifest = cmd.filelist.files
- assert 'setup.py' not in manifest
+ assert "setup.py" not in manifest
def test_setup_py_excluded(self):
with open("MANIFEST.in", "w", encoding="utf-8") as manifest_file:
manifest_file.write("exclude setup.py")
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'foo.py'
+ dist.script_name = "foo.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -394,7 +394,7 @@ def test_setup_py_excluded(self):
cmd.run()
manifest = cmd.filelist.files
- assert 'setup.py' not in manifest
+ assert "setup.py" not in manifest
def test_defaults_case_sensitivity(self, source_dir):
"""
@@ -402,14 +402,14 @@ def test_defaults_case_sensitivity(self, source_dir):
way to avoid problems with packages built on Windows.
"""
- touch(source_dir / 'readme.rst')
- touch(source_dir / 'SETUP.cfg')
+ touch(source_dir / "readme.rst")
+ touch(source_dir / "SETUP.cfg")
dist = Distribution(SETUP_ATTRS)
# the extension deliberately capitalized for this test
# to make sure the actual filename (not capitalized) gets added
# to the manifest
- dist.script_name = 'setup.PY'
+ dist.script_name = "setup.PY"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -420,9 +420,9 @@ def test_defaults_case_sensitivity(self, source_dir):
# case-insensitive way to make sure the files
# are not included.
manifest = map(lambda x: x.lower(), cmd.filelist.files)
- assert 'readme.rst' not in manifest, manifest
- assert 'setup.py' not in manifest, manifest
- assert 'setup.cfg' not in manifest, manifest
+ assert "readme.rst" not in manifest, manifest
+ assert "setup.py" not in manifest, manifest
+ assert "setup.cfg" not in manifest, manifest
def test_exclude_dev_only_cache_folders(self, source_dir):
included = {
@@ -456,7 +456,7 @@ def test_exclude_dev_only_cache_folders(self, source_dir):
cmd = self.setup_with_extension()
self.assert_package_data_in_manifest(cmd)
- manifest = {f.replace(os.sep, '/') for f in cmd.filelist.files}
+ manifest = {f.replace(os.sep, "/") for f in cmd.filelist.files}
for path in excluded:
assert os.path.exists(path)
assert path not in manifest, (path, manifest)
@@ -468,13 +468,13 @@ def test_exclude_dev_only_cache_folders(self, source_dir):
def test_manifest_is_written_with_utf8_encoding(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
mm = manifest_maker(dist)
- mm.manifest = os.path.join('sdist_test.egg-info', 'SOURCES.txt')
- os.mkdir('sdist_test.egg-info')
+ mm.manifest = os.path.join("sdist_test.egg-info", "SOURCES.txt")
+ os.mkdir("sdist_test.egg-info")
# UTF-8 filename
- filename = os.path.join('sdist_test', 'smörbröd.py')
+ filename = os.path.join("sdist_test", "smörbröd.py")
# Must create the file or it will get stripped.
touch(filename)
@@ -488,7 +488,7 @@ def test_manifest_is_written_with_utf8_encoding(self):
contents = read_all_bytes(mm.manifest)
# The manifest should be UTF-8 encoded
- u_contents = contents.decode('UTF-8')
+ u_contents = contents.decode("UTF-8")
# The manifest should contain the UTF-8 filename
assert posix(filename) in u_contents
@@ -497,12 +497,12 @@ def test_manifest_is_written_with_utf8_encoding(self):
def test_write_manifest_allows_utf8_filenames(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
mm = manifest_maker(dist)
- mm.manifest = os.path.join('sdist_test.egg-info', 'SOURCES.txt')
- os.mkdir('sdist_test.egg-info')
+ mm.manifest = os.path.join("sdist_test.egg-info", "SOURCES.txt")
+ os.mkdir("sdist_test.egg-info")
- filename = os.path.join(b'sdist_test', Filenames.utf_8)
+ filename = os.path.join(b"sdist_test", Filenames.utf_8)
# Must touch the file or risk removal
touch(filename)
@@ -510,7 +510,7 @@ def test_write_manifest_allows_utf8_filenames(self):
# Add filename and write manifest
with quiet():
mm.run()
- u_filename = filename.decode('utf-8')
+ u_filename = filename.decode("utf-8")
mm.filelist.files.append(u_filename)
# Re-write manifest
mm.write_manifest()
@@ -518,7 +518,7 @@ def test_write_manifest_allows_utf8_filenames(self):
contents = read_all_bytes(mm.manifest)
# The manifest should be UTF-8 encoded
- contents.decode('UTF-8')
+ contents.decode("UTF-8")
# The manifest should contain the UTF-8 filename
assert posix(filename) in contents
@@ -535,18 +535,18 @@ def test_write_manifest_skips_non_utf8_filenames(self):
See https://bitbucket.org/tarek/distribute/issue/303 for history.
"""
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
mm = manifest_maker(dist)
- mm.manifest = os.path.join('sdist_test.egg-info', 'SOURCES.txt')
- os.mkdir('sdist_test.egg-info')
+ mm.manifest = os.path.join("sdist_test.egg-info", "SOURCES.txt")
+ os.mkdir("sdist_test.egg-info")
# Latin-1 filename
- filename = os.path.join(b'sdist_test', Filenames.latin_1)
+ filename = os.path.join(b"sdist_test", Filenames.latin_1)
# Add filename with surrogates and write manifest
with quiet():
mm.run()
- u_filename = filename.decode('utf-8', 'surrogateescape')
+ u_filename = filename.decode("utf-8", "surrogateescape")
mm.filelist.append(u_filename)
# Re-write manifest
mm.write_manifest()
@@ -554,7 +554,7 @@ def test_write_manifest_skips_non_utf8_filenames(self):
contents = read_all_bytes(mm.manifest)
# The manifest should be UTF-8 encoded
- contents.decode('UTF-8')
+ contents.decode("UTF-8")
# The Latin-1 filename should have been skipped
assert posix(filename) not in contents
@@ -566,7 +566,7 @@ def test_write_manifest_skips_non_utf8_filenames(self):
def test_manifest_is_read_with_utf8_encoding(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -575,10 +575,10 @@ def test_manifest_is_read_with_utf8_encoding(self):
cmd.run()
# Add UTF-8 filename to manifest
- filename = os.path.join(b'sdist_test', Filenames.utf_8)
- cmd.manifest = os.path.join('sdist_test.egg-info', 'SOURCES.txt')
- manifest = open(cmd.manifest, 'ab')
- manifest.write(b'\n' + filename)
+ filename = os.path.join(b"sdist_test", Filenames.utf_8)
+ cmd.manifest = os.path.join("sdist_test.egg-info", "SOURCES.txt")
+ manifest = open(cmd.manifest, "ab")
+ manifest.write(b"\n" + filename)
manifest.close()
# The file must exist to be included in the filelist
@@ -590,14 +590,14 @@ def test_manifest_is_read_with_utf8_encoding(self):
cmd.read_manifest()
# The filelist should contain the UTF-8 filename
- filename = filename.decode('utf-8')
+ filename = filename.decode("utf-8")
assert filename in cmd.filelist.files
@fail_on_latin1_encoded_filenames
def test_read_manifest_skips_non_utf8_filenames(self):
# Test for #303.
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -606,10 +606,10 @@ def test_read_manifest_skips_non_utf8_filenames(self):
cmd.run()
# Add Latin-1 filename to manifest
- filename = os.path.join(b'sdist_test', Filenames.latin_1)
- cmd.manifest = os.path.join('sdist_test.egg-info', 'SOURCES.txt')
- manifest = open(cmd.manifest, 'ab')
- manifest.write(b'\n' + filename)
+ filename = os.path.join(b"sdist_test", Filenames.latin_1)
+ cmd.manifest = os.path.join("sdist_test.egg-info", "SOURCES.txt")
+ manifest = open(cmd.manifest, "ab")
+ manifest.write(b"\n" + filename)
manifest.close()
# The file must exist to be included in the filelist
@@ -621,7 +621,7 @@ def test_read_manifest_skips_non_utf8_filenames(self):
cmd.read_manifest()
# The Latin-1 filename should have been skipped
- filename = filename.decode('latin-1')
+ filename = filename.decode("latin-1")
assert filename not in cmd.filelist.files
@fail_on_ascii
@@ -629,31 +629,31 @@ def test_read_manifest_skips_non_utf8_filenames(self):
def test_sdist_with_utf8_encoded_filename(self):
# Test for #303.
dist = Distribution(self.make_strings(SETUP_ATTRS))
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
- filename = os.path.join(b'sdist_test', Filenames.utf_8)
+ filename = os.path.join(b"sdist_test", Filenames.utf_8)
touch(filename)
with quiet():
cmd.run()
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
filename = decompose(filename)
fs_enc = sys.getfilesystemencoding()
- if sys.platform == 'win32':
- if fs_enc == 'cp1252':
+ if sys.platform == "win32":
+ if fs_enc == "cp1252":
# Python mangles the UTF-8 filename
- filename = filename.decode('cp1252')
+ filename = filename.decode("cp1252")
assert filename in cmd.filelist.files
else:
- filename = filename.decode('mbcs')
+ filename = filename.decode("mbcs")
assert filename in cmd.filelist.files
else:
- filename = filename.decode('utf-8')
+ filename = filename.decode("utf-8")
assert filename in cmd.filelist.files
@classmethod
@@ -669,12 +669,12 @@ def make_strings(cls, item):
def test_sdist_with_latin1_encoded_filename(self):
# Test for #303.
dist = Distribution(self.make_strings(SETUP_ATTRS))
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
# Latin-1 filename
- filename = os.path.join(b'sdist_test', Filenames.latin_1)
+ filename = os.path.join(b"sdist_test", Filenames.latin_1)
touch(filename)
assert os.path.isfile(filename)
@@ -682,18 +682,18 @@ def test_sdist_with_latin1_encoded_filename(self):
cmd.run()
# not all windows systems have a default FS encoding of cp1252
- if sys.platform == 'win32':
+ if sys.platform == "win32":
# Latin-1 is similar to Windows-1252 however
# on mbcs filesys it is not in latin-1 encoding
fs_enc = sys.getfilesystemencoding()
- if fs_enc != 'mbcs':
- fs_enc = 'latin-1'
+ if fs_enc != "mbcs":
+ fs_enc = "latin-1"
filename = filename.decode(fs_enc)
assert filename in cmd.filelist.files
else:
# The Latin-1 filename should have been skipped
- filename = filename.decode('latin-1')
+ filename = filename.decode("latin-1")
assert filename not in cmd.filelist.files
_EXAMPLE_DIRECTIVES = {
@@ -740,15 +740,15 @@ def test_sdist_with_latin1_encoded_filename(self):
def test_add_files_referenced_by_config_directives(self, source_dir, config):
config_file, _, _ = config.partition(" - ")
config_text = self._EXAMPLE_DIRECTIVES[config]
- (source_dir / 'src').mkdir()
- (source_dir / 'src/VERSION.txt').write_text("0.42", encoding="utf-8")
- (source_dir / 'README.rst').write_text("hello world!", encoding="utf-8")
- (source_dir / 'USAGE.rst').write_text("hello world!", encoding="utf-8")
- (source_dir / 'DOWHATYOUWANT').write_text("hello world!", encoding="utf-8")
+ (source_dir / "src").mkdir()
+ (source_dir / "src/VERSION.txt").write_text("0.42", encoding="utf-8")
+ (source_dir / "README.rst").write_text("hello world!", encoding="utf-8")
+ (source_dir / "USAGE.rst").write_text("hello world!", encoding="utf-8")
+ (source_dir / "DOWHATYOUWANT").write_text("hello world!", encoding="utf-8")
(source_dir / config_file).write_text(config_text, encoding="utf-8")
dist = Distribution({"packages": []})
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
dist.parse_config_files()
cmd = sdist(dist)
@@ -757,46 +757,46 @@ def test_add_files_referenced_by_config_directives(self, source_dir, config):
cmd.run()
assert (
- 'src/VERSION.txt' in cmd.filelist.files
- or 'src\\VERSION.txt' in cmd.filelist.files
+ "src/VERSION.txt" in cmd.filelist.files
+ or "src\\VERSION.txt" in cmd.filelist.files
)
- assert 'USAGE.rst' in cmd.filelist.files
- assert 'DOWHATYOUWANT' in cmd.filelist.files
- assert '/' not in cmd.filelist.files
- assert '\\' not in cmd.filelist.files
+ assert "USAGE.rst" in cmd.filelist.files
+ assert "DOWHATYOUWANT" in cmd.filelist.files
+ assert "/" not in cmd.filelist.files
+ assert "\\" not in cmd.filelist.files
def test_pyproject_toml_in_sdist(self, source_dir):
"""
Check if pyproject.toml is included in source distribution if present
"""
- touch(source_dir / 'pyproject.toml')
+ touch(source_dir / "pyproject.toml")
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
with quiet():
cmd.run()
manifest = cmd.filelist.files
- assert 'pyproject.toml' in manifest
+ assert "pyproject.toml" in manifest
def test_pyproject_toml_excluded(self, source_dir):
"""
Check that pyproject.toml can excluded even if present
"""
- touch(source_dir / 'pyproject.toml')
- with open('MANIFEST.in', 'w', encoding="utf-8") as mts:
- print('exclude pyproject.toml', file=mts)
+ touch(source_dir / "pyproject.toml")
+ with open("MANIFEST.in", "w", encoding="utf-8") as mts:
+ print("exclude pyproject.toml", file=mts)
dist = Distribution(SETUP_ATTRS)
- dist.script_name = 'setup.py'
+ dist.script_name = "setup.py"
cmd = sdist(dist)
cmd.ensure_finalized()
with quiet():
cmd.run()
manifest = cmd.filelist.files
- assert 'pyproject.toml' not in manifest
+ assert "pyproject.toml" not in manifest
def test_build_subcommand_source_files(self, source_dir):
- touch(source_dir / '.myfile~')
+ touch(source_dir / ".myfile~")
# Sanity check: without custom commands file list should not be affected
dist = Distribution({**SETUP_ATTRS, "script_name": "setup.py"})
@@ -805,7 +805,7 @@ def test_build_subcommand_source_files(self, source_dir):
with quiet():
cmd.run()
manifest = cmd.filelist.files
- assert '.myfile~' not in manifest
+ assert ".myfile~" not in manifest
# Test: custom command should be able to augment file list
dist = Distribution({**SETUP_ATTRS, "script_name": "setup.py"})
@@ -820,7 +820,7 @@ def finalize_options(self): ...
def run(self): ...
def get_source_files(self):
- return ['.myfile~']
+ return [".myfile~"]
dist.cmdclass.update(build_custom=build_custom)
@@ -830,7 +830,7 @@ def get_source_files(self):
with quiet():
cmd.run()
manifest = cmd.filelist.files
- assert '.myfile~' in manifest
+ assert ".myfile~" in manifest
@pytest.mark.skipif("os.environ.get('SETUPTOOLS_USE_DISTUTILS') == 'stdlib'")
def test_build_base_pathlib(self, source_dir):
@@ -840,7 +840,7 @@ def test_build_base_pathlib(self, source_dir):
dist = Distribution({
**SETUP_ATTRS,
"script_name": "setup.py",
- "options": {"build": {"build_base": pathlib.Path('build')}},
+ "options": {"build": {"build_base": pathlib.Path("build")}},
})
cmd = sdist(dist)
cmd.ensure_finalized()
@@ -866,7 +866,7 @@ def test_default_revctrl():
"""
)
res = ep.load()
- assert hasattr(res, '__iter__')
+ assert hasattr(res, "__iter__")
class TestRegressions:
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_setopt.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_setopt.py
index ccf25618..b5302187 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_setopt.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_setopt.py
@@ -7,34 +7,34 @@ class TestEdit:
@staticmethod
def parse_config(filename):
parser = configparser.ConfigParser()
- with open(filename, encoding='utf-8') as reader:
+ with open(filename, encoding="utf-8") as reader:
parser.read_file(reader)
return parser
@staticmethod
def write_text(file, content):
- with open(file, 'wb') as strm:
- strm.write(content.encode('utf-8'))
+ with open(file, "wb") as strm:
+ strm.write(content.encode("utf-8"))
def test_utf8_encoding_retained(self, tmpdir):
"""
When editing a file, non-ASCII characters encoded in
UTF-8 should be retained.
"""
- config = tmpdir.join('setup.cfg')
- self.write_text(str(config), '[names]\njaraco=джарако')
- setopt.edit_config(str(config), dict(names=dict(other='yes')))
+ config = tmpdir.join("setup.cfg")
+ self.write_text(str(config), "[names]\njaraco=джарако")
+ setopt.edit_config(str(config), dict(names=dict(other="yes")))
parser = self.parse_config(str(config))
- assert parser.get('names', 'jaraco') == 'джарако'
- assert parser.get('names', 'other') == 'yes'
+ assert parser.get("names", "jaraco") == "джарако"
+ assert parser.get("names", "other") == "yes"
def test_case_retained(self, tmpdir):
"""
When editing a file, case of keys should be retained.
"""
- config = tmpdir.join('setup.cfg')
- self.write_text(str(config), '[names]\nFoO=bAr')
- setopt.edit_config(str(config), dict(names=dict(oTher='yes')))
- actual = config.read_text(encoding='ascii')
- assert 'FoO' in actual
- assert 'oTher' in actual
+ config = tmpdir.join("setup.cfg")
+ self.write_text(str(config), "[names]\nFoO=bAr")
+ setopt.edit_config(str(config), dict(names=dict(oTher="yes")))
+ actual = config.read_text(encoding="ascii")
+ assert "FoO" in actual
+ assert "oTher" in actual
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_setuptools.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_setuptools.py
index 1d56e1a8..38627895 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_setuptools.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_setuptools.py
@@ -30,7 +30,7 @@ def makeSetup(**args):
distutils.core._setup_stop_after = "commandline"
# Don't let system command line leak into tests!
- args.setdefault('script_args', ['install'])
+ args.setdefault("script_args", ["install"])
try:
return setuptools.setup(**args)
@@ -39,14 +39,14 @@ def makeSetup(**args):
needs_bytecode = pytest.mark.skipif(
- not hasattr(dep, 'get_module_constant'),
+ not hasattr(dep, "get_module_constant"),
reason="bytecode support not available",
)
class TestDepends:
def testExtractConst(self):
- if not hasattr(dep, 'extract_constant'):
+ if not hasattr(dep, "extract_constant"):
# skip on non-bytecode platforms
return
@@ -58,57 +58,57 @@ def f1():
fc = f1.__code__
# unrecognized name
- assert dep.extract_constant(fc, 'q', -1) is None
+ assert dep.extract_constant(fc, "q", -1) is None
# constant assigned
- assert dep.extract_constant(fc, 'x', -1) == "test"
+ assert dep.extract_constant(fc, "x", -1) == "test"
# expression assigned
- assert dep.extract_constant(fc, 'y', -1) == -1
+ assert dep.extract_constant(fc, "y", -1) == -1
# recognized name, not assigned
- assert dep.extract_constant(fc, 'z', -1) is None
+ assert dep.extract_constant(fc, "z", -1) is None
def testFindModule(self):
with pytest.raises(ImportError):
- dep.find_module('no-such.-thing')
+ dep.find_module("no-such.-thing")
with pytest.raises(ImportError):
- dep.find_module('setuptools.non-existent')
- f, _p, _i = dep.find_module('setuptools.tests')
+ dep.find_module("setuptools.non-existent")
+ f, _p, _i = dep.find_module("setuptools.tests")
f.close()
@needs_bytecode
def testModuleExtract(self):
from json import __version__
- assert dep.get_module_constant('json', '__version__') == __version__
- assert dep.get_module_constant('sys', 'version') == sys.version
+ assert dep.get_module_constant("json", "__version__") == __version__
+ assert dep.get_module_constant("sys", "version") == sys.version
assert (
- dep.get_module_constant('setuptools.tests.test_setuptools', '__doc__')
+ dep.get_module_constant("setuptools.tests.test_setuptools", "__doc__")
== __doc__
)
@needs_bytecode
def testRequire(self):
- req = Require('Json', '1.0.3', 'json')
+ req = Require("Json", "1.0.3", "json")
- assert req.name == 'Json'
- assert req.module == 'json'
- assert req.requested_version == Version('1.0.3')
- assert req.attribute == '__version__'
- assert req.full_name() == 'Json-1.0.3'
+ assert req.name == "Json"
+ assert req.module == "json"
+ assert req.requested_version == Version("1.0.3")
+ assert req.attribute == "__version__"
+ assert req.full_name() == "Json-1.0.3"
from json import __version__
assert str(req.get_version()) == __version__
- assert req.version_ok('1.0.9')
- assert not req.version_ok('0.9.1')
- assert not req.version_ok('unknown')
+ assert req.version_ok("1.0.9")
+ assert not req.version_ok("0.9.1")
+ assert not req.version_ok("unknown")
assert req.is_present()
assert req.is_current()
- req = Require('Do-what-I-mean', '1.0', 'd-w-i-m')
+ req = Require("Do-what-I-mean", "1.0", "d-w-i-m")
assert not req.is_present()
assert not req.is_current()
@@ -117,12 +117,12 @@ def test_require_present(self):
# In #1896, this test was failing for months with the only
# complaint coming from test runners (not end users).
# TODO: Evaluate if this code is needed at all.
- req = Require('Tests', None, 'tests', homepage="http://example.com")
+ req = Require("Tests", None, "tests", homepage="http://example.com")
assert req.format is None
assert req.attribute is None
assert req.requested_version is None
- assert req.full_name() == 'Tests'
- assert req.homepage == 'http://example.com'
+ assert req.full_name() == "Tests"
+ assert req.homepage == "http://example.com"
from setuptools.tests import __path__
@@ -133,12 +133,12 @@ def test_require_present(self):
class TestDistro:
def setup_method(self, method):
- self.e1 = Extension('bar.ext', ['bar.c'])
- self.e2 = Extension('c.y', ['y.c'])
+ self.e1 = Extension("bar.ext", ["bar.c"])
+ self.e2 = Extension("c.y", ["y.c"])
self.dist = makeSetup(
- packages=['a', 'a.b', 'a.b.c', 'b', 'c'],
- py_modules=['b.d', 'x'],
+ packages=["a", "a.b", "a.b.c", "b", "c"],
+ py_modules=["b.d", "x"],
ext_modules=(self.e1, self.e2),
package_dir={},
)
@@ -147,21 +147,21 @@ def testDistroType(self):
assert isinstance(self.dist, setuptools.dist.Distribution)
def testExcludePackage(self):
- self.dist.exclude_package('a')
- assert self.dist.packages == ['b', 'c']
+ self.dist.exclude_package("a")
+ assert self.dist.packages == ["b", "c"]
- self.dist.exclude_package('b')
- assert self.dist.packages == ['c']
- assert self.dist.py_modules == ['x']
+ self.dist.exclude_package("b")
+ assert self.dist.packages == ["c"]
+ assert self.dist.py_modules == ["x"]
assert self.dist.ext_modules == [self.e1, self.e2]
- self.dist.exclude_package('c')
+ self.dist.exclude_package("c")
assert self.dist.packages == []
- assert self.dist.py_modules == ['x']
+ assert self.dist.py_modules == ["x"]
assert self.dist.ext_modules == [self.e1]
# test removals from unspecified options
- makeSetup().exclude_package('x')
+ makeSetup().exclude_package("x")
def testIncludeExclude(self):
# remove an extension
@@ -177,61 +177,61 @@ def testIncludeExclude(self):
assert self.dist.ext_modules == [self.e2, self.e1]
def testExcludePackages(self):
- self.dist.exclude(packages=['c', 'b', 'a'])
+ self.dist.exclude(packages=["c", "b", "a"])
assert self.dist.packages == []
- assert self.dist.py_modules == ['x']
+ assert self.dist.py_modules == ["x"]
assert self.dist.ext_modules == [self.e1]
def testEmpty(self):
dist = makeSetup()
- dist.include(packages=['a'], py_modules=['b'], ext_modules=[self.e2])
+ dist.include(packages=["a"], py_modules=["b"], ext_modules=[self.e2])
dist = makeSetup()
- dist.exclude(packages=['a'], py_modules=['b'], ext_modules=[self.e2])
+ dist.exclude(packages=["a"], py_modules=["b"], ext_modules=[self.e2])
def testContents(self):
- assert self.dist.has_contents_for('a')
- self.dist.exclude_package('a')
- assert not self.dist.has_contents_for('a')
+ assert self.dist.has_contents_for("a")
+ self.dist.exclude_package("a")
+ assert not self.dist.has_contents_for("a")
- assert self.dist.has_contents_for('b')
- self.dist.exclude_package('b')
- assert not self.dist.has_contents_for('b')
+ assert self.dist.has_contents_for("b")
+ self.dist.exclude_package("b")
+ assert not self.dist.has_contents_for("b")
- assert self.dist.has_contents_for('c')
- self.dist.exclude_package('c')
- assert not self.dist.has_contents_for('c')
+ assert self.dist.has_contents_for("c")
+ self.dist.exclude_package("c")
+ assert not self.dist.has_contents_for("c")
def testInvalidIncludeExclude(self):
with pytest.raises(DistutilsSetupError):
- self.dist.include(nonexistent_option='x')
+ self.dist.include(nonexistent_option="x")
with pytest.raises(DistutilsSetupError):
- self.dist.exclude(nonexistent_option='x')
+ self.dist.exclude(nonexistent_option="x")
with pytest.raises(DistutilsSetupError):
- self.dist.include(packages={'x': 'y'})
+ self.dist.include(packages={"x": "y"})
with pytest.raises(DistutilsSetupError):
- self.dist.exclude(packages={'x': 'y'})
+ self.dist.exclude(packages={"x": "y"})
with pytest.raises(DistutilsSetupError):
- self.dist.include(ext_modules={'x': 'y'})
+ self.dist.include(ext_modules={"x": "y"})
with pytest.raises(DistutilsSetupError):
- self.dist.exclude(ext_modules={'x': 'y'})
+ self.dist.exclude(ext_modules={"x": "y"})
with pytest.raises(DistutilsSetupError):
- self.dist.include(package_dir=['q'])
+ self.dist.include(package_dir=["q"])
with pytest.raises(DistutilsSetupError):
- self.dist.exclude(package_dir=['q'])
+ self.dist.exclude(package_dir=["q"])
@pytest.fixture
def example_source(tmpdir):
- tmpdir.mkdir('foo')
- (tmpdir / 'foo/bar.py').write('')
- (tmpdir / 'readme.txt').write('')
+ tmpdir.mkdir("foo")
+ (tmpdir / "foo/bar.py").write("")
+ (tmpdir / "readme.txt").write("")
return tmpdir
def test_findall(example_source):
found = list(setuptools.findall(str(example_source)))
- expected = ['readme.txt', 'foo/bar.py']
+ expected = ["readme.txt", "foo/bar.py"]
expected = [example_source.join(fn) for fn in expected]
assert found == expected
@@ -239,7 +239,7 @@ def test_findall(example_source):
def test_findall_curdir(example_source):
with example_source.as_cwd():
found = list(setuptools.findall())
- expected = ['readme.txt', os.path.join('foo', 'bar.py')]
+ expected = ["readme.txt", os.path.join("foo", "bar.py")]
assert found == expected
@@ -248,8 +248,8 @@ def can_symlink(tmpdir):
"""
Skip if cannot create a symbolic link
"""
- link_fn = 'link'
- target_fn = 'target'
+ link_fn = "link"
+ target_fn = "target"
try:
os.symlink(target_fn, link_fn)
except (OSError, NotImplementedError, AttributeError):
@@ -260,7 +260,7 @@ def can_symlink(tmpdir):
@pytest.mark.usefixtures("can_symlink")
def test_findall_missing_symlink(tmpdir):
with tmpdir.as_cwd():
- os.symlink('foo', 'bar')
+ os.symlink("foo", "bar")
found = list(setuptools.findall())
assert found == []
@@ -268,23 +268,23 @@ def test_findall_missing_symlink(tmpdir):
@pytest.mark.xfail(reason="unable to exclude tests; #4475 #3260")
def test_its_own_wheel_does_not_contain_tests(setuptools_wheel):
with ZipFile(setuptools_wheel) as zipfile:
- contents = [f.replace(os.sep, '/') for f in zipfile.namelist()]
+ contents = [f.replace(os.sep, "/") for f in zipfile.namelist()]
for member in contents:
- assert '/tests/' not in member
+ assert "/tests/" not in member
def test_wheel_includes_cli_scripts(setuptools_wheel):
with ZipFile(setuptools_wheel) as zipfile:
- contents = [f.replace(os.sep, '/') for f in zipfile.namelist()]
+ contents = [f.replace(os.sep, "/") for f in zipfile.namelist()]
- assert any('cli-64.exe' in member for member in contents)
+ assert any("cli-64.exe" in member for member in contents)
def test_wheel_includes_vendored_metadata(setuptools_wheel):
with ZipFile(setuptools_wheel) as zipfile:
- contents = [f.replace(os.sep, '/') for f in zipfile.namelist()]
+ contents = [f.replace(os.sep, "/") for f in zipfile.namelist()]
assert any(
- re.search(r'_vendor/.*\.dist-info/METADATA', member) for member in contents
+ re.search(r"_vendor/.*\.dist-info/METADATA", member) for member in contents
)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_unicode_utils.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_unicode_utils.py
index a24a9bd5..6430248f 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_unicode_utils.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_unicode_utils.py
@@ -6,5 +6,5 @@ def test_filesys_decode_fs_encoding_is_None(monkeypatch):
Test filesys_decode does not raise TypeError when
getfilesystemencoding returns None.
"""
- monkeypatch.setattr('sys.getfilesystemencoding', lambda: None)
- unicode_utils.filesys_decode(b'test')
+ monkeypatch.setattr("sys.getfilesystemencoding", lambda: None)
+ unicode_utils.filesys_decode(b"test")
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_virtualenv.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_virtualenv.py
index b02949ba..e380bd24 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_virtualenv.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_virtualenv.py
@@ -28,9 +28,9 @@ def test_clean_env_install(venv_without_setuptools, setuptools_wheel):
def access_pypi():
# Detect if tests are being run without connectivity
- if not os.environ.get('NETWORK_REQUIRED', False): # pragma: nocover
+ if not os.environ.get("NETWORK_REQUIRED", False): # pragma: nocover
try:
- urlopen('https://pypi.org', timeout=1)
+ urlopen("https://pypi.org", timeout=1)
except URLError:
# No network, disable most of these tests
return False
@@ -46,40 +46,40 @@ def access_pypi():
# ^-- Even when it is not necessary to install a different version of `pip`
# the build process will still try to download `wheel`, see #3147 and #2986.
@pytest.mark.parametrize(
- 'pip_version',
+ "pip_version",
[
None,
pytest.param(
- 'pip<20.1',
+ "pip<20.1",
marks=pytest.mark.xfail(
- 'sys.version_info >= (3, 12)',
+ "sys.version_info >= (3, 12)",
reason="pip 23.1.2 required for Python 3.12 and later",
),
),
pytest.param(
- 'pip<21',
+ "pip<21",
marks=pytest.mark.xfail(
- 'sys.version_info >= (3, 12)',
+ "sys.version_info >= (3, 12)",
reason="pip 23.1.2 required for Python 3.12 and later",
),
),
pytest.param(
- 'pip<22',
+ "pip<22",
marks=pytest.mark.xfail(
- 'sys.version_info >= (3, 12)',
+ "sys.version_info >= (3, 12)",
reason="pip 23.1.2 required for Python 3.12 and later",
),
),
pytest.param(
- 'pip<23',
+ "pip<23",
marks=pytest.mark.xfail(
- 'sys.version_info >= (3, 12)',
+ "sys.version_info >= (3, 12)",
reason="pip 23.1.2 required for Python 3.12 and later",
),
),
pytest.param(
- 'https://github.com/pypa/pip/archive/main.zip',
- marks=pytest.mark.xfail(reason='#2975'),
+ "https://github.com/pypa/pip/archive/main.zip",
+ marks=pytest.mark.xfail(reason="#2975"),
),
],
)
@@ -110,4 +110,4 @@ def test_no_missing_dependencies(bare_venv, request):
Quick and dirty test to ensure all external dependencies are vendored.
"""
setuptools_dir = request.config.rootdir
- bare_venv.run(['python', 'setup.py', '--help'], cwd=setuptools_dir)
+ bare_venv.run(["python", "setup.py", "--help"], cwd=setuptools_dir)
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_wheel.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_wheel.py
index f9146508..27e5d3e4 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_wheel.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_wheel.py
@@ -28,56 +28,56 @@
from distutils.util import get_platform
WHEEL_INFO_TESTS = (
- ('invalid.whl', ValueError),
+ ("invalid.whl", ValueError),
(
- 'simplewheel-2.0-1-py2.py3-none-any.whl',
+ "simplewheel-2.0-1-py2.py3-none-any.whl",
{
- 'project_name': 'simplewheel',
- 'version': '2.0',
- 'build': '1',
- 'py_version': 'py2.py3',
- 'abi': 'none',
- 'platform': 'any',
+ "project_name": "simplewheel",
+ "version": "2.0",
+ "build": "1",
+ "py_version": "py2.py3",
+ "abi": "none",
+ "platform": "any",
},
),
(
- 'simple.dist-0.1-py2.py3-none-any.whl',
+ "simple.dist-0.1-py2.py3-none-any.whl",
{
- 'project_name': 'simple.dist',
- 'version': '0.1',
- 'build': None,
- 'py_version': 'py2.py3',
- 'abi': 'none',
- 'platform': 'any',
+ "project_name": "simple.dist",
+ "version": "0.1",
+ "build": None,
+ "py_version": "py2.py3",
+ "abi": "none",
+ "platform": "any",
},
),
(
- 'example_pkg_a-1-py3-none-any.whl',
+ "example_pkg_a-1-py3-none-any.whl",
{
- 'project_name': 'example_pkg_a',
- 'version': '1',
- 'build': None,
- 'py_version': 'py3',
- 'abi': 'none',
- 'platform': 'any',
+ "project_name": "example_pkg_a",
+ "version": "1",
+ "build": None,
+ "py_version": "py3",
+ "abi": "none",
+ "platform": "any",
},
),
(
- 'PyQt5-5.9-5.9.1-cp35.cp36.cp37-abi3-manylinux1_x86_64.whl',
+ "PyQt5-5.9-5.9.1-cp35.cp36.cp37-abi3-manylinux1_x86_64.whl",
{
- 'project_name': 'PyQt5',
- 'version': '5.9',
- 'build': '5.9.1',
- 'py_version': 'cp35.cp36.cp37',
- 'abi': 'abi3',
- 'platform': 'manylinux1_x86_64',
+ "project_name": "PyQt5",
+ "version": "5.9",
+ "build": "5.9.1",
+ "py_version": "cp35.cp36.cp37",
+ "abi": "abi3",
+ "platform": "manylinux1_x86_64",
},
),
)
@pytest.mark.parametrize(
- ('filename', 'info'), WHEEL_INFO_TESTS, ids=[t[0] for t in WHEEL_INFO_TESTS]
+ ("filename", "info"), WHEEL_INFO_TESTS, ids=[t[0] for t in WHEEL_INFO_TESTS]
)
def test_wheel_info(filename, info):
if inspect.isclass(info):
@@ -91,7 +91,7 @@ def test_wheel_info(filename, info):
@contextlib.contextmanager
def build_wheel(extra_file_defs=None, **kwargs):
file_defs = {
- 'setup.py': (
+ "setup.py": (
DALS(
"""
# -*- coding: utf-8 -*-
@@ -101,16 +101,16 @@ def build_wheel(extra_file_defs=None, **kwargs):
"""
)
% kwargs
- ).encode('utf-8'),
+ ).encode("utf-8"),
}
if extra_file_defs:
file_defs.update(extra_file_defs)
with tempdir() as source_dir:
path.build(file_defs, source_dir)
subprocess.check_call(
- (sys.executable, 'setup.py', '-q', 'bdist_wheel'), cwd=source_dir
+ (sys.executable, "setup.py", "-q", "bdist_wheel"), cwd=source_dir
)
- yield glob.glob(os.path.join(source_dir, 'dist', '*.whl'))[0]
+ yield glob.glob(os.path.join(source_dir, "dist", "*.whl"))[0]
def tree_set(root):
@@ -141,7 +141,7 @@ def format_install_tree(tree):
x.format(
py_version=sysconfig.get_python_version(),
platform=get_platform(),
- shlib_ext=get_config_var('EXT_SUFFIX') or get_config_var('SO'),
+ shlib_ext=get_config_var("EXT_SUFFIX") or get_config_var("SO"),
)
for x in tree
}
@@ -162,9 +162,9 @@ def _check_wheel_install(
# pyright is nitpicky; fine to assume dist.metadata.__getitem__ will fail or return None
# (https://github.com/pypa/setuptools/pull/5006#issuecomment-2894774288)
- assert dist.metadata['Name'] == project_name # pyright: ignore # noqa: PGH003
- assert dist.metadata['Version'] == version # pyright: ignore # noqa: PGH003
- assert dist.read_text('requires.txt') == requires_txt
+ assert dist.metadata["Name"] == project_name # pyright: ignore # noqa: PGH003
+ assert dist.metadata["Version"] == version # pyright: ignore # noqa: PGH003
+ assert dist.read_text("requires.txt") == requires_txt
class Record:
@@ -173,7 +173,7 @@ def __init__(self, id, **kwargs):
self._fields = kwargs
def __repr__(self) -> str:
- return f'{self._id}(**{self._fields!r})'
+ return f"{self._id}(**{self._fields!r})"
# Using Any to avoid possible type union issues later in test
@@ -181,47 +181,47 @@ def __repr__(self) -> str:
# https://github.com/python/mypy/issues/9884
WHEEL_INSTALL_TESTS: tuple[dict[str, Any], ...] = (
dict(
- id='basic',
- file_defs={'foo': {'__init__.py': ''}},
+ id="basic",
+ file_defs={"foo": {"__init__.py": ""}},
setup_kwargs=dict(
- packages=['foo'],
+ packages=["foo"],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': {
- 'EGG-INFO': ['PKG-INFO', 'RECORD', 'WHEEL', 'top_level.txt'],
- 'foo': ['__init__.py'],
+ "foo-1.0-py{py_version}.egg": {
+ "EGG-INFO": ["PKG-INFO", "RECORD", "WHEEL", "top_level.txt"],
+ "foo": ["__init__.py"],
}
}),
),
dict(
- id='utf-8',
+ id="utf-8",
setup_kwargs=dict(
- description='Description accentuée',
+ description="Description accentuée",
),
),
dict(
- id='data',
+ id="data",
file_defs={
- 'data.txt': DALS(
+ "data.txt": DALS(
"""
Some data...
"""
),
},
setup_kwargs=dict(
- data_files=[('data_dir', ['data.txt'])],
+ data_files=[("data_dir", ["data.txt"])],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': {
- 'EGG-INFO': ['PKG-INFO', 'RECORD', 'WHEEL', 'top_level.txt'],
- 'data_dir': ['data.txt'],
+ "foo-1.0-py{py_version}.egg": {
+ "EGG-INFO": ["PKG-INFO", "RECORD", "WHEEL", "top_level.txt"],
+ "data_dir": ["data.txt"],
}
}),
),
dict(
- id='extension',
+ id="extension",
file_defs={
- 'extension.c': DALS(
+ "extension.c": DALS(
"""
#include "Python.h"
@@ -268,59 +268,59 @@ def __repr__(self) -> str:
setup_kwargs=dict(
ext_modules=[
Record(
- 'setuptools.Extension', name='extension', sources=['extension.c']
+ "setuptools.Extension", name="extension", sources=["extension.c"]
)
],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}-{platform}.egg': [
- 'extension{shlib_ext}',
+ "foo-1.0-py{py_version}-{platform}.egg": [
+ "extension{shlib_ext}",
{
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'top_level.txt',
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "top_level.txt",
]
},
]
}),
),
dict(
- id='header',
+ id="header",
file_defs={
- 'header.h': DALS(
+ "header.h": DALS(
"""
"""
),
},
setup_kwargs=dict(
- headers=['header.h'],
+ headers=["header.h"],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': [
- 'header.h',
+ "foo-1.0-py{py_version}.egg": [
+ "header.h",
{
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'top_level.txt',
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "top_level.txt",
]
},
]
}),
),
dict(
- id='script',
+ id="script",
file_defs={
- 'script.py': DALS(
+ "script.py": DALS(
"""
#/usr/bin/python
print('hello world!')
"""
),
- 'script.sh': DALS(
+ "script.sh": DALS(
"""
#/bin/sh
echo 'hello world!'
@@ -328,31 +328,31 @@ def __repr__(self) -> str:
),
},
setup_kwargs=dict(
- scripts=['script.py', 'script.sh'],
+ scripts=["script.py", "script.sh"],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': {
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'top_level.txt',
- {'scripts': ['script.py', 'script.sh']},
+ "foo-1.0-py{py_version}.egg": {
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "top_level.txt",
+ {"scripts": ["script.py", "script.sh"]},
]
}
}),
),
dict(
- id='requires1',
- install_requires='foobar==2.0',
+ id="requires1",
+ install_requires="foobar==2.0",
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': {
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'requires.txt',
- 'top_level.txt',
+ "foo-1.0-py{py_version}.egg": {
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "requires.txt",
+ "top_level.txt",
]
}
}),
@@ -363,7 +363,7 @@ def __repr__(self) -> str:
),
),
dict(
- id='requires2',
+ id="requires2",
install_requires=f"""
bar
foo<=2.0; {sys.platform!r} in sys_platform
@@ -376,18 +376,18 @@ def __repr__(self) -> str:
),
),
dict(
- id='requires3',
+ id="requires3",
install_requires=f"""
bar; {sys.platform!r} != sys_platform
""",
),
dict(
- id='requires4',
+ id="requires4",
install_requires="""
foo
""",
extras_require={
- 'extra': 'foobar>3',
+ "extra": "foobar>3",
},
requires_txt=DALS(
"""
@@ -399,11 +399,11 @@ def __repr__(self) -> str:
),
),
dict(
- id='requires5',
+ id="requires5",
extras_require={
- 'extra': f'foobar; {sys.platform!r} != sys_platform',
+ "extra": f"foobar; {sys.platform!r} != sys_platform",
},
- requires_txt='\n'
+ requires_txt="\n"
+ DALS(
"""
[extra]
@@ -411,7 +411,7 @@ def __repr__(self) -> str:
),
),
dict(
- id='requires_ensure_order',
+ id="requires_ensure_order",
install_requires="""
foo
bar
@@ -419,7 +419,7 @@ def __repr__(self) -> str:
qux
""",
extras_require={
- 'extra': """
+ "extra": """
foobar>3
barbaz>4
bazqux>5
@@ -442,77 +442,77 @@ def __repr__(self) -> str:
),
),
dict(
- id='namespace_package',
+ id="namespace_package",
file_defs={
- 'foo': {
- 'bar': {'__init__.py': ''},
+ "foo": {
+ "bar": {"__init__.py": ""},
},
},
setup_kwargs=dict(
- namespace_packages=['foo'],
- packages=['foo.bar'],
+ namespace_packages=["foo"],
+ packages=["foo.bar"],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': [
- 'foo-1.0-py{py_version}-nspkg.pth',
+ "foo-1.0-py{py_version}.egg": [
+ "foo-1.0-py{py_version}-nspkg.pth",
{
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'namespace_packages.txt',
- 'top_level.txt',
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "namespace_packages.txt",
+ "top_level.txt",
]
},
{
- 'foo': [
- '__init__.py',
- {'bar': ['__init__.py']},
+ "foo": [
+ "__init__.py",
+ {"bar": ["__init__.py"]},
]
},
]
}),
),
dict(
- id='empty_namespace_package',
+ id="empty_namespace_package",
file_defs={
- 'foobar': {
- '__init__.py': (
+ "foobar": {
+ "__init__.py": (
"__import__('pkg_resources').declare_namespace(__name__)"
)
},
},
setup_kwargs=dict(
- namespace_packages=['foobar'],
- packages=['foobar'],
+ namespace_packages=["foobar"],
+ packages=["foobar"],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': [
- 'foo-1.0-py{py_version}-nspkg.pth',
+ "foo-1.0-py{py_version}.egg": [
+ "foo-1.0-py{py_version}-nspkg.pth",
{
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'namespace_packages.txt',
- 'top_level.txt',
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "namespace_packages.txt",
+ "top_level.txt",
]
},
{
- 'foobar': [
- '__init__.py',
+ "foobar": [
+ "__init__.py",
]
},
]
}),
),
dict(
- id='data_in_package',
+ id="data_in_package",
file_defs={
- 'foo': {
- '__init__.py': '',
- 'data_dir': {
- 'data.txt': DALS(
+ "foo": {
+ "__init__.py": "",
+ "data_dir": {
+ "data.txt": DALS(
"""
Some data...
"""
@@ -521,22 +521,22 @@ def __repr__(self) -> str:
}
},
setup_kwargs=dict(
- packages=['foo'],
- data_files=[('foo/data_dir', ['foo/data_dir/data.txt'])],
+ packages=["foo"],
+ data_files=[("foo/data_dir", ["foo/data_dir/data.txt"])],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': {
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'top_level.txt',
+ "foo-1.0-py{py_version}.egg": {
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "top_level.txt",
],
- 'foo': [
- '__init__.py',
+ "foo": [
+ "__init__.py",
{
- 'data_dir': [
- 'data.txt',
+ "data_dir": [
+ "data.txt",
]
},
],
@@ -547,19 +547,19 @@ def __repr__(self) -> str:
@pytest.mark.parametrize(
- 'params',
+ "params",
WHEEL_INSTALL_TESTS,
- ids=[params['id'] for params in WHEEL_INSTALL_TESTS],
+ ids=[params["id"] for params in WHEEL_INSTALL_TESTS],
)
def test_wheel_install(params):
- project_name = params.get('name', 'foo')
- version = params.get('version', '1.0')
- install_requires = params.get('install_requires', [])
- extras_require = params.get('extras_require', {})
- requires_txt = params.get('requires_txt', None)
- install_tree = params.get('install_tree')
- file_defs = params.get('file_defs', {})
- setup_kwargs = params.get('setup_kwargs', {})
+ project_name = params.get("name", "foo")
+ version = params.get("version", "1.0")
+ install_requires = params.get("install_requires", [])
+ extras_require = params.get("extras_require", {})
+ requires_txt = params.get("requires_txt", None)
+ install_tree = params.get("install_tree")
+ file_defs = params.get("file_defs", {})
+ setup_kwargs = params.get("setup_kwargs", {})
with (
build_wheel(
name=project_name,
@@ -577,13 +577,13 @@ def test_wheel_install(params):
def test_wheel_no_dist_dir():
- project_name = 'nodistinfo'
- version = '1.0'
- wheel_name = f'{project_name}-{version}-py2.py3-none-any.whl'
+ project_name = "nodistinfo"
+ version = "1.0"
+ wheel_name = f"{project_name}-{version}-py2.py3-none-any.whl"
with tempdir() as source_dir:
wheel_path = os.path.join(source_dir, wheel_name)
# create an empty zip file
- zipfile.ZipFile(wheel_path, 'w').close()
+ zipfile.ZipFile(wheel_path, "w").close()
with tempdir() as install_dir:
with pytest.raises(ValueError):
_check_wheel_install(
@@ -595,18 +595,18 @@ def test_wheel_is_compatible(monkeypatch):
def sys_tags():
return {
(t.interpreter, t.abi, t.platform)
- for t in parse_tag('cp36-cp36m-manylinux1_x86_64')
+ for t in parse_tag("cp36-cp36m-manylinux1_x86_64")
}
- monkeypatch.setattr('setuptools.wheel._get_supported_tags', sys_tags)
- assert Wheel('onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl').is_compatible()
+ monkeypatch.setattr("setuptools.wheel._get_supported_tags", sys_tags)
+ assert Wheel("onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl").is_compatible()
def test_wheel_mode():
@contextlib.contextmanager
def build_wheel(extra_file_defs=None, **kwargs):
file_defs = {
- 'setup.py': (
+ "setup.py": (
DALS(
"""
# -*- coding: utf-8 -*-
@@ -616,7 +616,7 @@ def build_wheel(extra_file_defs=None, **kwargs):
"""
)
% kwargs
- ).encode('utf-8'),
+ ).encode("utf-8"),
}
if extra_file_defs:
file_defs.update(extra_file_defs)
@@ -625,20 +625,20 @@ def build_wheel(extra_file_defs=None, **kwargs):
runsh = pathlib.Path(source_dir) / "script.sh"
os.chmod(runsh, 0o777)
subprocess.check_call(
- (sys.executable, 'setup.py', '-q', 'bdist_wheel'), cwd=source_dir
+ (sys.executable, "setup.py", "-q", "bdist_wheel"), cwd=source_dir
)
- yield glob.glob(os.path.join(source_dir, 'dist', '*.whl'))[0]
+ yield glob.glob(os.path.join(source_dir, "dist", "*.whl"))[0]
params = dict(
- id='script',
+ id="script",
file_defs={
- 'script.py': DALS(
+ "script.py": DALS(
"""
#/usr/bin/python
print('hello world!')
"""
),
- 'script.sh': DALS(
+ "script.sh": DALS(
"""
#/bin/sh
echo 'hello world!'
@@ -646,26 +646,26 @@ def build_wheel(extra_file_defs=None, **kwargs):
),
},
setup_kwargs=dict(
- scripts=['script.py', 'script.sh'],
+ scripts=["script.py", "script.sh"],
),
install_tree=flatten_tree({
- 'foo-1.0-py{py_version}.egg': {
- 'EGG-INFO': [
- 'PKG-INFO',
- 'RECORD',
- 'WHEEL',
- 'top_level.txt',
- {'scripts': ['script.py', 'script.sh']},
+ "foo-1.0-py{py_version}.egg": {
+ "EGG-INFO": [
+ "PKG-INFO",
+ "RECORD",
+ "WHEEL",
+ "top_level.txt",
+ {"scripts": ["script.py", "script.sh"]},
]
}
}),
)
- project_name = params.get('name', 'foo')
- version = params.get('version', '1.0')
- install_tree = params.get('install_tree')
- file_defs = params.get('file_defs', {})
- setup_kwargs = params.get('setup_kwargs', {})
+ project_name = params.get("name", "foo")
+ version = params.get("version", "1.0")
+ install_tree = params.get("install_tree")
+ file_defs = params.get("file_defs", {})
+ setup_kwargs = params.get("setup_kwargs", {})
with (
build_wheel(
@@ -685,6 +685,6 @@ def build_wheel(extra_file_defs=None, **kwargs):
base = pathlib.Path(install_dir) / w.egg_name()
script_sh = base / "EGG-INFO" / "scripts" / "script.sh"
assert script_sh.exists()
- if sys.platform != 'win32':
+ if sys.platform != "win32":
# Editable file mode has no effect on Windows
assert oct(stat.S_IMODE(script_sh.stat().st_mode)) == "0o777"
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/test_windows_wrappers.py b/.venv3.10/Lib/site-packages/setuptools/tests/test_windows_wrappers.py
index 4f990eb1..45fbd806 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/test_windows_wrappers.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/test_windows_wrappers.py
@@ -22,7 +22,7 @@
from setuptools._importlib import resources
-pytestmark = pytest.mark.skipif(sys.platform != 'win32', reason="Windows only")
+pytestmark = pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
class WrapperTester:
@@ -43,18 +43,18 @@ def create_script(cls, tmpdir):
script = cls.prep_script(cls.script_tmpl)
- with (tmpdir / cls.script_name).open('w') as f:
+ with (tmpdir / cls.script_name).open("w") as f:
f.write(script)
# also copy cli.exe to the sample directory
- with (tmpdir / cls.wrapper_name).open('wb') as f:
- w = resources.files('setuptools').joinpath(cls.wrapper_source).read_bytes()
+ with (tmpdir / cls.wrapper_name).open("wb") as f:
+ w = resources.files("setuptools").joinpath(cls.wrapper_source).read_bytes()
f.write(w)
def win_launcher_exe(prefix):
"""A simple routine to select launcher script based on platform."""
- assert prefix in ('cli', 'gui')
+ assert prefix in ("cli", "gui")
if platform.machine() == "ARM64":
return f"{prefix}-arm64.exe"
else:
@@ -62,9 +62,9 @@ def win_launcher_exe(prefix):
class TestCLI(WrapperTester):
- script_name = 'foo-script.py'
- wrapper_name = 'foo.exe'
- wrapper_source = win_launcher_exe('cli')
+ script_name = "foo-script.py"
+ wrapper_name = "foo.exe"
+ wrapper_source = win_launcher_exe("cli")
script_tmpl = textwrap.dedent(
"""
@@ -101,12 +101,12 @@ def test_basic(self, tmpdir):
"""
self.create_script(tmpdir)
cmd = [
- str(tmpdir / 'foo.exe'),
- 'arg1',
- 'arg 2',
+ str(tmpdir / "foo.exe"),
+ "arg1",
+ "arg 2",
'arg "2\\"',
- 'arg 4\\',
- 'arg5 a\\\\b',
+ "arg 4\\",
+ "arg5 a\\\\b",
]
proc = subprocess.Popen(
cmd,
@@ -115,8 +115,8 @@ def test_basic(self, tmpdir):
text=True,
encoding="utf-8",
)
- stdout, _stderr = proc.communicate('hello\nworld\n')
- actual = stdout.replace('\r\n', '\n')
+ stdout, _stderr = proc.communicate("hello\nworld\n")
+ actual = stdout.replace("\r\n", "\n")
expected = textwrap.dedent(
r"""
\foo-script.py
@@ -138,12 +138,12 @@ def test_symlink(self, tmpdir):
symlink.symlink_to(script_dir / "foo.exe")
cmd = [
- str(tmpdir / 'foo.exe'),
- 'arg1',
- 'arg 2',
+ str(tmpdir / "foo.exe"),
+ "arg1",
+ "arg 2",
'arg "2\\"',
- 'arg 4\\',
- 'arg5 a\\\\b',
+ "arg 4\\",
+ "arg5 a\\\\b",
]
proc = subprocess.Popen(
cmd,
@@ -152,8 +152,8 @@ def test_symlink(self, tmpdir):
text=True,
encoding="utf-8",
)
- stdout, _stderr = proc.communicate('hello\nworld\n')
- actual = stdout.replace('\r\n', '\n')
+ stdout, _stderr = proc.communicate("hello\nworld\n")
+ actual = stdout.replace("\r\n", "\n")
expected = textwrap.dedent(
r"""
\foo-script.py
@@ -189,9 +189,9 @@ def test_with_options(self, tmpdir):
sys.ps1 = '---'
"""
).lstrip()
- with (tmpdir / 'foo-script.py').open('w') as f:
+ with (tmpdir / "foo-script.py").open("w") as f:
f.write(self.prep_script(tmpl))
- cmd = [str(tmpdir / 'foo.exe')]
+ cmd = [str(tmpdir / "foo.exe")]
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
@@ -201,7 +201,7 @@ def test_with_options(self, tmpdir):
encoding="utf-8",
)
stdout, _stderr = proc.communicate()
- actual = stdout.replace('\r\n', '\n')
+ actual = stdout.replace("\r\n", "\n")
expected = textwrap.dedent(
r"""
\foo-script.py
@@ -219,9 +219,9 @@ class TestGUI(WrapperTester):
-----------------------
"""
- script_name = 'bar-script.pyw'
- wrapper_source = win_launcher_exe('gui')
- wrapper_name = 'bar.exe'
+ script_name = "bar-script.pyw"
+ wrapper_source = win_launcher_exe("gui")
+ wrapper_name = "bar.exe"
script_tmpl = textwrap.dedent(
"""
@@ -238,9 +238,9 @@ def test_basic(self, tmpdir):
self.create_script(tmpdir)
cmd = [
- str(tmpdir / 'bar.exe'),
- str(tmpdir / 'test_output.txt'),
- 'Test Argument',
+ str(tmpdir / "bar.exe"),
+ str(tmpdir / "test_output.txt"),
+ "Test Argument",
]
proc = subprocess.Popen(
cmd,
@@ -253,6 +253,6 @@ def test_basic(self, tmpdir):
stdout, stderr = proc.communicate()
assert not stdout
assert not stderr
- with (tmpdir / 'test_output.txt').open('rb') as f_out:
- actual = f_out.read().decode('ascii')
- assert actual == repr('Test Argument')
+ with (tmpdir / "test_output.txt").open("rb") as f_out:
+ actual = f_out.read().decode("ascii")
+ assert actual == repr("Test Argument")
diff --git a/.venv3.10/Lib/site-packages/setuptools/tests/text.py b/.venv3.10/Lib/site-packages/setuptools/tests/text.py
index e05cc633..5447a6be 100644
--- a/.venv3.10/Lib/site-packages/setuptools/tests/text.py
+++ b/.venv3.10/Lib/site-packages/setuptools/tests/text.py
@@ -1,4 +1,4 @@
class Filenames:
- unicode = 'smörbröd.py'
- latin_1 = unicode.encode('latin-1')
- utf_8 = unicode.encode('utf-8')
+ unicode = "smörbröd.py"
+ latin_1 = unicode.encode("latin-1")
+ utf_8 = unicode.encode("utf-8")
diff --git a/.venv3.10/Lib/site-packages/setuptools/unicode_utils.py b/.venv3.10/Lib/site-packages/setuptools/unicode_utils.py
index f502f5b0..1120c820 100644
--- a/.venv3.10/Lib/site-packages/setuptools/unicode_utils.py
+++ b/.venv3.10/Lib/site-packages/setuptools/unicode_utils.py
@@ -9,11 +9,11 @@
# HFS Plus uses decomposed UTF-8
def decompose(path):
if isinstance(path, str):
- return unicodedata.normalize('NFD', path)
+ return unicodedata.normalize("NFD", path)
try:
- path = path.decode('utf-8')
- path = unicodedata.normalize('NFD', path)
- path = path.encode('utf-8')
+ path = path.decode("utf-8")
+ path = unicodedata.normalize("NFD", path)
+ path = path.encode("utf-8")
except UnicodeError:
pass # Not UTF-8
return path
@@ -28,8 +28,8 @@ def filesys_decode(path):
if isinstance(path, str):
return path
- fs_enc = sys.getfilesystemencoding() or 'utf-8'
- candidates = fs_enc, 'utf-8'
+ fs_enc = sys.getfilesystemencoding() or "utf-8"
+ candidates = fs_enc, "utf-8"
for enc in candidates:
try:
diff --git a/.venv3.10/Lib/site-packages/setuptools/version.py b/.venv3.10/Lib/site-packages/setuptools/version.py
index ec253c41..1d914c74 100644
--- a/.venv3.10/Lib/site-packages/setuptools/version.py
+++ b/.venv3.10/Lib/site-packages/setuptools/version.py
@@ -1,6 +1,6 @@
from ._importlib import metadata
try:
- __version__ = metadata.version('setuptools') or '0.dev0+unknown'
+ __version__ = metadata.version("setuptools") or "0.dev0+unknown"
except Exception:
- __version__ = '0.dev0+unknown'
+ __version__ = "0.dev0+unknown"
diff --git a/.venv3.10/Lib/site-packages/setuptools/wheel.py b/.venv3.10/Lib/site-packages/setuptools/wheel.py
index 124e01ad..407f7717 100644
--- a/.venv3.10/Lib/site-packages/setuptools/wheel.py
+++ b/.venv3.10/Lib/site-packages/setuptools/wheel.py
@@ -82,7 +82,7 @@ class Wheel:
def __init__(self, filename) -> None:
match = WHEEL_NAME(os.path.basename(filename))
if match is None:
- raise ValueError(f'invalid wheel name: {filename!r}')
+ raise ValueError(f"invalid wheel name: {filename!r}")
self.filename = filename
for k, v in match.groupdict().items():
setattr(self, k, v)
@@ -90,9 +90,9 @@ def __init__(self, filename) -> None:
def tags(self):
"""List tags (py_version, abi, platform) supported by this wheel."""
return itertools.product(
- self.py_version.split('.'),
- self.abi.split('.'),
- self.platform.split('.'),
+ self.py_version.split("."),
+ self.abi.split("."),
+ self.platform.split("."),
)
def is_compatible(self):
@@ -104,7 +104,7 @@ def egg_name(self):
_egg_basename(
self.project_name,
self.version,
- platform=(None if self.platform == 'any' else get_platform()),
+ platform=(None if self.platform == "any" else get_platform()),
)
+ ".egg"
)
@@ -113,7 +113,7 @@ def get_dist_info(self, zf):
# find the correct name of the .dist-info dir in the wheel file
for member in zf.namelist():
dirname = posixpath.dirname(member)
- if dirname.endswith('.dist-info') and canonicalize_name(dirname).startswith(
+ if dirname.endswith(".dist-info") and canonicalize_name(dirname).startswith(
canonicalize_name(self.project_name)
):
return dirname
@@ -125,10 +125,10 @@ def install_as_egg(self, destination_eggdir) -> None:
self._install_as_egg(destination_eggdir, zf)
def _install_as_egg(self, destination_eggdir, zf):
- dist_basename = f'{self.project_name}-{self.version}'
+ dist_basename = f"{self.project_name}-{self.version}"
dist_info = self.get_dist_info(zf)
- dist_data = f'{dist_basename}.data'
- egg_info = os.path.join(destination_eggdir, 'EGG-INFO')
+ dist_data = f"{dist_basename}.data"
+ egg_info = os.path.join(destination_eggdir, "EGG-INFO")
self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
self._move_data_entries(destination_eggdir, dist_data)
@@ -138,15 +138,15 @@ def _install_as_egg(self, destination_eggdir, zf):
def _convert_metadata(zf, destination_eggdir, dist_info, egg_info):
def get_metadata(name):
with zf.open(posixpath.join(dist_info, name)) as fp:
- value = fp.read().decode('utf-8')
+ value = fp.read().decode("utf-8")
return email.parser.Parser().parsestr(value)
- wheel_metadata = get_metadata('WHEEL')
+ wheel_metadata = get_metadata("WHEEL")
# Check wheel format version is supported.
- wheel_version = parse_version(wheel_metadata.get('Wheel-Version'))
- wheel_v1 = parse_version('1.0') <= wheel_version < parse_version('2.0dev0')
+ wheel_version = parse_version(wheel_metadata.get("Wheel-Version"))
+ wheel_v1 = parse_version("1.0") <= wheel_version < parse_version("2.0dev0")
if not wheel_v1:
- raise ValueError(f'unsupported wheel format version: {wheel_version}')
+ raise ValueError(f"unsupported wheel format version: {wheel_version}")
# Extract to target directory.
_unpack_zipfile_obj(zf, destination_eggdir)
dist_info = os.path.join(destination_eggdir, dist_info)
@@ -155,8 +155,8 @@ def get_metadata(name):
)
os.rename(dist_info, egg_info)
os.rename(
- os.path.join(egg_info, 'METADATA'),
- os.path.join(egg_info, 'PKG-INFO'),
+ os.path.join(egg_info, "METADATA"),
+ os.path.join(egg_info, "PKG-INFO"),
)
setup_dist = setuptools.Distribution(
attrs=dict(
@@ -166,15 +166,15 @@ def get_metadata(name):
)
with disable_info_traces():
write_requirements(
- setup_dist.get_command_obj('egg_info'),
+ setup_dist.get_command_obj("egg_info"),
None,
- os.path.join(egg_info, 'requires.txt'),
+ os.path.join(egg_info, "requires.txt"),
)
@staticmethod
def _convert_requires(destination_eggdir, dist_info):
md = metadata.Distribution.at(dist_info).metadata
- deps = md.get_all('Requires-Dist') or []
+ deps = md.get_all("Requires-Dist") or []
reqs = list(map(Requirement, deps))
extras = extras_from_deps(deps)
@@ -198,7 +198,7 @@ def for_extra(req):
return set(
marker[2].value
for marker in markers
- if isinstance(marker, tuple) and marker[0].value == 'extra'
+ if isinstance(marker, tuple) and marker[0].value == "extra"
)
install_requires = list(
@@ -219,14 +219,14 @@ def for_extra(req):
def _move_data_entries(destination_eggdir, dist_data):
"""Move data entries to their correct location."""
dist_data = os.path.join(destination_eggdir, dist_data)
- dist_data_scripts = os.path.join(dist_data, 'scripts')
+ dist_data_scripts = os.path.join(dist_data, "scripts")
if os.path.exists(dist_data_scripts):
- egg_info_scripts = os.path.join(destination_eggdir, 'EGG-INFO', 'scripts')
+ egg_info_scripts = os.path.join(destination_eggdir, "EGG-INFO", "scripts")
os.mkdir(egg_info_scripts)
for entry in os.listdir(dist_data_scripts):
# Remove bytecode, as it's not properly handled
# during easy_install scripts install phase.
- if entry.endswith('.pyc'):
+ if entry.endswith(".pyc"):
os.unlink(os.path.join(dist_data_scripts, entry))
else:
os.rename(
@@ -238,7 +238,7 @@ def _move_data_entries(destination_eggdir, dist_data):
os.path.exists,
(
os.path.join(dist_data, d)
- for d in ('data', 'headers', 'purelib', 'platlib')
+ for d in ("data", "headers", "purelib", "platlib")
),
):
unpack(subdir, destination_eggdir)
@@ -247,15 +247,15 @@ def _move_data_entries(destination_eggdir, dist_data):
@staticmethod
def _fix_namespace_packages(egg_info, destination_eggdir):
- namespace_packages = os.path.join(egg_info, 'namespace_packages.txt')
+ namespace_packages = os.path.join(egg_info, "namespace_packages.txt")
if os.path.exists(namespace_packages):
namespace_packages = _read_utf8_with_fallback(namespace_packages).split()
for mod in namespace_packages:
- mod_dir = os.path.join(destination_eggdir, *mod.split('.'))
- mod_init = os.path.join(mod_dir, '__init__.py')
+ mod_dir = os.path.join(destination_eggdir, *mod.split("."))
+ mod_init = os.path.join(mod_dir, "__init__.py")
if not os.path.exists(mod_dir):
os.mkdir(mod_dir)
if not os.path.exists(mod_init):
- with open(mod_init, 'w', encoding="utf-8") as fp:
+ with open(mod_init, "w", encoding="utf-8") as fp:
fp.write(NAMESPACE_PACKAGE_INIT)
diff --git a/.venv3.10/Lib/site-packages/setuptools/windows_support.py b/.venv3.10/Lib/site-packages/setuptools/windows_support.py
index 7a2b53a2..4ecad372 100644
--- a/.venv3.10/Lib/site-packages/setuptools/windows_support.py
+++ b/.venv3.10/Lib/site-packages/setuptools/windows_support.py
@@ -2,7 +2,7 @@
def windows_only(func):
- if platform.system() != 'Windows':
+ if platform.system() != "Windows":
return lambda *args, **kwargs: None
return func
diff --git a/.venv3.10/Lib/site.py b/.venv3.10/Lib/site.py
index 5302037e..dfef538b 100644
--- a/.venv3.10/Lib/site.py
+++ b/.venv3.10/Lib/site.py
@@ -114,7 +114,7 @@ def abs_paths():
loader_module = m.__spec__.loader.__module__
except AttributeError:
pass
- if loader_module not in {'_frozen_importlib', '_frozen_importlib_external'}:
+ if loader_module not in {"_frozen_importlib", "_frozen_importlib_external"}:
continue # don't mess with a PEP 302-supplied __file__
try:
m.__file__ = os.path.abspath(m.__file__)
@@ -173,8 +173,8 @@ def addpackage(sitedir, name, known_paths):
st = os.lstat(fullname)
except OSError:
return
- if ((getattr(st, 'st_flags', 0) & stat.UF_HIDDEN) or
- (getattr(st, 'st_file_attributes', 0) & stat.FILE_ATTRIBUTE_HIDDEN)):
+ if ((getattr(st, "st_flags", 0) & stat.UF_HIDDEN) or
+ (getattr(st, "st_file_attributes", 0) & stat.FILE_ATTRIBUTE_HIDDEN)):
_trace(f"Skipping hidden .pth file: {fullname!r}")
return
_trace(f"Processing .pth file: {fullname!r}")
@@ -196,7 +196,7 @@ def addpackage(sitedir, name, known_paths):
continue
line = line.rstrip()
dir, dircase = makepath(sitedir, line)
- if not dircase in known_paths and os.path.exists(dir):
+ if dircase not in known_paths and os.path.exists(dir):
sys.path.append(dir)
known_paths.add(dircase)
except Exception:
@@ -205,7 +205,7 @@ def addpackage(sitedir, name, known_paths):
import traceback
for record in traceback.format_exception(*sys.exc_info()):
for line in record.splitlines():
- print(' '+line, file=sys.stderr)
+ print(" "+line, file=sys.stderr)
print("\nRemainder of file ignored", file=sys.stderr)
break
if reset:
@@ -223,7 +223,7 @@ def addsitedir(sitedir, known_paths=None):
else:
reset = False
sitedir, sitedircase = makepath(sitedir)
- if not sitedircase in known_paths:
+ if sitedircase not in known_paths:
sys.path.append(sitedir) # Add path component
known_paths.add(sitedircase)
try:
@@ -298,14 +298,14 @@ def joinuser(*args):
def _get_path(userbase):
version = sys.version_info
- if os.name == 'nt':
- ver_nodot = sys.winver.replace('.', '')
- return f'{userbase}\\Python{ver_nodot}\\site-packages'
+ if os.name == "nt":
+ ver_nodot = sys.winver.replace(".", "")
+ return f"{userbase}\\Python{ver_nodot}\\site-packages"
- if sys.platform == 'darwin' and sys._framework:
- return f'{userbase}/lib/python/site-packages'
+ if sys.platform == "darwin" and sys._framework:
+ return f"{userbase}/lib/python/site-packages"
- return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'
+ return f"{userbase}/lib/python{version[0]}.{version[1]}/site-packages"
def getuserbase():
@@ -375,7 +375,7 @@ def getsitepackages(prefixes=None):
if sys.platlibdir != "lib":
libdirs.append("lib")
- if os.sep == '/':
+ if os.sep == "/":
for libdir in libdirs:
path = os.path.join(prefix, libdir,
"python%d.%d" % sys.version_info[:2],
@@ -405,19 +405,19 @@ def setquit():
The repr of each object contains a hint at how it works.
"""
- if os.sep == '\\':
- eof = 'Ctrl-Z plus Return'
+ if os.sep == "\\":
+ eof = "Ctrl-Z plus Return"
else:
- eof = 'Ctrl-D (i.e. EOF)'
+ eof = "Ctrl-D (i.e. EOF)"
- builtins.quit = _sitebuiltins.Quitter('quit', eof)
- builtins.exit = _sitebuiltins.Quitter('exit', eof)
+ builtins.quit = _sitebuiltins.Quitter("quit", eof)
+ builtins.exit = _sitebuiltins.Quitter("exit", eof)
def setcopyright():
"""Set 'copyright' and 'credits' in builtins"""
builtins.copyright = _sitebuiltins._Printer("copyright", sys.copyright)
- if sys.platform[:4] == 'java':
+ if sys.platform[:4] == "java":
builtins.credits = _sitebuiltins._Printer(
"credits",
"Jython is maintained by the Jython developers (www.jython.org).")
@@ -428,7 +428,7 @@ def setcopyright():
files, dirs = [], []
# Not all modules are required to have a __file__ attribute. See
# PEP 420 for more details.
- if hasattr(os, '__file__'):
+ if hasattr(os, "__file__"):
here = os.path.dirname(os.__file__)
files.extend(["LICENSE.txt", "LICENSE"])
dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
@@ -460,11 +460,11 @@ def register_readline():
# Reading the initialization (config) file may not be enough to set a
# completion key, so we set one first and then read the file.
- readline_doc = getattr(readline, '__doc__', '')
- if readline_doc is not None and 'libedit' in readline_doc:
- readline.parse_and_bind('bind ^I rl_complete')
+ readline_doc = getattr(readline, "__doc__", "")
+ if readline_doc is not None and "libedit" in readline_doc:
+ readline.parse_and_bind("bind ^I rl_complete")
else:
- readline.parse_and_bind('tab: complete')
+ readline.parse_and_bind("tab: complete")
try:
readline.read_init_file()
@@ -481,8 +481,8 @@ def register_readline():
# each interpreter exit when readline was already configured
# through a PYTHONSTARTUP hook, see:
# http://bugs.python.org/issue5845#msg198636
- history = os.path.join(os.path.expanduser('~'),
- '.python_history')
+ history = os.path.join(os.path.expanduser("~"),
+ ".python_history")
try:
readline.read_history_file(history)
except OSError:
@@ -504,14 +504,14 @@ def venv(known_paths):
global PREFIXES, ENABLE_USER_SITE
env = os.environ
- if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
- executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
+ if sys.platform == "darwin" and "__PYVENV_LAUNCHER__" in env:
+ executable = sys._base_executable = os.environ["__PYVENV_LAUNCHER__"]
else:
executable = sys.executable
exe_dir, _ = os.path.split(os.path.abspath(executable))
site_prefix = os.path.dirname(exe_dir)
sys._home = None
- conf_basename = 'pyvenv.cfg'
+ conf_basename = "pyvenv.cfg"
candidate_confs = [
conffile for conffile in (
os.path.join(exe_dir, conf_basename),
@@ -525,15 +525,15 @@ def venv(known_paths):
system_site = "true"
# Issue 25185: Use UTF-8, as that's what the venv module uses when
# writing the file.
- with open(virtual_conf, encoding='utf-8') as f:
+ with open(virtual_conf, encoding="utf-8") as f:
for line in f:
- if '=' in line:
- key, _, value = line.partition('=')
+ if "=" in line:
+ key, _, value = line.partition("=")
key = key.strip().lower()
value = value.strip()
- if key == 'include-system-site-packages':
+ if key == "include-system-site-packages":
system_site = value.lower()
- elif key == 'home':
+ elif key == "home":
sys._home = value
sys.prefix = sys.exec_prefix = site_prefix
@@ -558,7 +558,7 @@ def execsitecustomize():
try:
import sitecustomize
except ImportError as exc:
- if exc.name == 'sitecustomize':
+ if exc.name == "sitecustomize":
pass
else:
raise
@@ -578,7 +578,7 @@ def execusercustomize():
try:
import usercustomize
except ImportError as exc:
- if exc.name == 'usercustomize':
+ if exc.name == "usercustomize":
pass
else:
raise
@@ -660,9 +660,9 @@ def exists(path):
sys.exit(0)
buffer = []
- if '--user-base' in args:
+ if "--user-base" in args:
buffer.append(USER_BASE)
- if '--user-site' in args:
+ if "--user-site" in args:
buffer.append(USER_SITE)
if buffer:
@@ -680,5 +680,5 @@ def exists(path):
print(textwrap.dedent(help % (sys.argv[0], os.pathsep)))
sys.exit(10)
-if __name__ == '__main__':
+if __name__ == "__main__":
_script()
diff --git a/.venv3.10/Lib/smtpd.py b/.venv3.10/Lib/smtpd.py
index 963e0a76..88dd8183 100644
--- a/.venv3.10/Lib/smtpd.py
+++ b/.venv3.10/Lib/smtpd.py
@@ -93,9 +93,9 @@
]
warn(
- 'The smtpd module is deprecated and unmaintained and will be removed '
- 'in Python 3.12. Please see aiosmtpd '
- '(https://aiosmtpd.readthedocs.io/) for the recommended replacement.',
+ "The smtpd module is deprecated and unmaintained and will be removed "
+ "in Python 3.12. Please see aiosmtpd "
+ "(https://aiosmtpd.readthedocs.io/) for the recommended replacement.",
DeprecationWarning,
stacklevel=2)
@@ -107,7 +107,7 @@
program = sys.argv[0]
-__version__ = 'Python SMTP proxy version 0.3'
+__version__ = "Python SMTP proxy version 0.3"
class Devnull:
@@ -116,12 +116,12 @@ def flush(self): pass
DEBUGSTREAM = Devnull()
-NEWLINE = '\n'
-COMMASPACE = ', '
+NEWLINE = "\n"
+COMMASPACE = ", "
DATA_SIZE_DEFAULT = 33554432
-def usage(code, msg=''):
+def usage(code, msg=""):
print(__doc__ % globals(), file=sys.stderr)
if msg:
print(msg, file=sys.stderr)
@@ -155,17 +155,17 @@ def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
raise ValueError("decode_data and enable_SMTPUTF8 cannot"
" be set to True at the same time")
if decode_data:
- self._emptystring = ''
- self._linesep = '\r\n'
- self._dotsep = '.'
+ self._emptystring = ""
+ self._linesep = "\r\n"
+ self._dotsep = "."
self._newline = NEWLINE
else:
- self._emptystring = b''
- self._linesep = b'\r\n'
- self._dotsep = ord(b'.')
- self._newline = b'\n'
+ self._emptystring = b""
+ self._linesep = b"\r\n"
+ self._dotsep = ord(b".")
+ self._newline = b"\n"
self._set_rset_state()
- self.seen_greeting = ''
+ self.seen_greeting = ""
self.extended_smtp = False
self.command_size_limits.clear()
self.fqdn = socket.getfqdn()
@@ -178,8 +178,8 @@ def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
if err.errno != errno.ENOTCONN:
raise
return
- print('Peer:', repr(self.peer), file=DEBUGSTREAM)
- self.push('220 %s %s' % (self.fqdn, __version__))
+ print("Peer:", repr(self.peer), file=DEBUGSTREAM)
+ self.push("220 %s %s" % (self.fqdn, __version__))
def _set_post_data_state(self):
"""Reset state variables to their post-DATA state."""
@@ -188,12 +188,12 @@ def _set_post_data_state(self):
self.rcpttos = []
self.require_SMTPUTF8 = False
self.num_bytes = 0
- self.set_terminator(b'\r\n')
+ self.set_terminator(b"\r\n")
def _set_rset_state(self):
"""Reset all state variables except the greeting."""
self._set_post_data_state()
- self.received_data = ''
+ self.received_data = ""
self.received_lines = []
@@ -322,7 +322,7 @@ def __addr(self, value):
# Overrides base class for convenience.
def push(self, msg):
asynchat.async_chat.push(self, bytes(
- msg + '\r\n', 'utf-8' if self.require_SMTPUTF8 else 'ascii'))
+ msg + "\r\n", "utf-8" if self.require_SMTPUTF8 else "ascii"))
# Implementation of base class abstract method
def collect_incoming_data(self, data):
@@ -336,23 +336,23 @@ def collect_incoming_data(self, data):
elif limit:
self.num_bytes += len(data)
if self._decode_data:
- self.received_lines.append(str(data, 'utf-8'))
+ self.received_lines.append(str(data, "utf-8"))
else:
self.received_lines.append(data)
# Implementation of base class abstract method
def found_terminator(self):
line = self._emptystring.join(self.received_lines)
- print('Data:', repr(line), file=DEBUGSTREAM)
+ print("Data:", repr(line), file=DEBUGSTREAM)
self.received_lines = []
if self.smtp_state == self.COMMAND:
sz, self.num_bytes = self.num_bytes, 0
if not line:
- self.push('500 Error: bad syntax')
+ self.push("500 Error: bad syntax")
return
if not self._decode_data:
- line = str(line, 'utf-8')
- i = line.find(' ')
+ line = str(line, "utf-8")
+ i = line.find(" ")
if i < 0:
command = line.upper()
arg = None
@@ -362,9 +362,9 @@ def found_terminator(self):
max_sz = (self.command_size_limits[command]
if self.extended_smtp else self.command_size_limit)
if sz > max_sz:
- self.push('500 Error: line too long')
+ self.push("500 Error: line too long")
return
- method = getattr(self, 'smtp_' + command, None)
+ method = getattr(self, "smtp_" + command, None)
if not method:
self.push('500 Error: command "%s" not recognized' % command)
return
@@ -372,11 +372,11 @@ def found_terminator(self):
return
else:
if self.smtp_state != self.DATA:
- self.push('451 Internal confusion')
+ self.push("451 Internal confusion")
self.num_bytes = 0
return
if self.data_size_limit and self.num_bytes > self.data_size_limit:
- self.push('552 Error: Too much mail data')
+ self.push("552 Error: Too much mail data")
self.num_bytes = 0
return
# Remove extraneous carriage returns and de-transparency according
@@ -392,72 +392,72 @@ def found_terminator(self):
kwargs = {}
if not self._decode_data:
kwargs = {
- 'mail_options': self.mail_options,
- 'rcpt_options': self.rcpt_options,
+ "mail_options": self.mail_options,
+ "rcpt_options": self.rcpt_options,
}
status = self.smtp_server.process_message(*args, **kwargs)
self._set_post_data_state()
if not status:
- self.push('250 OK')
+ self.push("250 OK")
else:
self.push(status)
# SMTP and ESMTP commands
def smtp_HELO(self, arg):
if not arg:
- self.push('501 Syntax: HELO hostname')
+ self.push("501 Syntax: HELO hostname")
return
# See issue #21783 for a discussion of this behavior.
if self.seen_greeting:
- self.push('503 Duplicate HELO/EHLO')
+ self.push("503 Duplicate HELO/EHLO")
return
self._set_rset_state()
self.seen_greeting = arg
- self.push('250 %s' % self.fqdn)
+ self.push("250 %s" % self.fqdn)
def smtp_EHLO(self, arg):
if not arg:
- self.push('501 Syntax: EHLO hostname')
+ self.push("501 Syntax: EHLO hostname")
return
# See issue #21783 for a discussion of this behavior.
if self.seen_greeting:
- self.push('503 Duplicate HELO/EHLO')
+ self.push("503 Duplicate HELO/EHLO")
return
self._set_rset_state()
self.seen_greeting = arg
self.extended_smtp = True
- self.push('250-%s' % self.fqdn)
+ self.push("250-%s" % self.fqdn)
if self.data_size_limit:
- self.push('250-SIZE %s' % self.data_size_limit)
- self.command_size_limits['MAIL'] += 26
+ self.push("250-SIZE %s" % self.data_size_limit)
+ self.command_size_limits["MAIL"] += 26
if not self._decode_data:
- self.push('250-8BITMIME')
+ self.push("250-8BITMIME")
if self.enable_SMTPUTF8:
- self.push('250-SMTPUTF8')
- self.command_size_limits['MAIL'] += 10
- self.push('250 HELP')
+ self.push("250-SMTPUTF8")
+ self.command_size_limits["MAIL"] += 10
+ self.push("250 HELP")
def smtp_NOOP(self, arg):
if arg:
- self.push('501 Syntax: NOOP')
+ self.push("501 Syntax: NOOP")
else:
- self.push('250 OK')
+ self.push("250 OK")
def smtp_QUIT(self, arg):
# args is ignored
- self.push('221 Bye')
+ self.push("221 Bye")
self.close_when_done()
def _strip_command_keyword(self, keyword, arg):
keylen = len(keyword)
if arg[:keylen].upper() == keyword:
return arg[keylen:].strip()
- return ''
+ return ""
def _getaddr(self, arg):
if not arg:
- return '', ''
- if arg.lstrip().startswith('<'):
+ return "", ""
+ if arg.lstrip().startswith("<"):
address, rest = get_angle_addr(arg)
else:
address, rest = get_addr_spec(arg)
@@ -470,7 +470,7 @@ def _getparams(self, params):
# appear to be syntactically valid according to RFC 1869.
result = {}
for param in params:
- param, eq, value = param.partition('=')
+ param, eq, value = param.partition("=")
if not param.isalnum() or eq and not value:
return None
result[param] = value if eq else True
@@ -478,62 +478,62 @@ def _getparams(self, params):
def smtp_HELP(self, arg):
if arg:
- extended = ' [SP ]'
+ extended = " [SP ]"
lc_arg = arg.upper()
- if lc_arg == 'EHLO':
- self.push('250 Syntax: EHLO hostname')
- elif lc_arg == 'HELO':
- self.push('250 Syntax: HELO hostname')
- elif lc_arg == 'MAIL':
- msg = '250 Syntax: MAIL FROM: '
+ if lc_arg == "EHLO":
+ self.push("250 Syntax: EHLO hostname")
+ elif lc_arg == "HELO":
+ self.push("250 Syntax: HELO hostname")
+ elif lc_arg == "MAIL":
+ msg = "250 Syntax: MAIL FROM: "
if self.extended_smtp:
msg += extended
self.push(msg)
- elif lc_arg == 'RCPT':
- msg = '250 Syntax: RCPT TO: '
+ elif lc_arg == "RCPT":
+ msg = "250 Syntax: RCPT TO: "
if self.extended_smtp:
msg += extended
self.push(msg)
- elif lc_arg == 'DATA':
- self.push('250 Syntax: DATA')
- elif lc_arg == 'RSET':
- self.push('250 Syntax: RSET')
- elif lc_arg == 'NOOP':
- self.push('250 Syntax: NOOP')
- elif lc_arg == 'QUIT':
- self.push('250 Syntax: QUIT')
- elif lc_arg == 'VRFY':
- self.push('250 Syntax: VRFY ')
+ elif lc_arg == "DATA":
+ self.push("250 Syntax: DATA")
+ elif lc_arg == "RSET":
+ self.push("250 Syntax: RSET")
+ elif lc_arg == "NOOP":
+ self.push("250 Syntax: NOOP")
+ elif lc_arg == "QUIT":
+ self.push("250 Syntax: QUIT")
+ elif lc_arg == "VRFY":
+ self.push("250 Syntax: VRFY ")
else:
- self.push('501 Supported commands: EHLO HELO MAIL RCPT '
- 'DATA RSET NOOP QUIT VRFY')
+ self.push("501 Supported commands: EHLO HELO MAIL RCPT "
+ "DATA RSET NOOP QUIT VRFY")
else:
- self.push('250 Supported commands: EHLO HELO MAIL RCPT DATA '
- 'RSET NOOP QUIT VRFY')
+ self.push("250 Supported commands: EHLO HELO MAIL RCPT DATA "
+ "RSET NOOP QUIT VRFY")
def smtp_VRFY(self, arg):
if arg:
address, params = self._getaddr(arg)
if address:
- self.push('252 Cannot VRFY user, but will accept message '
- 'and attempt delivery')
+ self.push("252 Cannot VRFY user, but will accept message "
+ "and attempt delivery")
else:
- self.push('502 Could not VRFY %s' % arg)
+ self.push("502 Could not VRFY %s" % arg)
else:
- self.push('501 Syntax: VRFY ')
+ self.push("501 Syntax: VRFY ")
def smtp_MAIL(self, arg):
if not self.seen_greeting:
- self.push('503 Error: send HELO first')
+ self.push("503 Error: send HELO first")
return
- print('===> MAIL', arg, file=DEBUGSTREAM)
- syntaxerr = '501 Syntax: MAIL FROM: '
+ print("===> MAIL", arg, file=DEBUGSTREAM)
+ syntaxerr = "501 Syntax: MAIL FROM: "
if self.extended_smtp:
- syntaxerr += ' [SP ]'
+ syntaxerr += " [SP ]"
if arg is None:
self.push(syntaxerr)
return
- arg = self._strip_command_keyword('FROM:', arg)
+ arg = self._strip_command_keyword("FROM:", arg)
address, params = self._getaddr(arg)
if not address:
self.push(syntaxerr)
@@ -542,7 +542,7 @@ def smtp_MAIL(self, arg):
self.push(syntaxerr)
return
if self.mailfrom:
- self.push('503 Error: nested MAIL command')
+ self.push("503 Error: nested MAIL command")
return
self.mail_options = params.upper().split()
params = self._getparams(self.mail_options)
@@ -550,47 +550,47 @@ def smtp_MAIL(self, arg):
self.push(syntaxerr)
return
if not self._decode_data:
- body = params.pop('BODY', '7BIT')
- if body not in ['7BIT', '8BITMIME']:
- self.push('501 Error: BODY can only be one of 7BIT, 8BITMIME')
+ body = params.pop("BODY", "7BIT")
+ if body not in ["7BIT", "8BITMIME"]:
+ self.push("501 Error: BODY can only be one of 7BIT, 8BITMIME")
return
if self.enable_SMTPUTF8:
- smtputf8 = params.pop('SMTPUTF8', False)
+ smtputf8 = params.pop("SMTPUTF8", False)
if smtputf8 is True:
self.require_SMTPUTF8 = True
elif smtputf8 is not False:
- self.push('501 Error: SMTPUTF8 takes no arguments')
+ self.push("501 Error: SMTPUTF8 takes no arguments")
return
- size = params.pop('SIZE', None)
+ size = params.pop("SIZE", None)
if size:
if not size.isdigit():
self.push(syntaxerr)
return
elif self.data_size_limit and int(size) > self.data_size_limit:
- self.push('552 Error: message size exceeds fixed maximum message size')
+ self.push("552 Error: message size exceeds fixed maximum message size")
return
if len(params.keys()) > 0:
- self.push('555 MAIL FROM parameters not recognized or not implemented')
+ self.push("555 MAIL FROM parameters not recognized or not implemented")
return
self.mailfrom = address
- print('sender:', self.mailfrom, file=DEBUGSTREAM)
- self.push('250 OK')
+ print("sender:", self.mailfrom, file=DEBUGSTREAM)
+ self.push("250 OK")
def smtp_RCPT(self, arg):
if not self.seen_greeting:
- self.push('503 Error: send HELO first');
+ self.push("503 Error: send HELO first")
return
- print('===> RCPT', arg, file=DEBUGSTREAM)
+ print("===> RCPT", arg, file=DEBUGSTREAM)
if not self.mailfrom:
- self.push('503 Error: need MAIL command')
+ self.push("503 Error: need MAIL command")
return
- syntaxerr = '501 Syntax: RCPT TO: '
+ syntaxerr = "501 Syntax: RCPT TO: "
if self.extended_smtp:
- syntaxerr += ' [SP ]'
+ syntaxerr += " [SP ]"
if arg is None:
self.push(syntaxerr)
return
- arg = self._strip_command_keyword('TO:', arg)
+ arg = self._strip_command_keyword("TO:", arg)
address, params = self._getaddr(arg)
if not address:
self.push(syntaxerr)
@@ -605,36 +605,36 @@ def smtp_RCPT(self, arg):
return
# XXX currently there are no options we recognize.
if len(params.keys()) > 0:
- self.push('555 RCPT TO parameters not recognized or not implemented')
+ self.push("555 RCPT TO parameters not recognized or not implemented")
return
self.rcpttos.append(address)
- print('recips:', self.rcpttos, file=DEBUGSTREAM)
- self.push('250 OK')
+ print("recips:", self.rcpttos, file=DEBUGSTREAM)
+ self.push("250 OK")
def smtp_RSET(self, arg):
if arg:
- self.push('501 Syntax: RSET')
+ self.push("501 Syntax: RSET")
return
self._set_rset_state()
- self.push('250 OK')
+ self.push("250 OK")
def smtp_DATA(self, arg):
if not self.seen_greeting:
- self.push('503 Error: send HELO first');
+ self.push("503 Error: send HELO first")
return
if not self.rcpttos:
- self.push('503 Error: need RCPT command')
+ self.push("503 Error: need RCPT command")
return
if arg:
- self.push('501 Syntax: DATA')
+ self.push("501 Syntax: DATA")
return
self.smtp_state = self.DATA
- self.set_terminator(b'\r\n.\r\n')
- self.push('354 End data with .')
+ self.set_terminator(b"\r\n.\r\n")
+ self.push("354 End data with .")
# Commands that have not been implemented
def smtp_EXPN(self, arg):
- self.push('502 EXPN not implemented')
+ self.push("502 EXPN not implemented")
class SMTPServer(asyncore.dispatcher):
@@ -665,12 +665,12 @@ def __init__(self, localaddr, remoteaddr,
self.close()
raise
else:
- print('%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
+ print("%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s" % (
self.__class__.__name__, time.ctime(time.time()),
localaddr, remoteaddr), file=DEBUGSTREAM)
def handle_accepted(self, conn, addr):
- print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM)
+ print("Incoming connection from %s" % repr(addr), file=DEBUGSTREAM)
channel = self.channel_class(self,
conn,
addr,
@@ -722,10 +722,10 @@ def _print_message_content(self, peer, data):
for line in lines:
# headers first
if inheaders and not line:
- peerheader = 'X-Peer: ' + peer[0]
+ peerheader = "X-Peer: " + peer[0]
if not isinstance(data, str):
# decoded_data=false; make header match other binary output
- peerheader = repr(peerheader.encode('utf-8'))
+ peerheader = repr(peerheader.encode("utf-8"))
print(peerheader)
inheaders = 0
if not isinstance(data, str):
@@ -734,35 +734,35 @@ def _print_message_content(self, peer, data):
print(line)
def process_message(self, peer, mailfrom, rcpttos, data, **kwargs):
- print('---------- MESSAGE FOLLOWS ----------')
+ print("---------- MESSAGE FOLLOWS ----------")
if kwargs:
- if kwargs.get('mail_options'):
- print('mail options: %s' % kwargs['mail_options'])
- if kwargs.get('rcpt_options'):
- print('rcpt options: %s\n' % kwargs['rcpt_options'])
+ if kwargs.get("mail_options"):
+ print("mail options: %s" % kwargs["mail_options"])
+ if kwargs.get("rcpt_options"):
+ print("rcpt options: %s\n" % kwargs["rcpt_options"])
self._print_message_content(peer, data)
- print('------------ END MESSAGE ------------')
+ print("------------ END MESSAGE ------------")
class PureProxy(SMTPServer):
def __init__(self, *args, **kwargs):
- if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']:
+ if "enable_SMTPUTF8" in kwargs and kwargs["enable_SMTPUTF8"]:
raise ValueError("PureProxy does not support SMTPUTF8.")
super(PureProxy, self).__init__(*args, **kwargs)
def process_message(self, peer, mailfrom, rcpttos, data):
- lines = data.split('\n')
+ lines = data.split("\n")
# Look for the last header
i = 0
for line in lines:
if not line:
break
i += 1
- lines.insert(i, 'X-Peer: %s' % peer[0])
+ lines.insert(i, "X-Peer: %s" % peer[0])
data = NEWLINE.join(lines)
refused = self._deliver(mailfrom, rcpttos, data)
# TBD: what to do with refused addresses?
- print('we got some refusals:', refused, file=DEBUGSTREAM)
+ print("we got some refusals:", refused, file=DEBUGSTREAM)
def _deliver(self, mailfrom, rcpttos, data):
import smtplib
@@ -775,15 +775,15 @@ def _deliver(self, mailfrom, rcpttos, data):
finally:
s.quit()
except smtplib.SMTPRecipientsRefused as e:
- print('got SMTPRecipientsRefused', file=DEBUGSTREAM)
+ print("got SMTPRecipientsRefused", file=DEBUGSTREAM)
refused = e.recipients
except (OSError, smtplib.SMTPException) as e:
- print('got', e.__class__, file=DEBUGSTREAM)
+ print("got", e.__class__, file=DEBUGSTREAM)
# All recipients were refused. If the exception had an associated
# error code, use it. Otherwise,fake it with a non-triggering
# exception code.
- errcode = getattr(e, 'smtp_code', -1)
- errmsg = getattr(e, 'smtp_error', 'ignore')
+ errcode = getattr(e, "smtp_code", -1)
+ errmsg = getattr(e, "smtp_error", "ignore")
for r in rcpttos:
refused[r] = (errcode, errmsg)
return refused
@@ -791,9 +791,9 @@ def _deliver(self, mailfrom, rcpttos, data):
class MailmanProxy(PureProxy):
def __init__(self, *args, **kwargs):
- warn('MailmanProxy is deprecated and will be removed '
- 'in future', DeprecationWarning, 2)
- if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']:
+ warn("MailmanProxy is deprecated and will be removed "
+ "in future", DeprecationWarning, 2)
+ if "enable_SMTPUTF8" in kwargs and kwargs["enable_SMTPUTF8"]:
raise ValueError("MailmanProxy does not support SMTPUTF8.")
super(PureProxy, self).__init__(*args, **kwargs)
@@ -807,7 +807,7 @@ def process_message(self, peer, mailfrom, rcpttos, data):
# Otherwise we'll forward it to the local proxy for disposition.
listnames = []
for rcpt in rcpttos:
- local = rcpt.lower().split('@')[0]
+ local = rcpt.lower().split("@")[0]
# We allow the following variations on the theme
# listname
# listname-admin
@@ -815,16 +815,16 @@ def process_message(self, peer, mailfrom, rcpttos, data):
# listname-request
# listname-join
# listname-leave
- parts = local.split('-')
+ parts = local.split("-")
if len(parts) > 2:
continue
listname = parts[0]
if len(parts) == 2:
command = parts[1]
else:
- command = ''
+ command = ""
if not Utils.list_exists(listname) or command not in (
- '', 'admin', 'owner', 'request', 'join', 'leave'):
+ "", "admin", "owner", "request", "join", "leave"):
continue
listnames.append((rcpt, listname, command))
# Remove all list recipients from rcpttos and forward what we're not
@@ -833,11 +833,11 @@ def process_message(self, peer, mailfrom, rcpttos, data):
for rcpt, listname, command in listnames:
rcpttos.remove(rcpt)
# If there's any non-list destined recipients left,
- print('forwarding recips:', ' '.join(rcpttos), file=DEBUGSTREAM)
+ print("forwarding recips:", " ".join(rcpttos), file=DEBUGSTREAM)
if rcpttos:
refused = self._deliver(mailfrom, rcpttos, data)
# TBD: what to do with refused addresses?
- print('we got refusals:', refused, file=DEBUGSTREAM)
+ print("we got refusals:", refused, file=DEBUGSTREAM)
# Now deliver directly to the list commands
mlists = {}
s = StringIO(data)
@@ -845,38 +845,38 @@ def process_message(self, peer, mailfrom, rcpttos, data):
# These headers are required for the proper execution of Mailman. All
# MTAs in existence seem to add these if the original message doesn't
# have them.
- if not msg.get('from'):
- msg['From'] = mailfrom
- if not msg.get('date'):
- msg['Date'] = time.ctime(time.time())
+ if not msg.get("from"):
+ msg["From"] = mailfrom
+ if not msg.get("date"):
+ msg["Date"] = time.ctime(time.time())
for rcpt, listname, command in listnames:
- print('sending message to', rcpt, file=DEBUGSTREAM)
+ print("sending message to", rcpt, file=DEBUGSTREAM)
mlist = mlists.get(listname)
if not mlist:
mlist = MailList.MailList(listname, lock=0)
mlists[listname] = mlist
# dispatch on the type of command
- if command == '':
+ if command == "":
# post
msg.Enqueue(mlist, tolist=1)
- elif command == 'admin':
+ elif command == "admin":
msg.Enqueue(mlist, toadmin=1)
- elif command == 'owner':
+ elif command == "owner":
msg.Enqueue(mlist, toowner=1)
- elif command == 'request':
+ elif command == "request":
msg.Enqueue(mlist, torequest=1)
- elif command in ('join', 'leave'):
+ elif command in ("join", "leave"):
# TBD: this is a hack!
- if command == 'join':
- msg['Subject'] = 'subscribe'
+ if command == "join":
+ msg["Subject"] = "subscribe"
else:
- msg['Subject'] = 'unsubscribe'
+ msg["Subject"] = "unsubscribe"
msg.Enqueue(mlist, torequest=1)
class Options:
setuid = True
- classname = 'PureProxy'
+ classname = "PureProxy"
size_limit = None
enable_SMTPUTF8 = False
@@ -885,69 +885,69 @@ def parseargs():
global DEBUGSTREAM
try:
opts, args = getopt.getopt(
- sys.argv[1:], 'nVhc:s:du',
- ['class=', 'nosetuid', 'version', 'help', 'size=', 'debug',
- 'smtputf8'])
+ sys.argv[1:], "nVhc:s:du",
+ ["class=", "nosetuid", "version", "help", "size=", "debug",
+ "smtputf8"])
except getopt.error as e:
usage(1, e)
options = Options()
for opt, arg in opts:
- if opt in ('-h', '--help'):
+ if opt in ("-h", "--help"):
usage(0)
- elif opt in ('-V', '--version'):
+ elif opt in ("-V", "--version"):
print(__version__)
sys.exit(0)
- elif opt in ('-n', '--nosetuid'):
+ elif opt in ("-n", "--nosetuid"):
options.setuid = False
- elif opt in ('-c', '--class'):
+ elif opt in ("-c", "--class"):
options.classname = arg
- elif opt in ('-d', '--debug'):
+ elif opt in ("-d", "--debug"):
DEBUGSTREAM = sys.stderr
- elif opt in ('-u', '--smtputf8'):
+ elif opt in ("-u", "--smtputf8"):
options.enable_SMTPUTF8 = True
- elif opt in ('-s', '--size'):
+ elif opt in ("-s", "--size"):
try:
int_size = int(arg)
options.size_limit = int_size
except:
- print('Invalid size: ' + arg, file=sys.stderr)
+ print("Invalid size: " + arg, file=sys.stderr)
sys.exit(1)
# parse the rest of the arguments
if len(args) < 1:
- localspec = 'localhost:8025'
- remotespec = 'localhost:25'
+ localspec = "localhost:8025"
+ remotespec = "localhost:25"
elif len(args) < 2:
localspec = args[0]
- remotespec = 'localhost:25'
+ remotespec = "localhost:25"
elif len(args) < 3:
localspec = args[0]
remotespec = args[1]
else:
- usage(1, 'Invalid arguments: %s' % COMMASPACE.join(args))
+ usage(1, "Invalid arguments: %s" % COMMASPACE.join(args))
# split into host/port pairs
- i = localspec.find(':')
+ i = localspec.find(":")
if i < 0:
- usage(1, 'Bad local spec: %s' % localspec)
+ usage(1, "Bad local spec: %s" % localspec)
options.localhost = localspec[:i]
try:
options.localport = int(localspec[i+1:])
except ValueError:
- usage(1, 'Bad local port: %s' % localspec)
- i = remotespec.find(':')
+ usage(1, "Bad local port: %s" % localspec)
+ i = remotespec.find(":")
if i < 0:
- usage(1, 'Bad remote spec: %s' % remotespec)
+ usage(1, "Bad remote spec: %s" % remotespec)
options.remotehost = remotespec[:i]
try:
options.remoteport = int(remotespec[i+1:])
except ValueError:
- usage(1, 'Bad remote port: %s' % remotespec)
+ usage(1, "Bad remote port: %s" % remotespec)
return options
-if __name__ == '__main__':
+if __name__ == "__main__":
options = parseargs()
# Become nobody
classname = options.classname
@@ -967,7 +967,7 @@ def parseargs():
except ImportError:
print('Cannot import module "pwd"; try running with -n option.', file=sys.stderr)
sys.exit(1)
- nobody = pwd.getpwnam('nobody')[2]
+ nobody = pwd.getpwnam("nobody")[2]
try:
os.setuid(nobody)
except PermissionError:
diff --git a/.venv3.10/Lib/smtplib.py b/.venv3.10/Lib/smtplib.py
index 324a1c19..f59d3527 100644
--- a/.venv3.10/Lib/smtplib.py
+++ b/.venv3.10/Lib/smtplib.py
@@ -149,16 +149,16 @@ def quoteaddr(addrstring):
Should be able to handle anything email.utils.parseaddr can handle.
"""
displayname, addr = email.utils.parseaddr(addrstring)
- if (displayname, addr) == ('', ''):
+ if (displayname, addr) == ("", ""):
# parseaddr couldn't parse it, use it as is and hope for the best.
- if addrstring.strip().startswith('<'):
+ if addrstring.strip().startswith("<"):
return addrstring
return "<%s>" % addrstring
return "<%s>" % addr
def _addr_only(addrstring):
displayname, addr = email.utils.parseaddr(addrstring)
- if (displayname, addr) == ('', ''):
+ if (displayname, addr) == ("", ""):
# parseaddr couldn't parse it, so use it as is.
return addrstring
return addr
@@ -170,14 +170,14 @@ def quotedata(data):
Double leading '.', and change Unix newline '\\n', or Mac '\\r' into
internet CRLF end-of-line.
"""
- return re.sub(r'(?m)^\.', '..',
- re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))
+ return re.sub(r"(?m)^\.", "..",
+ re.sub(r"(?:\r\n|\n|\r(?!\n))", CRLF, data))
def _quote_periods(bindata):
- return re.sub(br'(?m)^\.', b'..', bindata)
+ return re.sub(br"(?m)^\.", b"..", bindata)
def _fix_eols(data):
- return re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)
+ return re.sub(r"(?:\r\n|\n|\r(?!\n))", CRLF, data)
try:
import ssl
@@ -226,7 +226,7 @@ class SMTP:
does_esmtp = False
default_port = SMTP_PORT
- def __init__(self, host='', port=0, local_hostname=None,
+ def __init__(self, host="", port=0, local_hostname=None,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None):
"""Initialize a new instance.
@@ -247,7 +247,7 @@ def __init__(self, host='', port=0, local_hostname=None,
self._host = host
self.timeout = timeout
self.esmtp_features = {}
- self.command_encoding = 'ascii'
+ self.command_encoding = "ascii"
self.source_address = source_address
self._auth_challenge_count = 0
@@ -263,16 +263,16 @@ def __init__(self, host='', port=0, local_hostname=None,
# if that can't be calculated, that we should use a domain literal
# instead (essentially an encoded IP address like [A.B.C.D]).
fqdn = socket.getfqdn()
- if '.' in fqdn:
+ if "." in fqdn:
self.local_hostname = fqdn
else:
# We can't find an fqdn hostname, so use a domain literal
- addr = '127.0.0.1'
+ addr = "127.0.0.1"
try:
addr = socket.gethostbyname(socket.gethostname())
except socket.gaierror:
pass
- self.local_hostname = '[%s]' % addr
+ self.local_hostname = "[%s]" % addr
def __enter__(self):
return self
@@ -306,13 +306,13 @@ def _get_socket(self, host, port, timeout):
# This makes it simpler for SMTP_SSL to use the SMTP connect code
# and just alter the socket connection bit.
if timeout is not None and not timeout:
- raise ValueError('Non-blocking socket (timeout=0) is not supported')
+ raise ValueError("Non-blocking socket (timeout=0) is not supported")
if self.debuglevel > 0:
- self._print_debug('connect: to', (host, port), self.source_address)
+ self._print_debug("connect: to", (host, port), self.source_address)
return socket.create_connection((host, port), timeout,
self.source_address)
- def connect(self, host='localhost', port=0, source_address=None):
+ def connect(self, host="localhost", port=0, source_address=None):
"""Connect to a host on a given port.
If the hostname ends with a colon (`:') followed by a number, and
@@ -327,8 +327,8 @@ def connect(self, host='localhost', port=0, source_address=None):
if source_address:
self.source_address = source_address
- if not port and (host.find(':') == host.rfind(':')):
- i = host.rfind(':')
+ if not port and (host.find(":") == host.rfind(":")):
+ i = host.rfind(":")
if i >= 0:
host, port = host[:i], host[i + 1:]
try:
@@ -342,13 +342,13 @@ def connect(self, host='localhost', port=0, source_address=None):
self.file = None
(code, msg) = self.getreply()
if self.debuglevel > 0:
- self._print_debug('connect:', repr(msg))
+ self._print_debug("connect:", repr(msg))
return (code, msg)
def send(self, s):
"""Send `s' to the server."""
if self.debuglevel > 0:
- self._print_debug('send:', repr(s))
+ self._print_debug("send:", repr(s))
if self.sock:
if isinstance(s, str):
# send is used by the 'data' command, where command_encoding
@@ -360,22 +360,22 @@ def send(self, s):
self.sock.sendall(s)
except OSError:
self.close()
- raise SMTPServerDisconnected('Server not connected')
+ raise SMTPServerDisconnected("Server not connected")
else:
- raise SMTPServerDisconnected('please run connect() first')
+ raise SMTPServerDisconnected("please run connect() first")
def putcmd(self, cmd, args=""):
"""Send a command to the server."""
if args == "":
s = cmd
else:
- s = f'{cmd} {args}'
- if '\r' in s or '\n' in s:
- s = s.replace('\n', '\\n').replace('\r', '\\r')
+ s = f"{cmd} {args}"
+ if "\r" in s or "\n" in s:
+ s = s.replace("\n", "\\n").replace("\r", "\\r")
raise ValueError(
- f'command and arguments contain prohibited newline characters: {s}'
+ f"command and arguments contain prohibited newline characters: {s}"
)
- self.send(f'{s}{CRLF}')
+ self.send(f"{s}{CRLF}")
def getreply(self):
"""Get a reply from the server.
@@ -392,7 +392,7 @@ def getreply(self):
"""
resp = []
if self.file is None:
- self.file = self.sock.makefile('rb')
+ self.file = self.sock.makefile("rb")
while 1:
try:
line = self.file.readline(_MAXLINE + 1)
@@ -404,11 +404,11 @@ def getreply(self):
self.close()
raise SMTPServerDisconnected("Connection unexpectedly closed")
if self.debuglevel > 0:
- self._print_debug('reply:', repr(line))
+ self._print_debug("reply:", repr(line))
if len(line) > _MAXLINE:
self.close()
raise SMTPResponseException(500, "Line too long.")
- resp.append(line[4:].strip(b' \t\r\n'))
+ resp.append(line[4:].strip(b" \t\r\n"))
code = line[:3]
# Check that the error code is syntactically correct.
# Don't attempt to read a continuation line if it is broken.
@@ -423,7 +423,7 @@ def getreply(self):
errmsg = b"\n".join(resp)
if self.debuglevel > 0:
- self._print_debug('reply: retcode (%s); Msg: %a' % (errcode, errmsg))
+ self._print_debug("reply: retcode (%s); Msg: %a" % (errcode, errmsg))
return errcode, errmsg
def docmd(self, cmd, args=""):
@@ -432,7 +432,7 @@ def docmd(self, cmd, args=""):
return self.getreply()
# std smtp commands
- def helo(self, name=''):
+ def helo(self, name=""):
"""SMTP 'helo' command.
Hostname to send for this command defaults to the FQDN of the local
host.
@@ -442,7 +442,7 @@ def helo(self, name=''):
self.helo_resp = msg
return (code, msg)
- def ehlo(self, name=''):
+ def ehlo(self, name=""):
""" SMTP 'ehlo' command.
Hostname to send for this command defaults to the FQDN of the local
host.
@@ -462,7 +462,7 @@ def ehlo(self, name=''):
self.does_esmtp = True
#parse the ehlo response -ddm
assert isinstance(self.ehlo_resp, bytes), repr(self.ehlo_resp)
- resp = self.ehlo_resp.decode("latin-1").split('\n')
+ resp = self.ehlo_resp.decode("latin-1").split("\n")
del resp[0]
for each in resp:
# To be able to communicate with as many SMTP servers as possible,
@@ -482,7 +482,7 @@ def ehlo(self, name=''):
# It's actually stricter, in that only spaces are allowed between
# parameters, but were not going to check for that here. Note
# that the space isn't present if there are no parameters.
- m = re.match(r'(?P[A-Za-z0-9][A-Za-z0-9\-]*) ?', each)
+ m = re.match(r"(?P[A-Za-z0-9][A-Za-z0-9\-]*) ?", each)
if m:
feature = m.group("feature").lower()
params = m.string[m.end("feature"):].strip()
@@ -497,7 +497,7 @@ def has_extn(self, opt):
"""Does the server support a given SMTP service extension?"""
return opt.lower() in self.esmtp_features
- def help(self, args=''):
+ def help(self, args=""):
"""SMTP 'help' command.
Returns help text from server."""
self.putcmd("help", args)
@@ -505,7 +505,7 @@ def help(self, args=''):
def rset(self):
"""SMTP 'rset' command -- resets session."""
- self.command_encoding = 'ascii'
+ self.command_encoding = "ascii"
return self.docmd("rset")
def _rset(self):
@@ -533,23 +533,23 @@ def mail(self, sender, options=()):
but the SMTPUTF8 extension is not supported by
the server.
"""
- optionlist = ''
+ optionlist = ""
if options and self.does_esmtp:
- if any(x.lower()=='smtputf8' for x in options):
- if self.has_extn('smtputf8'):
- self.command_encoding = 'utf-8'
+ if any(x.lower()=="smtputf8" for x in options):
+ if self.has_extn("smtputf8"):
+ self.command_encoding = "utf-8"
else:
raise SMTPNotSupportedError(
- 'SMTPUTF8 not supported by server')
- optionlist = ' ' + ' '.join(options)
+ "SMTPUTF8 not supported by server")
+ optionlist = " " + " ".join(options)
self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))
return self.getreply()
def rcpt(self, recip, options=()):
"""SMTP 'rcpt' command -- indicates 1 recipient for this mail."""
- optionlist = ''
+ optionlist = ""
if options and self.does_esmtp:
- optionlist = ' ' + ' '.join(options)
+ optionlist = " " + " ".join(options)
self.putcmd("rcpt", "TO:%s%s" % (quoteaddr(recip), optionlist))
return self.getreply()
@@ -566,12 +566,12 @@ def data(self, msg):
self.putcmd("data")
(code, repl) = self.getreply()
if self.debuglevel > 0:
- self._print_debug('data:', (code, repl))
+ self._print_debug("data:", (code, repl))
if code != 354:
raise SMTPDataError(code, repl)
else:
if isinstance(msg, str):
- msg = _fix_eols(msg).encode('ascii')
+ msg = _fix_eols(msg).encode("ascii")
q = _quote_periods(msg)
if q[-2:] != bCRLF:
q = q + bCRLF
@@ -579,7 +579,7 @@ def data(self, msg):
self.send(q)
(code, msg) = self.getreply()
if self.debuglevel > 0:
- self._print_debug('data:', (code, msg))
+ self._print_debug("data:", (code, msg))
return (code, msg)
def verify(self, address):
@@ -638,7 +638,7 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True):
mechanism = mechanism.upper()
initial_response = (authobject() if initial_response_ok else None)
if initial_response is not None:
- response = encode_base64(initial_response.encode('ascii'), eol='')
+ response = encode_base64(initial_response.encode("ascii"), eol="")
(code, resp) = self.docmd("AUTH", mechanism + " " + response)
self._auth_challenge_count = 1
else:
@@ -649,7 +649,7 @@ def auth(self, mechanism, authobject, *, initial_response_ok=True):
self._auth_challenge_count += 1
challenge = base64.decodebytes(resp)
response = encode_base64(
- authobject(challenge).encode('ascii'), eol='')
+ authobject(challenge).encode("ascii"), eol="")
(code, resp) = self.docmd(response)
# If server keeps sending challenges, something is wrong.
if self._auth_challenge_count > _MAXCHALLENGE:
@@ -668,7 +668,7 @@ def auth_cram_md5(self, challenge=None):
if challenge is None:
return None
return self.user + " " + hmac.HMAC(
- self.password.encode('ascii'), challenge, 'md5').hexdigest()
+ self.password.encode("ascii"), challenge, "md5").hexdigest()
def auth_plain(self, challenge=None):
""" Authobject to use with PLAIN authentication. Requires self.user and
@@ -720,7 +720,7 @@ def login(self, user, password, *, initial_response_ok=True):
advertised_authlist = self.esmtp_features["auth"].split()
# Authentication methods we can handle in our preferred order:
- preferred_auths = ['CRAM-MD5', 'PLAIN', 'LOGIN']
+ preferred_auths = ["CRAM-MD5", "PLAIN", "LOGIN"]
# We try the supported authentications in our preferred order, if
# the server supports them.
@@ -734,7 +734,7 @@ def login(self, user, password, *, initial_response_ok=True):
# all methods.
self.user, self.password = user, password
for authmethod in authlist:
- method_name = 'auth_' + authmethod.lower().replace('-', '_')
+ method_name = "auth_" + authmethod.lower().replace("-", "_")
try:
(code, resp) = self.auth(
authmethod, getattr(self, method_name),
@@ -872,9 +872,9 @@ def sendmail(self, from_addr, to_addrs, msg, mail_options=(),
self.ehlo_or_helo_if_needed()
esmtp_opts = []
if isinstance(msg, str):
- msg = _fix_eols(msg).encode('ascii')
+ msg = _fix_eols(msg).encode("ascii")
if self.does_esmtp:
- if self.has_extn('size'):
+ if self.has_extn("size"):
esmtp_opts.append("size=%d" % len(msg))
for option in mail_options:
esmtp_opts.append(option)
@@ -941,34 +941,34 @@ def send_message(self, msg, from_addr=None, to_addrs=None,
# possible to guess correctly almost all of the time.)
self.ehlo_or_helo_if_needed()
- resent = msg.get_all('Resent-Date')
+ resent = msg.get_all("Resent-Date")
if resent is None:
- header_prefix = ''
+ header_prefix = ""
elif len(resent) == 1:
- header_prefix = 'Resent-'
+ header_prefix = "Resent-"
else:
raise ValueError("message has more than one 'Resent-' header block")
if from_addr is None:
# Prefer the sender field per RFC 2822:3.6.2.
- from_addr = (msg[header_prefix + 'Sender']
- if (header_prefix + 'Sender') in msg
- else msg[header_prefix + 'From'])
+ from_addr = (msg[header_prefix + "Sender"]
+ if (header_prefix + "Sender") in msg
+ else msg[header_prefix + "From"])
from_addr = email.utils.getaddresses([from_addr])[0][1]
if to_addrs is None:
- addr_fields = [f for f in (msg[header_prefix + 'To'],
- msg[header_prefix + 'Bcc'],
- msg[header_prefix + 'Cc'])
+ addr_fields = [f for f in (msg[header_prefix + "To"],
+ msg[header_prefix + "Bcc"],
+ msg[header_prefix + "Cc"])
if f is not None]
to_addrs = [a[1] for a in email.utils.getaddresses(addr_fields)]
# Make a local copy so we can delete the bcc headers.
msg_copy = copy.copy(msg)
- del msg_copy['Bcc']
- del msg_copy['Resent-Bcc']
+ del msg_copy["Bcc"]
+ del msg_copy["Resent-Bcc"]
international = False
try:
- ''.join([from_addr, *to_addrs]).encode('ascii')
+ "".join([from_addr, *to_addrs]).encode("ascii")
except UnicodeEncodeError:
- if not self.has_extn('smtputf8'):
+ if not self.has_extn("smtputf8"):
raise SMTPNotSupportedError(
"One or more source or delivery addresses require"
" internationalized email support, but the server"
@@ -978,10 +978,10 @@ def send_message(self, msg, from_addr=None, to_addrs=None,
if international:
g = email.generator.BytesGenerator(
bytesmsg, policy=msg.policy.clone(utf8=True))
- mail_options = (*mail_options, 'SMTPUTF8', 'BODY=8BITMIME')
+ mail_options = (*mail_options, "SMTPUTF8", "BODY=8BITMIME")
else:
g = email.generator.BytesGenerator(bytesmsg)
- g.flatten(msg_copy, linesep='\r\n')
+ g.flatten(msg_copy, linesep="\r\n")
flatmsg = bytesmsg.getvalue()
return self.sendmail(from_addr, to_addrs, flatmsg, mail_options,
rcpt_options)
@@ -1027,7 +1027,7 @@ class SMTP_SSL(SMTP):
default_port = SMTP_SSL_PORT
- def __init__(self, host='', port=0, local_hostname=None,
+ def __init__(self, host="", port=0, local_hostname=None,
keyfile=None, certfile=None,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None, context=None):
@@ -1052,7 +1052,7 @@ def __init__(self, host='', port=0, local_hostname=None,
def _get_socket(self, host, port, timeout):
if self.debuglevel > 0:
- self._print_debug('connect:', (host, port))
+ self._print_debug("connect:", (host, port))
new_socket = super()._get_socket(host, port, timeout)
new_socket = self.context.wrap_socket(new_socket,
server_hostname=self._host)
@@ -1081,19 +1081,19 @@ class LMTP(SMTP):
ehlo_msg = "lhlo"
- def __init__(self, host='', port=LMTP_PORT, local_hostname=None,
+ def __init__(self, host="", port=LMTP_PORT, local_hostname=None,
source_address=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
"""Initialize a new instance."""
super().__init__(host, port, local_hostname=local_hostname,
source_address=source_address, timeout=timeout)
- def connect(self, host='localhost', port=0, source_address=None):
+ def connect(self, host="localhost", port=0, source_address=None):
"""Connect to the LMTP daemon, on either a Unix or a TCP socket."""
- if host[0] != '/':
+ if host[0] != "/":
return super().connect(host, port, source_address=source_address)
if self.timeout is not None and not self.timeout:
- raise ValueError('Non-blocking socket (timeout=0) is not supported')
+ raise ValueError("Non-blocking socket (timeout=0) is not supported")
# Handle Unix-domain sockets.
try:
@@ -1104,29 +1104,29 @@ def connect(self, host='localhost', port=0, source_address=None):
self.sock.connect(host)
except OSError:
if self.debuglevel > 0:
- self._print_debug('connect fail:', host)
+ self._print_debug("connect fail:", host)
if self.sock:
self.sock.close()
self.sock = None
raise
(code, msg) = self.getreply()
if self.debuglevel > 0:
- self._print_debug('connect:', msg)
+ self._print_debug("connect:", msg)
return (code, msg)
# Test the sendmail method, which tests most of the others.
# Note: This always sends to localhost.
-if __name__ == '__main__':
+if __name__ == "__main__":
def prompt(prompt):
sys.stdout.write(prompt + ": ")
sys.stdout.flush()
return sys.stdin.readline().strip()
fromaddr = prompt("From")
- toaddrs = prompt("To").split(',')
+ toaddrs = prompt("To").split(",")
print("Enter message, end with ^D:")
- msg = ''
+ msg = ""
while 1:
line = sys.stdin.readline()
if not line:
@@ -1134,7 +1134,7 @@ def prompt(prompt):
msg = msg + line
print("Message length is %d" % len(msg))
- server = SMTP('localhost')
+ server = SMTP("localhost")
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
diff --git a/.venv3.10/Lib/sndhdr.py b/.venv3.10/Lib/sndhdr.py
index 96595c69..d0cac820 100644
--- a/.venv3.10/Lib/sndhdr.py
+++ b/.venv3.10/Lib/sndhdr.py
@@ -30,12 +30,12 @@
# The file structure is top-down except that the test program and its
# subroutine come last.
-__all__ = ['what', 'whathdr']
+__all__ = ["what", "whathdr"]
from collections import namedtuple
-SndHeaders = namedtuple('SndHeaders',
- 'filetype framerate nchannels nframes sampwidth')
+SndHeaders = namedtuple("SndHeaders",
+ "filetype framerate nchannels nframes sampwidth")
SndHeaders.filetype.__doc__ = ("""The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
@@ -57,7 +57,7 @@ def what(filename):
def whathdr(filename):
"""Recognize sound headers."""
- with open(filename, 'rb') as f:
+ with open(filename, "rb") as f:
h = f.read(512)
for tf in tests:
res = tf(h, f)
@@ -74,17 +74,17 @@ def whathdr(filename):
def test_aifc(h, f):
import aifc
- if not h.startswith(b'FORM'):
+ if not h.startswith(b"FORM"):
return None
- if h[8:12] == b'AIFC':
- fmt = 'aifc'
- elif h[8:12] == b'AIFF':
- fmt = 'aiff'
+ if h[8:12] == b"AIFC":
+ fmt = "aifc"
+ elif h[8:12] == b"AIFF":
+ fmt = "aiff"
else:
return None
f.seek(0)
try:
- a = aifc.open(f, 'r')
+ a = aifc.open(f, "r")
except (EOFError, aifc.Error):
return None
return (fmt, a.getframerate(), a.getnchannels(),
@@ -94,13 +94,13 @@ def test_aifc(h, f):
def test_au(h, f):
- if h.startswith(b'.snd'):
+ if h.startswith(b".snd"):
func = get_long_be
- elif h[:4] in (b'\0ds.', b'dns.'):
+ elif h[:4] in (b"\0ds.", b"dns."):
func = get_long_le
else:
return None
- filetype = 'au'
+ filetype = "au"
hdr_size = func(h[4:8])
data_size = func(h[8:12])
encoding = func(h[12:16])
@@ -108,14 +108,14 @@ def test_au(h, f):
nchannels = func(h[20:24])
sample_size = 1 # default
if encoding == 1:
- sample_bits = 'U'
+ sample_bits = "U"
elif encoding == 2:
sample_bits = 8
elif encoding == 3:
sample_bits = 16
sample_size = 2
else:
- sample_bits = '?'
+ sample_bits = "?"
frame_size = sample_size * nchannels
if frame_size:
nframe = data_size / frame_size
@@ -127,20 +127,20 @@ def test_au(h, f):
def test_hcom(h, f):
- if h[65:69] != b'FSSD' or h[128:132] != b'HCOM':
+ if h[65:69] != b"FSSD" or h[128:132] != b"HCOM":
return None
divisor = get_long_be(h[144:148])
if divisor:
rate = 22050 / divisor
else:
rate = 0
- return 'hcom', rate, 1, -1, 8
+ return "hcom", rate, 1, -1, 8
tests.append(test_hcom)
def test_voc(h, f):
- if not h.startswith(b'Creative Voice File\032'):
+ if not h.startswith(b"Creative Voice File\032"):
return None
sbseek = get_short_le(h[20:22])
rate = 0
@@ -148,7 +148,7 @@ def test_voc(h, f):
ratecode = 256 - h[sbseek+4]
if ratecode:
rate = int(1000000.0 / ratecode)
- return 'voc', rate, 1, -1, 8
+ return "voc", rate, 1, -1, 8
tests.append(test_voc)
@@ -156,42 +156,42 @@ def test_voc(h, f):
def test_wav(h, f):
import wave
# 'RIFF' 'WAVE' 'fmt '
- if not h.startswith(b'RIFF') or h[8:12] != b'WAVE' or h[12:16] != b'fmt ':
+ if not h.startswith(b"RIFF") or h[8:12] != b"WAVE" or h[12:16] != b"fmt ":
return None
f.seek(0)
try:
- w = wave.open(f, 'r')
+ w = wave.open(f, "r")
except (EOFError, wave.Error):
return None
- return ('wav', w.getframerate(), w.getnchannels(),
+ return ("wav", w.getframerate(), w.getnchannels(),
w.getnframes(), 8*w.getsampwidth())
tests.append(test_wav)
def test_8svx(h, f):
- if not h.startswith(b'FORM') or h[8:12] != b'8SVX':
+ if not h.startswith(b"FORM") or h[8:12] != b"8SVX":
return None
# Should decode it to get #channels -- assume always 1
- return '8svx', 0, 1, 0, 8
+ return "8svx", 0, 1, 0, 8
tests.append(test_8svx)
def test_sndt(h, f):
- if h.startswith(b'SOUND'):
+ if h.startswith(b"SOUND"):
nsamples = get_long_le(h[8:12])
rate = get_short_le(h[20:22])
- return 'sndt', rate, 1, nsamples, 8
+ return "sndt", rate, 1, nsamples, 8
tests.append(test_sndt)
def test_sndr(h, f):
- if h.startswith(b'\0\0'):
+ if h.startswith(b"\0\0"):
rate = get_short_le(h[2:4])
if 4000 <= rate <= 25000:
- return 'sndr', rate, 1, -1, 8
+ return "sndr", rate, 1, -1, 8
tests.append(test_sndr)
@@ -220,16 +220,16 @@ def get_short_le(b):
def test():
import sys
recursive = 0
- if sys.argv[1:] and sys.argv[1] == '-r':
+ if sys.argv[1:] and sys.argv[1] == "-r":
del sys.argv[1:2]
recursive = 1
try:
if sys.argv[1:]:
testall(sys.argv[1:], recursive, 1)
else:
- testall(['.'], recursive, 1)
+ testall(["."], recursive, 1)
except KeyboardInterrupt:
- sys.stderr.write('\n[Interrupted]\n')
+ sys.stderr.write("\n[Interrupted]\n")
sys.exit(1)
def testall(list, recursive, toplevel):
@@ -237,21 +237,21 @@ def testall(list, recursive, toplevel):
import os
for filename in list:
if os.path.isdir(filename):
- print(filename + '/:', end=' ')
+ print(filename + "/:", end=" ")
if recursive or toplevel:
- print('recursing down:')
+ print("recursing down:")
import glob
- names = glob.glob(os.path.join(glob.escape(filename), '*'))
+ names = glob.glob(os.path.join(glob.escape(filename), "*"))
testall(names, recursive, 0)
else:
- print('*** directory (use -r) ***')
+ print("*** directory (use -r) ***")
else:
- print(filename + ':', end=' ')
+ print(filename + ":", end=" ")
sys.stdout.flush()
try:
print(what(filename))
except OSError:
- print('*** not found ***')
+ print("*** not found ***")
-if __name__ == '__main__':
+if __name__ == "__main__":
test()
diff --git a/.venv3.10/Lib/socket.py b/.venv3.10/Lib/socket.py
index ecaf73cf..8ec44403 100644
--- a/.venv3.10/Lib/socket.py
+++ b/.venv3.10/Lib/socket.py
@@ -51,16 +51,19 @@
import _socket
from _socket import *
-import os, sys, io, selectors
+import os
+import sys
+import io
+import selectors
from enum import IntEnum, IntFlag
try:
import errno
except ImportError:
errno = None
-EBADF = getattr(errno, 'EBADF', 9)
-EAGAIN = getattr(errno, 'EAGAIN', 11)
-EWOULDBLOCK = getattr(errno, 'EWOULDBLOCK', 11)
+EBADF = getattr(errno, "EBADF", 9)
+EAGAIN = getattr(errno, "EAGAIN", 11)
+EWOULDBLOCK = getattr(errno, "EWOULDBLOCK", 11)
__all__ = ["fromfd", "getfqdn", "create_connection", "create_server",
"has_dualstack_ipv6", "AddressFamily", "SocketKind"]
@@ -73,27 +76,27 @@
# where needed (e.g. .family property of a socket object).
IntEnum._convert_(
- 'AddressFamily',
+ "AddressFamily",
__name__,
- lambda C: C.isupper() and C.startswith('AF_'))
+ lambda C: C.isupper() and C.startswith("AF_"))
IntEnum._convert_(
- 'SocketKind',
+ "SocketKind",
__name__,
- lambda C: C.isupper() and C.startswith('SOCK_'))
+ lambda C: C.isupper() and C.startswith("SOCK_"))
IntFlag._convert_(
- 'MsgFlag',
+ "MsgFlag",
__name__,
- lambda C: C.isupper() and C.startswith('MSG_'))
+ lambda C: C.isupper() and C.startswith("MSG_"))
IntFlag._convert_(
- 'AddressInfo',
+ "AddressInfo",
__name__,
- lambda C: C.isupper() and C.startswith('AI_'))
+ lambda C: C.isupper() and C.startswith("AI_"))
-_LOCALHOST = '127.0.0.1'
-_LOCALHOST_V6 = '::1'
+_LOCALHOST = "127.0.0.1"
+_LOCALHOST_V6 = "::1"
def _intenum_converter(value, enum_klass):
@@ -244,7 +247,7 @@ def __repr__(self):
"""Wrap __repr__() to reveal the real class name and socket
address(es).
"""
- closed = getattr(self, '_closed', False)
+ closed = getattr(self, "_closed", False)
s = "<%s.%s%s fd=%i, family=%s, type=%s, proto=%i" \
% (self.__class__.__module__,
self.__class__.__qualname__,
@@ -266,7 +269,7 @@ def __repr__(self):
s += ", raddr=%s" % str(raddr)
except error:
pass
- s += '>'
+ s += ">"
return s
def __getstate__(self):
@@ -342,7 +345,7 @@ def makefile(self, mode="r", buffering=None, *,
text.mode = mode
return text
- if hasattr(os, 'sendfile'):
+ if hasattr(os, "sendfile"):
def _sendfile_use_sendfile(self, file, offset=0, count=None):
self._check_sendfile_params(file, offset, count)
@@ -365,7 +368,7 @@ def _sendfile_use_sendfile(self, file, offset=0, count=None):
# poll/select have the advantage of not requiring any
# extra file descriptor, contrarily to epoll/kqueue
# (also, they require a single syscall).
- if hasattr(selectors, 'PollSelector'):
+ if hasattr(selectors, "PollSelector"):
selector = selectors.PollSelector()
else:
selector = selectors.SelectSelector()
@@ -378,7 +381,7 @@ def _sendfile_use_sendfile(self, file, offset=0, count=None):
try:
while True:
if timeout and not selector_select(timeout):
- raise TimeoutError('timed out')
+ raise TimeoutError("timed out")
if count:
blocksize = count - total_sent
if blocksize <= 0:
@@ -406,7 +409,7 @@ def _sendfile_use_sendfile(self, file, offset=0, count=None):
total_sent += sent
return total_sent
finally:
- if total_sent > 0 and hasattr(file, 'seek'):
+ if total_sent > 0 and hasattr(file, "seek"):
file.seek(offset)
else:
def _sendfile_use_sendfile(self, file, offset=0, count=None):
@@ -446,11 +449,11 @@ def _sendfile_use_send(self, file, offset=0, count=None):
break
return total_sent
finally:
- if total_sent > 0 and hasattr(file, 'seek'):
+ if total_sent > 0 and hasattr(file, "seek"):
file.seek(offset + total_sent)
def _check_sendfile_params(self, file, offset, count):
- if 'b' not in getattr(file, 'mode', 'b'):
+ if "b" not in getattr(file, "mode", "b"):
raise ValueError("file should be opened in binary mode")
if not self.type & SOCK_STREAM:
raise ValueError("only SOCK_STREAM type sockets are supported")
@@ -523,7 +526,7 @@ def type(self):
"""
return _intenum_converter(super().type, SocketKind)
- if os.name == 'nt':
+ if os.name == "nt":
def get_inheritable(self):
return os.get_handle_inheritable(self.fileno())
def set_inheritable(self, inheritable):
@@ -788,7 +791,7 @@ def close(self):
self._sock = None
-def getfqdn(name=''):
+def getfqdn(name=""):
"""Get fully qualified domain name from name.
An empty argument is interpreted as meaning the local host.
@@ -799,7 +802,7 @@ def getfqdn(name=''):
hostname from gethostname() is returned.
"""
name = name.strip()
- if not name or name in ('0.0.0.0', '::'):
+ if not name or name in ("0.0.0.0", "::"):
name = gethostname()
try:
hostname, aliases, ipaddrs = gethostbyaddr(name)
@@ -808,7 +811,7 @@ def getfqdn(name=''):
else:
aliases.insert(0, hostname)
for name in aliases:
- if '.' in name:
+ if "." in name:
break
else:
name = hostname
@@ -867,8 +870,8 @@ def has_dualstack_ipv6():
which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
"""
if not has_ipv6 \
- or not hasattr(_socket, 'IPPROTO_IPV6') \
- or not hasattr(_socket, 'IPV6_V6ONLY'):
+ or not hasattr(_socket, "IPPROTO_IPV6") \
+ or not hasattr(_socket, "IPV6_V6ONLY"):
return False
try:
with socket(AF_INET6, SOCK_STREAM) as sock:
@@ -915,8 +918,8 @@ def create_server(address, *, family=AF_INET, backlog=None, reuse_port=False,
# connections. Also, it may set the process in a state where
# it'll no longer respond to any signals or graceful kills.
# See: https://learn.microsoft.com/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse
- if os.name not in ('nt', 'cygwin') and \
- hasattr(_socket, 'SO_REUSEADDR'):
+ if os.name not in ("nt", "cygwin") and \
+ hasattr(_socket, "SO_REUSEADDR"):
try:
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
except error:
@@ -934,7 +937,7 @@ def create_server(address, *, family=AF_INET, backlog=None, reuse_port=False,
try:
sock.bind(address)
except error as err:
- msg = '%s (while attempting to bind on address %r)' % \
+ msg = "%s (while attempting to bind on address %r)" % \
(err.strerror, address)
raise error(err.errno, msg) from None
if backlog is None:
diff --git a/.venv3.10/Lib/socketserver.py b/.venv3.10/Lib/socketserver.py
index 0d9583d5..f47b2fc3 100644
--- a/.venv3.10/Lib/socketserver.py
+++ b/.venv3.10/Lib/socketserver.py
@@ -144,7 +144,7 @@ class will essentially render the service "deaf" while one request is
# poll/select have the advantage of not requiring any extra file descriptor,
# contrarily to epoll/kqueue (also, they require a single syscall).
-if hasattr(selectors, 'PollSelector'):
+if hasattr(selectors, "PollSelector"):
_ServerSelector = selectors.PollSelector
else:
_ServerSelector = selectors.SelectSelector
@@ -373,12 +373,12 @@ def handle_error(self, request, client_address):
The default is to print a traceback and continue.
"""
- print('-'*40, file=sys.stderr)
- print('Exception occurred during processing of request from',
+ print("-"*40, file=sys.stderr)
+ print("Exception occurred during processing of request from",
client_address, file=sys.stderr)
import traceback
traceback.print_exc()
- print('-'*40, file=sys.stderr)
+ print("-"*40, file=sys.stderr)
def __enter__(self):
return self
@@ -689,7 +689,7 @@ def process_request_thread(self, request, client_address):
def process_request(self, request, client_address):
"""Start a new thread to process the request."""
if self.block_on_close:
- vars(self).setdefault('_threads', _Threads())
+ vars(self).setdefault("_threads", _Threads())
t = threading.Thread(target = self.process_request_thread,
args = (request, client_address))
t.daemon = self.daemon_threads
@@ -708,7 +708,7 @@ class ForkingTCPServer(ForkingMixIn, TCPServer): pass
class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
class ThreadingTCPServer(ThreadingMixIn, TCPServer): pass
-if hasattr(socket, 'AF_UNIX'):
+if hasattr(socket, "AF_UNIX"):
class UnixStreamServer(TCPServer):
address_family = socket.AF_UNIX
@@ -794,11 +794,11 @@ def setup(self):
if self.disable_nagle_algorithm:
self.connection.setsockopt(socket.IPPROTO_TCP,
socket.TCP_NODELAY, True)
- self.rfile = self.connection.makefile('rb', self.rbufsize)
+ self.rfile = self.connection.makefile("rb", self.rbufsize)
if self.wbufsize == 0:
self.wfile = _SocketWriter(self.connection)
else:
- self.wfile = self.connection.makefile('wb', self.wbufsize)
+ self.wfile = self.connection.makefile("wb", self.wbufsize)
def finish(self):
if not self.wfile.closed:
diff --git a/.venv3.10/Lib/sqlite3/dbapi2.py b/.venv3.10/Lib/sqlite3/dbapi2.py
index cfe6225f..2603939c 100644
--- a/.venv3.10/Lib/sqlite3/dbapi2.py
+++ b/.venv3.10/Lib/sqlite3/dbapi2.py
@@ -69,7 +69,7 @@ def convert_timestamp(val):
timepart_full = timepart.split(b".")
hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
if len(timepart_full) == 2:
- microseconds = int('{:0<6.6}'.format(timepart_full[1].decode()))
+ microseconds = int("{:0<6.6}".format(timepart_full[1].decode()))
else:
microseconds = 0
diff --git a/.venv3.10/Lib/sqlite3/dump.py b/.venv3.10/Lib/sqlite3/dump.py
index 07b9da10..3ac02373 100644
--- a/.venv3.10/Lib/sqlite3/dump.py
+++ b/.venv3.10/Lib/sqlite3/dump.py
@@ -17,7 +17,7 @@ def _iterdump(connection):
"""
cu = connection.cursor()
- yield('BEGIN TRANSACTION;')
+ yield("BEGIN TRANSACTION;")
# sqlite_master table contains the SQL CREATE statements for the database.
q = """
@@ -30,7 +30,7 @@ def _iterdump(connection):
schema_res = cu.execute(q)
sqlite_sequence = []
for table_name, type, sql in schema_res.fetchall():
- if table_name == 'sqlite_sequence':
+ if table_name == "sqlite_sequence":
rows = cu.execute('SELECT * FROM "sqlite_sequence";').fetchall()
sqlite_sequence = ['DELETE FROM "sqlite_sequence"']
sqlite_sequence += [
@@ -38,9 +38,9 @@ def _iterdump(connection):
for row in rows
]
continue
- elif table_name == 'sqlite_stat1':
+ elif table_name == "sqlite_stat1":
yield('ANALYZE "sqlite_master";')
- elif table_name.startswith('sqlite_'):
+ elif table_name.startswith("sqlite_"):
continue
# NOTE: Virtual table support not implemented
#elif sql.startswith('CREATE VIRTUAL TABLE'):
@@ -50,7 +50,7 @@ def _iterdump(connection):
# qtable,
# sql.replace("''")))
else:
- yield('{0};'.format(sql))
+ yield("{0};".format(sql))
# Build the insert statement for each row of the current table
table_name_ident = table_name.replace('"', '""')
@@ -72,11 +72,11 @@ def _iterdump(connection):
"""
schema_res = cu.execute(q)
for name, type, sql in schema_res.fetchall():
- yield('{0};'.format(sql))
+ yield("{0};".format(sql))
# gh-79009: Yield statements concerning the sqlite_sequence table at the
# end of the transaction.
for row in sqlite_sequence:
- yield('{0};'.format(row))
+ yield("{0};".format(row))
- yield('COMMIT;')
+ yield("COMMIT;")
diff --git a/.venv3.10/Lib/sqlite3/test/backup.py b/.venv3.10/Lib/sqlite3/test/backup.py
index 4e30594b..1c6886ee 100644
--- a/.venv3.10/Lib/sqlite3/test/backup.py
+++ b/.venv3.10/Lib/sqlite3/test/backup.py
@@ -5,8 +5,8 @@
class BackupTests(unittest.TestCase):
def setUp(self):
cx = self.cx = sqlite.connect(":memory:")
- cx.execute('CREATE TABLE foo (key INTEGER)')
- cx.executemany('INSERT INTO foo (key) VALUES (?)', [(3,), (4,)])
+ cx.execute("CREATE TABLE foo (key INTEGER)")
+ cx.executemany("INSERT INTO foo (key) VALUES (?)", [(3,), (4,)])
cx.commit()
def tearDown(self):
@@ -25,41 +25,41 @@ def test_bad_target(self):
def test_bad_target_filename(self):
with self.assertRaises(TypeError):
- self.cx.backup('some_file_name.db')
+ self.cx.backup("some_file_name.db")
def test_bad_target_same_connection(self):
with self.assertRaises(ValueError):
self.cx.backup(self.cx)
def test_bad_target_closed_connection(self):
- bck = sqlite.connect(':memory:')
+ bck = sqlite.connect(":memory:")
bck.close()
with self.assertRaises(sqlite.ProgrammingError):
self.cx.backup(bck)
def test_bad_source_closed_connection(self):
- bck = sqlite.connect(':memory:')
+ bck = sqlite.connect(":memory:")
source = sqlite.connect(":memory:")
source.close()
with self.assertRaises(sqlite.ProgrammingError):
source.backup(bck)
def test_bad_target_in_transaction(self):
- bck = sqlite.connect(':memory:')
- bck.execute('CREATE TABLE bar (key INTEGER)')
- bck.executemany('INSERT INTO bar (key) VALUES (?)', [(3,), (4,)])
+ bck = sqlite.connect(":memory:")
+ bck.execute("CREATE TABLE bar (key INTEGER)")
+ bck.executemany("INSERT INTO bar (key) VALUES (?)", [(3,), (4,)])
with self.assertRaises(sqlite.OperationalError) as cm:
self.cx.backup(bck)
if sqlite.sqlite_version_info < (3, 8, 8):
- self.assertEqual(str(cm.exception), 'target is in transaction')
+ self.assertEqual(str(cm.exception), "target is in transaction")
def test_keyword_only_args(self):
with self.assertRaises(TypeError):
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck, 1)
def test_simple(self):
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck)
self.verify_backup(bck)
@@ -69,7 +69,7 @@ def test_progress(self):
def progress(status, remaining, total):
journal.append(status)
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck, pages=1, progress=progress)
self.verify_backup(bck)
@@ -83,7 +83,7 @@ def test_progress_all_pages_at_once_1(self):
def progress(status, remaining, total):
journal.append(remaining)
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck, progress=progress)
self.verify_backup(bck)
@@ -96,7 +96,7 @@ def test_progress_all_pages_at_once_2(self):
def progress(status, remaining, total):
journal.append(remaining)
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck, pages=-1, progress=progress)
self.verify_backup(bck)
@@ -105,20 +105,20 @@ def progress(status, remaining, total):
def test_non_callable_progress(self):
with self.assertRaises(TypeError) as cm:
- with sqlite.connect(':memory:') as bck:
- self.cx.backup(bck, pages=1, progress='bar')
- self.assertEqual(str(cm.exception), 'progress argument must be a callable')
+ with sqlite.connect(":memory:") as bck:
+ self.cx.backup(bck, pages=1, progress="bar")
+ self.assertEqual(str(cm.exception), "progress argument must be a callable")
def test_modifying_progress(self):
journal = []
def progress(status, remaining, total):
if not journal:
- self.cx.execute('INSERT INTO foo (key) VALUES (?)', (remaining+1000,))
+ self.cx.execute("INSERT INTO foo (key) VALUES (?)", (remaining+1000,))
self.cx.commit()
journal.append(remaining)
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck, pages=1, progress=progress)
self.verify_backup(bck)
@@ -134,29 +134,29 @@ def progress(status, remaining, total):
def test_failing_progress(self):
def progress(status, remaining, total):
- raise SystemError('nearly out of space')
+ raise SystemError("nearly out of space")
with self.assertRaises(SystemError) as err:
- with sqlite.connect(':memory:') as bck:
+ with sqlite.connect(":memory:") as bck:
self.cx.backup(bck, progress=progress)
- self.assertEqual(str(err.exception), 'nearly out of space')
+ self.assertEqual(str(err.exception), "nearly out of space")
def test_database_source_name(self):
- with sqlite.connect(':memory:') as bck:
- self.cx.backup(bck, name='main')
- with sqlite.connect(':memory:') as bck:
- self.cx.backup(bck, name='temp')
+ with sqlite.connect(":memory:") as bck:
+ self.cx.backup(bck, name="main")
+ with sqlite.connect(":memory:") as bck:
+ self.cx.backup(bck, name="temp")
with self.assertRaises(sqlite.OperationalError) as cm:
- with sqlite.connect(':memory:') as bck:
- self.cx.backup(bck, name='non-existing')
+ with sqlite.connect(":memory:") as bck:
+ self.cx.backup(bck, name="non-existing")
self.assertIn("unknown database", str(cm.exception))
self.cx.execute("ATTACH DATABASE ':memory:' AS attached_db")
- self.cx.execute('CREATE TABLE attached_db.foo (key INTEGER)')
- self.cx.executemany('INSERT INTO attached_db.foo (key) VALUES (?)', [(3,), (4,)])
+ self.cx.execute("CREATE TABLE attached_db.foo (key INTEGER)")
+ self.cx.executemany("INSERT INTO attached_db.foo (key) VALUES (?)", [(3,), (4,)])
self.cx.commit()
- with sqlite.connect(':memory:') as bck:
- self.cx.backup(bck, name='attached_db')
+ with sqlite.connect(":memory:") as bck:
+ self.cx.backup(bck, name="attached_db")
self.verify_backup(bck)
diff --git a/.venv3.10/Lib/sqlite3/test/dbapi.py b/.venv3.10/Lib/sqlite3/test/dbapi.py
index a764c82b..2fbc38db 100644
--- a/.venv3.10/Lib/sqlite3/test/dbapi.py
+++ b/.venv3.10/Lib/sqlite3/test/dbapi.py
@@ -185,17 +185,17 @@ def __fspath__(self):
return TESTFN
path = Path()
with sqlite.connect(path) as cx:
- cx.execute('create table test(id integer)')
+ cx.execute("create table test(id integer)")
def test_open_uri(self):
self.addCleanup(unlink, TESTFN)
with sqlite.connect(TESTFN) as cx:
- cx.execute('create table test(id integer)')
- with sqlite.connect('file:' + TESTFN, uri=True) as cx:
- cx.execute('insert into test(id) values(0)')
- with sqlite.connect('file:' + TESTFN + '?mode=ro', uri=True) as cx:
+ cx.execute("create table test(id integer)")
+ with sqlite.connect("file:" + TESTFN, uri=True) as cx:
+ cx.execute("insert into test(id) values(0)")
+ with sqlite.connect("file:" + TESTFN + "?mode=ro", uri=True) as cx:
with self.assertRaises(sqlite.OperationalError):
- cx.execute('insert into test(id) values(1)')
+ cx.execute("insert into test(id) values(1)")
class UninitialisedConnectionTests(unittest.TestCase):
@@ -278,7 +278,7 @@ def test_execute_arg_string_with_zero_byte(self):
def test_execute_non_iterable(self):
with self.assertRaises(ValueError) as cm:
self.cu.execute("insert into test(id) values (?)", 42)
- self.assertEqual(str(cm.exception), 'parameters are of unsupported type')
+ self.assertEqual(str(cm.exception), "parameters are of unsupported type")
def test_execute_wrong_no_of_args1(self):
# too many parameters
@@ -392,7 +392,7 @@ def test_rowcount_update_returning(self):
def test_total_changes(self):
self.cu.execute("insert into test(name) values ('foo')")
self.cu.execute("insert into test(name) values ('foo')")
- self.assertLess(2, self.cx.total_changes, msg='total changes reported wrong value')
+ self.assertLess(2, self.cx.total_changes, msg="total changes reported wrong value")
# Checks for executemany:
# Sequences are required by the DB-API, iterators
@@ -526,36 +526,36 @@ def test_last_row_id_on_replace(self):
"""
INSERT OR REPLACE and REPLACE INTO should produce the same behavior.
"""
- sql = '{} INTO test(id, unique_test) VALUES (?, ?)'
- for statement in ('INSERT OR REPLACE', 'REPLACE'):
+ sql = "{} INTO test(id, unique_test) VALUES (?, ?)"
+ for statement in ("INSERT OR REPLACE", "REPLACE"):
with self.subTest(statement=statement):
- self.cu.execute(sql.format(statement), (1, 'foo'))
+ self.cu.execute(sql.format(statement), (1, "foo"))
self.assertEqual(self.cu.lastrowid, 1)
def test_last_row_id_on_ignore(self):
self.cu.execute(
"insert or ignore into test(unique_test) values (?)",
- ('test',))
+ ("test",))
self.assertEqual(self.cu.lastrowid, 2)
self.cu.execute(
"insert or ignore into test(unique_test) values (?)",
- ('test',))
+ ("test",))
self.assertEqual(self.cu.lastrowid, 2)
def test_last_row_id_insert_o_r(self):
results = []
- for statement in ('FAIL', 'ABORT', 'ROLLBACK'):
- sql = 'INSERT OR {} INTO test(unique_test) VALUES (?)'
- with self.subTest(statement='INSERT OR {}'.format(statement)):
+ for statement in ("FAIL", "ABORT", "ROLLBACK"):
+ sql = "INSERT OR {} INTO test(unique_test) VALUES (?)"
+ with self.subTest(statement="INSERT OR {}".format(statement)):
self.cu.execute(sql.format(statement), (statement,))
results.append((statement, self.cu.lastrowid))
with self.assertRaises(sqlite.IntegrityError):
self.cu.execute(sql.format(statement), (statement,))
results.append((statement, self.cu.lastrowid))
expected = [
- ('FAIL', 2), ('FAIL', 2),
- ('ABORT', 3), ('ABORT', 3),
- ('ROLLBACK', 4), ('ROLLBACK', 4),
+ ("FAIL", 2), ("FAIL", 2),
+ ("ABORT", 3), ("ABORT", 3),
+ ("ROLLBACK", 4), ("ROLLBACK", 4),
]
self.assertEqual(results, expected)
@@ -770,7 +770,7 @@ def test_cursor_executescript_as_bytes(self):
cur = con.cursor()
with self.assertRaises(ValueError) as cm:
cur.executescript(b"create table test(foo); insert into test(foo) values (5);")
- self.assertEqual(str(cm.exception), 'script argument must be unicode.')
+ self.assertEqual(str(cm.exception), "script argument must be unicode.")
def test_connection_execute(self):
con = sqlite.connect(":memory:")
@@ -926,7 +926,7 @@ def test_on_conflict_abort_raises_with_explicit_transactions(self):
self.cx.commit()
self.cu.execute("SELECT name, unique_name FROM test")
# Expect the first two inserts to work, third to do nothing.
- self.assertEqual(self.cu.fetchall(), [('abort_test', None), (None, 'foo',)])
+ self.assertEqual(self.cu.fetchall(), [("abort_test", None), (None, "foo",)])
def test_on_conflict_rollback_without_transaction(self):
# Start of implicit transaction
@@ -947,7 +947,7 @@ def test_on_conflict_abort_raises_without_transactions(self):
self.cu.execute("INSERT OR ABORT INTO test(unique_name) VALUES ('foo')")
# Make sure all other values were inserted.
self.cu.execute("SELECT name, unique_name FROM test")
- self.assertEqual(self.cu.fetchall(), [('abort_test', None), (None, 'foo',)])
+ self.assertEqual(self.cu.fetchall(), [("abort_test", None), (None, "foo",)])
def test_on_conflict_fail(self):
self.cu.execute("INSERT OR FAIL INTO test(unique_name) VALUES ('foo')")
@@ -960,14 +960,14 @@ def test_on_conflict_ignore(self):
# Nothing should happen.
self.cu.execute("INSERT OR IGNORE INTO test(unique_name) VALUES ('foo')")
self.cu.execute("SELECT unique_name FROM test")
- self.assertEqual(self.cu.fetchall(), [('foo',)])
+ self.assertEqual(self.cu.fetchall(), [("foo",)])
def test_on_conflict_replace(self):
self.cu.execute("INSERT OR REPLACE INTO test(name, unique_name) VALUES ('Data!', 'foo')")
# There shouldn't be an IntegrityError exception.
self.cu.execute("INSERT OR REPLACE INTO test(name, unique_name) VALUES ('Very different data!', 'foo')")
self.cu.execute("SELECT name, unique_name FROM test")
- self.assertEqual(self.cu.fetchall(), [('Very different data!', 'foo')])
+ self.assertEqual(self.cu.fetchall(), [("Very different data!", "foo")])
class MultiprocessTests(unittest.TestCase):
diff --git a/.venv3.10/Lib/sqlite3/test/dump.py b/.venv3.10/Lib/sqlite3/test/dump.py
index 0e324ee1..af67cfec 100644
--- a/.venv3.10/Lib/sqlite3/test/dump.py
+++ b/.venv3.10/Lib/sqlite3/test/dump.py
@@ -45,8 +45,8 @@ def test_table_dump(self):
[self.cu.execute(s) for s in expected_sqls]
i = self.cx.iterdump()
actual_sqls = [s for s in i]
- expected_sqls = ['BEGIN TRANSACTION;'] + expected_sqls + \
- ['COMMIT;']
+ expected_sqls = ["BEGIN TRANSACTION;"] + expected_sqls + \
+ ["COMMIT;"]
[self.assertEqual(expected_sqls[i], actual_sqls[i])
for i in range(len(expected_sqls))]
@@ -64,7 +64,7 @@ def test_dump_autoincrement(self):
expected.extend([
'DELETE FROM "sqlite_sequence";',
'INSERT INTO "sqlite_sequence" VALUES(\'t1\',1);',
- 'COMMIT;',
+ "COMMIT;",
])
actual = [stmt for stmt in self.cx.iterdump()]
diff --git a/.venv3.10/Lib/sqlite3/test/factory.py b/.venv3.10/Lib/sqlite3/test/factory.py
index 40a290f0..54842bb7 100644
--- a/.venv3.10/Lib/sqlite3/test/factory.py
+++ b/.venv3.10/Lib/sqlite3/test/factory.py
@@ -112,11 +112,11 @@ def test_sqlite_row_index(self):
self.assertEqual(row[-2], 1, "by index: wrong result for column -2")
with self.assertRaises(IndexError):
- row['c']
+ row["c"]
with self.assertRaises(IndexError):
- row['a_\x11']
+ row["a_\x11"]
with self.assertRaises(IndexError):
- row['a\x7f1']
+ row["a\x7f1"]
with self.assertRaises(IndexError):
row[2]
with self.assertRaises(IndexError):
@@ -129,9 +129,9 @@ def test_sqlite_row_index_unicode(self):
row = self.con.execute("select 1 as \xff").fetchone()
self.assertEqual(row["\xff"], 1)
with self.assertRaises(IndexError):
- row['\u0178']
+ row["\u0178"]
with self.assertRaises(IndexError):
- row['\xdf']
+ row["\xdf"]
def test_sqlite_row_slice(self):
# A sqlite.Row can be sliced like a list.
@@ -169,7 +169,7 @@ def test_sqlite_row_as_tuple(self):
self.con.row_factory = sqlite.Row
row = self.con.execute("select 1 as a, 2 as b").fetchone()
t = tuple(row)
- self.assertEqual(t, (row['a'], row['b']))
+ self.assertEqual(t, (row["a"], row["b"]))
def test_sqlite_row_as_dict(self):
"""Checks if the row object can be correctly converted to a dictionary"""
diff --git a/.venv3.10/Lib/sqlite3/test/hooks.py b/.venv3.10/Lib/sqlite3/test/hooks.py
index 97121eea..3556ed6c 100644
--- a/.venv3.10/Lib/sqlite3/test/hooks.py
+++ b/.venv3.10/Lib/sqlite3/test/hooks.py
@@ -37,7 +37,7 @@ def test_create_collation_not_callable(self):
con = sqlite.connect(":memory:")
with self.assertRaises(TypeError) as cm:
con.create_collation("X", 42)
- self.assertEqual(str(cm.exception), 'parameter must be callable')
+ self.assertEqual(str(cm.exception), "parameter must be callable")
def test_create_collation_not_ascii(self):
con = sqlite.connect(":memory:")
@@ -58,8 +58,8 @@ def upper(self):
select 'b' as x
) order by x collate mycoll
""").fetchall()
- self.assertEqual(result[0][0], 'b')
- self.assertEqual(result[1][0], 'a')
+ self.assertEqual(result[0][0], "b")
+ self.assertEqual(result[1][0], "a")
def test_collation_is_used(self):
def mycoll(x, y):
@@ -78,13 +78,13 @@ def mycoll(x, y):
) order by x collate mycoll
"""
result = con.execute(sql).fetchall()
- self.assertEqual(result, [('c',), ('b',), ('a',)],
- msg='the expected order was not returned')
+ self.assertEqual(result, [("c",), ("b",), ("a",)],
+ msg="the expected order was not returned")
con.create_collation("mycoll", None)
with self.assertRaises(sqlite.OperationalError) as cm:
result = con.execute(sql).fetchall()
- self.assertEqual(str(cm.exception), 'no such collation sequence: mycoll')
+ self.assertEqual(str(cm.exception), "no such collation sequence: mycoll")
def test_collation_returns_large_integer(self):
def mycoll(x, y):
@@ -102,7 +102,7 @@ def mycoll(x, y):
) order by x collate mycoll
"""
result = con.execute(sql).fetchall()
- self.assertEqual(result, [('c',), ('b',), ('a',)],
+ self.assertEqual(result, [("c",), ("b",), ("a",)],
msg="the expected order was not returned")
def test_collation_register_twice(self):
@@ -116,8 +116,8 @@ def test_collation_register_twice(self):
result = con.execute("""
select x from (select 'a' as x union select 'b' as x) order by x collate mycoll
""").fetchall()
- self.assertEqual(result[0][0], 'b')
- self.assertEqual(result[1][0], 'a')
+ self.assertEqual(result[0][0], "b")
+ self.assertEqual(result[1][0], "a")
def test_deregister_collation(self):
"""
@@ -129,7 +129,7 @@ def test_deregister_collation(self):
con.create_collation("mycoll", None)
with self.assertRaises(sqlite.OperationalError) as cm:
con.execute("select 'a' as x union select 'b' as x order by x collate mycoll")
- self.assertEqual(str(cm.exception), 'no such collation sequence: mycoll')
+ self.assertEqual(str(cm.exception), "no such collation sequence: mycoll")
class ProgressTests(unittest.TestCase):
def test_progress_handler_used(self):
@@ -241,7 +241,7 @@ def test_unicode_content(self):
"""
Test that the statement can contain unicode literals.
"""
- unicode_value = '\xf6\xe4\xfc\xd6\xc4\xdc\xdf\u20ac'
+ unicode_value = "\xf6\xe4\xfc\xd6\xc4\xdc\xdf\u20ac"
con = sqlite.connect(":memory:")
traced_statements = []
def trace(statement):
@@ -252,7 +252,7 @@ def trace(statement):
con.commit()
self.assertTrue(any(unicode_value in stmt for stmt in traced_statements),
"Unicode data %s garbled in trace callback: %s"
- % (ascii(unicode_value), ', '.join(map(ascii, traced_statements))))
+ % (ascii(unicode_value), ", ".join(map(ascii, traced_statements))))
def test_trace_callback_content(self):
# set_trace_callback() shouldn't produce duplicate content (bpo-26187)
diff --git a/.venv3.10/Lib/sqlite3/test/regression.py b/.venv3.10/Lib/sqlite3/test/regression.py
index 8937f9f6..4743b6a5 100644
--- a/.venv3.10/Lib/sqlite3/test/regression.py
+++ b/.venv3.10/Lib/sqlite3/test/regression.py
@@ -183,7 +183,7 @@ def __del__(self):
con.isolation_level = None
con.isolation_level = "DEFERRED"
pairs = [
- (1, TypeError), (b'', TypeError), ("abc", ValueError),
+ (1, TypeError), (b"", TypeError), ("abc", ValueError),
("IMMEDIATE\0EXCLUSIVE", ValueError), ("\xe9", ValueError),
]
for value, exc in pairs:
@@ -206,7 +206,7 @@ def __init__(self, con):
with self.assertRaises(sqlite.ProgrammingError):
cur.execute("select 4+5").fetchall()
with self.assertRaisesRegex(sqlite.ProgrammingError,
- r'^Base Cursor\.__init__ not called\.$'):
+ r"^Base Cursor\.__init__ not called\.$"):
cur.close()
def test_str_subclass(self):
@@ -415,7 +415,7 @@ def log(self, *args):
def test_return_empty_bytestring(self):
cur = self.con.execute("select X''")
val = cur.fetchone()[0]
- self.assertEqual(val, b'')
+ self.assertEqual(val, b"")
class RecursiveUseOfCursors(unittest.TestCase):
@@ -438,18 +438,18 @@ def test_recursive_cursor_init(self):
conv = lambda x: self.cur.__init__(self.con)
with patch.dict(sqlite.converters, {"INIT": conv}):
with self.assertRaisesRegex(sqlite.ProgrammingError, self.msg):
- self.cur.execute(f'select x as "x [INIT]", x from test')
+ self.cur.execute('select x as "x [INIT]", x from test')
def test_recursive_cursor_close(self):
conv = lambda x: self.cur.close()
with patch.dict(sqlite.converters, {"CLOSE": conv}):
with self.assertRaisesRegex(sqlite.ProgrammingError, self.msg):
- self.cur.execute(f'select x as "x [CLOSE]", x from test')
+ self.cur.execute('select x as "x [CLOSE]", x from test')
def test_recursive_cursor_fetch(self):
conv = lambda x, l=[]: self.cur.fetchone() if l else l.append(None)
with patch.dict(sqlite.converters, {"ITER": conv}):
- self.cur.execute(f'select x as "x [ITER]", x from test')
+ self.cur.execute('select x as "x [ITER]", x from test')
with self.assertRaisesRegex(sqlite.ProgrammingError, self.msg):
self.cur.fetchall()
diff --git a/.venv3.10/Lib/sqlite3/test/transactions.py b/.venv3.10/Lib/sqlite3/test/transactions.py
index 4ebc7fbc..8027349e 100644
--- a/.venv3.10/Lib/sqlite3/test/transactions.py
+++ b/.venv3.10/Lib/sqlite3/test/transactions.py
@@ -20,7 +20,7 @@
# misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
-import os, unittest
+import unittest
import sqlite3 as sqlite
from test.support import LOOPBACK_TIMEOUT
diff --git a/.venv3.10/Lib/sqlite3/test/types.py b/.venv3.10/Lib/sqlite3/test/types.py
index 4bb1de80..b5265b0d 100644
--- a/.venv3.10/Lib/sqlite3/test/types.py
+++ b/.venv3.10/Lib/sqlite3/test/types.py
@@ -84,7 +84,7 @@ def __init__(self, _val):
if isinstance(_val, bytes):
# sqlite3 always calls __init__ with a bytes created from a
# UTF-8 string when __conform__ was used to store the object.
- _val = _val.decode('utf-8')
+ _val = _val.decode("utf-8")
self.val = _val
def __eq__(self, other):
diff --git a/.venv3.10/Lib/sqlite3/test/userfunctions.py b/.venv3.10/Lib/sqlite3/test/userfunctions.py
index 539fd4bc..0e829fe1 100644
--- a/.venv3.10/Lib/sqlite3/test/userfunctions.py
+++ b/.venv3.10/Lib/sqlite3/test/userfunctions.py
@@ -245,7 +245,7 @@ def test_func_exception(self):
with self.assertRaises(sqlite.OperationalError) as cm:
cur.execute("select raiseexception()")
cur.fetchone()
- self.assertEqual(str(cm.exception), 'user-defined function raised exception')
+ self.assertEqual(str(cm.exception), "user-defined function raised exception")
def test_any_arguments(self):
cur = self.con.cursor()
@@ -289,7 +289,7 @@ def append_result(arg):
(1234567890123456789, int),
(4611686018427387905, int), # 63-bit int with non-zero low bits
(3.14, float),
- (float('inf'), float),
+ (float("inf"), float),
("text", str),
("1\x002", str),
("\u02e2q\u02e1\u2071\u1d57\u1d49", str),
@@ -346,7 +346,7 @@ def test_func_deterministic_keyword_only(self):
def test_function_destructor_via_gc(self):
# See bpo-44304: The destructor of the user function can
# crash if is called without the GIL from the gc functions
- dest = sqlite.connect(':memory:')
+ dest = sqlite.connect(":memory:")
def md5sum(t):
return
@@ -492,7 +492,7 @@ class AuthorizerTests(unittest.TestCase):
def authorizer_cb(action, arg1, arg2, dbname, source):
if action != sqlite.SQLITE_SELECT:
return sqlite.SQLITE_DENY
- if arg2 == 'c2' or arg1 == 't2':
+ if arg2 == "c2" or arg1 == "t2":
return sqlite.SQLITE_DENY
return sqlite.SQLITE_OK
@@ -516,19 +516,19 @@ def tearDown(self):
def test_table_access(self):
with self.assertRaises(sqlite.DatabaseError) as cm:
self.con.execute("select * from t2")
- self.assertIn('prohibited', str(cm.exception))
+ self.assertIn("prohibited", str(cm.exception))
def test_column_access(self):
with self.assertRaises(sqlite.DatabaseError) as cm:
self.con.execute("select c2 from t1")
- self.assertIn('prohibited', str(cm.exception))
+ self.assertIn("prohibited", str(cm.exception))
class AuthorizerRaiseExceptionTests(AuthorizerTests):
@staticmethod
def authorizer_cb(action, arg1, arg2, dbname, source):
if action != sqlite.SQLITE_SELECT:
raise ValueError
- if arg2 == 'c2' or arg1 == 't2':
+ if arg2 == "c2" or arg1 == "t2":
raise ValueError
return sqlite.SQLITE_OK
@@ -537,7 +537,7 @@ class AuthorizerIllegalTypeTests(AuthorizerTests):
def authorizer_cb(action, arg1, arg2, dbname, source):
if action != sqlite.SQLITE_SELECT:
return 0.0
- if arg2 == 'c2' or arg1 == 't2':
+ if arg2 == "c2" or arg1 == "t2":
return 0.0
return sqlite.SQLITE_OK
@@ -546,7 +546,7 @@ class AuthorizerLargeIntegerTests(AuthorizerTests):
def authorizer_cb(action, arg1, arg2, dbname, source):
if action != sqlite.SQLITE_SELECT:
return 2**32
- if arg2 == 'c2' or arg1 == 't2':
+ if arg2 == "c2" or arg1 == "t2":
return 2**32
return sqlite.SQLITE_OK
diff --git a/.venv3.10/Lib/sre_compile.py b/.venv3.10/Lib/sre_compile.py
index aed752d1..41bfa0f5 100644
--- a/.venv3.10/Lib/sre_compile.py
+++ b/.venv3.10/Lib/sre_compile.py
@@ -333,7 +333,7 @@ def _optimize_charset(charset, iscased=None, fixup=None, fixes=None):
except IndexError:
if len(charmap) == 256:
# character set contains non-UCS1 character codes
- charmap += b'\0' * 0xff00
+ charmap += b"\0" * 0xff00
continue
# Character set contains non-BMP character codes.
# For range, all BMP characters in the range are already
@@ -431,7 +431,7 @@ def _optimize_charset(charset, iscased=None, fixup=None, fixes=None):
_CODEBITS = _sre.CODESIZE * 8
MAXCODE = (1 << _CODEBITS) - 1
-_BITS_TRANS = b'0' + b'1' * 255
+_BITS_TRANS = b"0" + b"1" * 255
def _mk_bitmap(bits, _CODEBITS=_CODEBITS, _int=int):
s = bits.translate(_BITS_TRANS)[::-1]
return [_int(s[i - _CODEBITS: i], 2)
@@ -439,7 +439,7 @@ def _mk_bitmap(bits, _CODEBITS=_CODEBITS, _int=int):
def _bytes_to_codes(b):
# Convert block indices to word array
- a = memoryview(b).cast('I')
+ a = memoryview(b).cast("I")
assert a.itemsize == _sre.CODESIZE
assert len(a) * a.itemsize == len(b)
return a.tolist()
@@ -635,7 +635,7 @@ def _code(p, flags):
return code
def _hex_code(code):
- return '[%s]' % ', '.join('%#0*x' % (_sre.CODESIZE*2+2, x) for x in code)
+ return "[%s]" % ", ".join("%#0*x" % (_sre.CODESIZE*2+2, x) for x in code)
def dis(code):
import sys
@@ -648,13 +648,13 @@ def dis_(start, end):
def print_(*args, to=None):
if to is not None:
labels.add(to)
- args += ('(to %d)' % (to,),)
- print('%*d%s ' % (offset_width, start, ':' if start in labels else '.'),
- end=' '*(level-1))
+ args += ("(to %d)" % (to,),)
+ print("%*d%s " % (offset_width, start, ":" if start in labels else "."),
+ end=" "*(level-1))
print(*args)
def print_2(*args):
- print(end=' '*(offset_width + 2*level))
+ print(end=" "*(offset_width + 2*level))
print(*args)
nonlocal level
@@ -674,18 +674,18 @@ def print_2(*args):
LITERAL_LOC_IGNORE, NOT_LITERAL_LOC_IGNORE):
arg = code[i]
i += 1
- print_(op, '%#02x (%r)' % (arg, chr(arg)))
+ print_(op, "%#02x (%r)" % (arg, chr(arg)))
elif op is AT:
arg = code[i]
i += 1
arg = str(ATCODES[arg])
- assert arg[:3] == 'AT_'
+ assert arg[:3] == "AT_"
print_(op, arg[3:])
elif op is CATEGORY:
arg = code[i]
i += 1
arg = str(CHCODES[arg])
- assert arg[:9] == 'CATEGORY_'
+ assert arg[:9] == "CATEGORY_"
print_(op, arg[9:])
elif op in (IN, IN_IGNORE, IN_UNI_IGNORE, IN_LOC_IGNORE):
skip = code[i]
@@ -695,14 +695,14 @@ def print_2(*args):
elif op in (RANGE, RANGE_UNI_IGNORE):
lo, hi = code[i: i+2]
i += 2
- print_(op, '%#02x %#02x (%r-%r)' % (lo, hi, chr(lo), chr(hi)))
+ print_(op, "%#02x %#02x (%r-%r)" % (lo, hi, chr(lo), chr(hi)))
elif op is CHARSET:
print_(op, _hex_code(code[i: i + 256//_CODEBITS]))
i += 256//_CODEBITS
elif op is BIGCHARSET:
arg = code[i]
i += 1
- mapping = list(b''.join(x.to_bytes(_sre.CODESIZE, sys.byteorder)
+ mapping = list(b"".join(x.to_bytes(_sre.CODESIZE, sys.byteorder)
for x in code[i: i + 256//_sre.CODESIZE]))
print_(op, arg, mapping)
i += 256//_sre.CODESIZE
@@ -729,14 +729,14 @@ def print_2(*args):
start = i
skip = code[i]
if skip:
- print_('branch', skip, to=i+skip)
+ print_("branch", skip, to=i+skip)
else:
print_(FAILURE)
i += 1
elif op in (REPEAT, REPEAT_ONE, MIN_REPEAT_ONE):
skip, min, max = code[i: i+3]
if max == MAXREPEAT:
- max = 'MAXREPEAT'
+ max = "MAXREPEAT"
print_(op, skip, min, max, to=i+skip)
dis_(i+3, i+skip)
i += skip
@@ -752,23 +752,23 @@ def print_2(*args):
elif op is INFO:
skip, flags, min, max = code[i: i+4]
if max == MAXREPEAT:
- max = 'MAXREPEAT'
+ max = "MAXREPEAT"
print_(op, skip, bin(flags), min, max, to=i+skip)
start = i+4
if flags & SRE_INFO_PREFIX:
prefix_len, prefix_skip = code[i+4: i+6]
- print_2(' prefix_skip', prefix_skip)
+ print_2(" prefix_skip", prefix_skip)
start = i + 6
prefix = code[start: start+prefix_len]
- print_2(' prefix',
- '[%s]' % ', '.join('%#02x' % x for x in prefix),
- '(%r)' % ''.join(map(chr, prefix)))
+ print_2(" prefix",
+ "[%s]" % ", ".join("%#02x" % x for x in prefix),
+ "(%r)" % "".join(map(chr, prefix)))
start += prefix_len
- print_2(' overlap', code[start: start+prefix_len])
+ print_2(" overlap", code[start: start+prefix_len])
start += prefix_len
if flags & SRE_INFO_CHARSET:
level += 1
- print_2('in')
+ print_2("in")
dis_(start, i+skip)
level -= 1
i += skip
diff --git a/.venv3.10/Lib/sre_constants.py b/.venv3.10/Lib/sre_constants.py
index db3ca51e..cf0cb563 100644
--- a/.venv3.10/Lib/sre_constants.py
+++ b/.venv3.10/Lib/sre_constants.py
@@ -15,7 +15,7 @@
MAGIC = 20171005
-from _sre import MAXREPEAT, MAXGROUPS
+from _sre import MAXREPEAT
# SRE standard exception (access as sre.error)
# should this really be here?
@@ -32,22 +32,22 @@ class error(Exception):
colno: The column corresponding to pos (may be None)
"""
- __module__ = 're'
+ __module__ = "re"
def __init__(self, msg, pattern=None, pos=None):
self.msg = msg
self.pattern = pattern
self.pos = pos
if pattern is not None and pos is not None:
- msg = '%s at position %d' % (msg, pos)
+ msg = "%s at position %d" % (msg, pos)
if isinstance(pattern, str):
- newline = '\n'
+ newline = "\n"
else:
- newline = b'\n'
+ newline = b"\n"
self.lineno = pattern.count(newline, 0, pos) + 1
self.colno = pos - pattern.rfind(newline, 0, pos)
if newline in pattern:
- msg = '%s (line %d, column %d)' % (msg, self.lineno, self.colno)
+ msg = "%s (line %d, column %d)" % (msg, self.lineno, self.colno)
else:
self.lineno = self.colno = None
super().__init__(msg)
@@ -64,7 +64,7 @@ def __repr__(self):
__reduce__ = None
-MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')
+MAXREPEAT = _NamedIntConstant(MAXREPEAT, "MAXREPEAT")
def _makecodes(names):
names = names.strip().split()
diff --git a/.venv3.10/Lib/sre_parse.py b/.venv3.10/Lib/sre_parse.py
index 20a60250..d9b51ffb 100644
--- a/.venv3.10/Lib/sre_parse.py
+++ b/.venv3.10/Lib/sre_parse.py
@@ -102,10 +102,10 @@ def checkgroup(self, gid):
def checklookbehindgroup(self, gid, source):
if self.lookbehindgroups is not None:
if not self.checkgroup(gid):
- raise source.error('cannot refer to an open group')
+ raise source.error("cannot refer to an open group")
if gid >= self.lookbehindgroups:
- raise source.error('cannot refer to group defined in the same '
- 'lookbehind subpattern')
+ raise source.error("cannot refer to group defined in the same "
+ "lookbehind subpattern")
class SubPattern:
# a subpattern, in intermediate form
@@ -120,7 +120,7 @@ def dump(self, level=0):
nl = True
seqtypes = (tuple, list)
for op, av in self.data:
- print(level*" " + str(op), end='')
+ print(level*" " + str(op), end="")
if op is IN:
# member sublanguage
print()
@@ -134,7 +134,7 @@ def dump(self, level=0):
a.dump(level+1)
elif op is GROUPREF_EXISTS:
condgroup, item_yes, item_no = av
- print('', condgroup)
+ print("", condgroup)
item_yes.dump(level+1)
if item_no:
print(level*" " + "ELSE")
@@ -149,13 +149,13 @@ def dump(self, level=0):
nl = True
else:
if not nl:
- print(' ', end='')
- print(a, end='')
+ print(" ", end="")
+ print(a, end="")
nl = False
if not nl:
print()
else:
- print('', av)
+ print("", av)
def __repr__(self):
return repr(self.data)
def __len__(self):
@@ -226,7 +226,7 @@ def __init__(self, string):
self.istext = isinstance(string, str)
self.string = string
if not self.istext:
- string = str(string, 'latin1')
+ string = str(string, "latin1")
self.decoded_string = string
self.index = 0
self.next = None
@@ -257,7 +257,7 @@ def get(self):
self.__next()
return this
def getwhile(self, n, charset):
- result = ''
+ result = ""
for _ in range(n):
c = self.next
if c not in charset:
@@ -266,7 +266,7 @@ def getwhile(self, n, charset):
self.__next()
return result
def getuntil(self, terminator, name):
- result = ''
+ result = ""
while True:
c = self.next
self.__next()
@@ -283,9 +283,9 @@ def getuntil(self, terminator, name):
return result
@property
def pos(self):
- return self.index - len(self.next or '')
+ return self.index - len(self.next or "")
def tell(self):
- return self.index - len(self.next or '')
+ return self.index - len(self.next or "")
def seek(self, index):
self.index = index
self.__next()
@@ -326,28 +326,28 @@ def _class_escape(source, escape):
elif c == "N" and source.istext:
import unicodedata
# named unicode escape e.g. \N{EM DASH}
- if not source.match('{'):
+ if not source.match("{"):
raise source.error("missing {")
- charname = source.getuntil('}', 'character name')
+ charname = source.getuntil("}", "character name")
try:
c = ord(unicodedata.lookup(charname))
except (KeyError, TypeError):
raise source.error("undefined character name %r" % charname,
- len(charname) + len(r'\N{}'))
+ len(charname) + len(r"\N{}"))
return LITERAL, c
elif c in OCTDIGITS:
# octal escape (up to three digits)
escape += source.getwhile(2, OCTDIGITS)
c = int(escape[1:], 8)
if c > 0o377:
- raise source.error('octal escape value %s outside of '
- 'range 0-0o377' % escape, len(escape))
+ raise source.error("octal escape value %s outside of "
+ "range 0-0o377" % escape, len(escape))
return LITERAL, c
elif c in DIGITS:
raise ValueError
if len(escape) == 2:
if c in ASCIILETTERS:
- raise source.error('bad escape %s' % escape, len(escape))
+ raise source.error("bad escape %s" % escape, len(escape))
return LITERAL, ord(escape[1])
except ValueError:
pass
@@ -386,14 +386,14 @@ def _escape(source, escape, state):
elif c == "N" and source.istext:
import unicodedata
# named unicode escape e.g. \N{EM DASH}
- if not source.match('{'):
+ if not source.match("{"):
raise source.error("missing {")
- charname = source.getuntil('}', 'character name')
+ charname = source.getuntil("}", "character name")
try:
c = ord(unicodedata.lookup(charname))
except (KeyError, TypeError):
raise source.error("undefined character name %r" % charname,
- len(charname) + len(r'\N{}'))
+ len(charname) + len(r"\N{}"))
return LITERAL, c
elif c == "0":
# octal escape
@@ -409,8 +409,8 @@ def _escape(source, escape, state):
escape += source.get()
c = int(escape[1:], 8)
if c > 0o377:
- raise source.error('octal escape value %s outside of '
- 'range 0-0o377' % escape,
+ raise source.error("octal escape value %s outside of "
+ "range 0-0o377" % escape,
len(escape))
return LITERAL, c
# not an octal escape, so this is a group reference
@@ -536,10 +536,10 @@ def _parse(source, state, verbose, nested, first=False):
setappend = set.append
## if sourcematch(":"):
## pass # handle character classes
- if source.next == '[':
+ if source.next == "[":
import warnings
warnings.warn(
- 'Possible nested set at position %d' % source.tell(),
+ "Possible nested set at position %d" % source.tell(),
FutureWarning, stacklevel=nested + 6
)
negate = sourcematch("^")
@@ -554,14 +554,14 @@ def _parse(source, state, verbose, nested, first=False):
elif this[0] == "\\":
code1 = _class_escape(source, this)
else:
- if set and this in '-&~|' and source.next == this:
+ if set and this in "-&~|" and source.next == this:
import warnings
warnings.warn(
- 'Possible set %s at position %d' % (
- 'difference' if this == '-' else
- 'intersection' if this == '&' else
- 'symmetric difference' if this == '~' else
- 'union',
+ "Possible set %s at position %d" % (
+ "difference" if this == "-" else
+ "intersection" if this == "&" else
+ "symmetric difference" if this == "~" else
+ "union",
source.tell() - 1),
FutureWarning, stacklevel=nested + 6
)
@@ -581,10 +581,10 @@ def _parse(source, state, verbose, nested, first=False):
if that[0] == "\\":
code2 = _class_escape(source, that)
else:
- if that == '-':
+ if that == "-":
import warnings
warnings.warn(
- 'Possible set difference at position %d' % (
+ "Possible set difference at position %d" % (
source.tell() - 2),
FutureWarning, stacklevel=nested + 6
)
@@ -812,10 +812,10 @@ def _parse(source, state, verbose, nested, first=False):
if not first or subpattern:
import warnings
warnings.warn(
- 'Flags not at the start of the expression %r%s'
- ' but at position %d' % (
+ "Flags not at the start of the expression %r%s"
+ " but at position %d" % (
source.string[:20], # truncate long regexes
- ' (truncated)' if len(source.string) > 20 else '',
+ " (truncated)" if len(source.string) > 20 else "",
start,
),
DeprecationWarning, stacklevel=nested + 6
@@ -873,11 +873,11 @@ def _parse_flags(source, state, char):
while True:
flag = FLAGS[char]
if source.istext:
- if char == 'L':
+ if char == "L":
msg = "bad inline flags: cannot use 'L' flag with a str pattern"
raise source.error(msg)
else:
- if char == 'u':
+ if char == "u":
msg = "bad inline flags: cannot use 'u' flag with a bytes pattern"
raise source.error(msg)
add_flags |= flag
@@ -991,7 +991,7 @@ def addgroup(index, pos):
if index > state.groups:
raise s.error("invalid group reference %d" % index, pos)
if literal:
- literals.append(''.join(literal))
+ literals.append("".join(literal))
del literal[:]
groups.append((len(literals), index))
literals.append(None)
@@ -1041,8 +1041,8 @@ def addgroup(index, pos):
isoctal = True
c = int(this[1:], 8)
if c > 0o377:
- raise s.error('octal escape value %s outside of '
- 'range 0-0o377' % this, len(this))
+ raise s.error("octal escape value %s outside of "
+ "range 0-0o377" % this, len(this))
lappend(chr(c))
if not isoctal:
addgroup(int(this[1:]), len(this) - 1)
@@ -1051,16 +1051,16 @@ def addgroup(index, pos):
this = chr(ESCAPES[this][1])
except KeyError:
if c in ASCIILETTERS:
- raise s.error('bad escape %s' % this, len(this))
+ raise s.error("bad escape %s" % this, len(this))
lappend(this)
else:
lappend(this)
if literal:
- literals.append(''.join(literal))
+ literals.append("".join(literal))
if not isinstance(source, str):
# The tokenizer implicitly decodes bytes objects as latin-1, we must
# therefore re-encode the final representation.
- literals = [None if s is None else s.encode('latin-1') for s in literals]
+ literals = [None if s is None else s.encode("latin-1") for s in literals]
return groups, literals
def expand_template(template, match):
diff --git a/.venv3.10/Lib/ssl.py b/.venv3.10/Lib/ssl.py
index f386fa78..1f427058 100644
--- a/.venv3.10/Lib/ssl.py
+++ b/.venv3.10/Lib/ssl.py
@@ -98,14 +98,11 @@
import _ssl # if we can't import it, let the error propagate
-from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
-from _ssl import _SSLContext, MemoryBIO, SSLSession
+from _ssl import _SSLContext
from _ssl import (
- SSLError, SSLZeroReturnError, SSLWantReadError, SSLWantWriteError,
- SSLSyscallError, SSLEOFError, SSLCertVerificationError
+ SSLError, SSLCertVerificationError
)
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
-from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
try:
from _ssl import RAND_egd
except ImportError:
@@ -113,47 +110,43 @@
pass
-from _ssl import (
- HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_SSLv2, HAS_SSLv3, HAS_TLSv1,
- HAS_TLSv1_1, HAS_TLSv1_2, HAS_TLSv1_3
-)
-from _ssl import _DEFAULT_CIPHERS, _OPENSSL_API_VERSION
+from _ssl import _DEFAULT_CIPHERS
_IntEnum._convert_(
- '_SSLMethod', __name__,
- lambda name: name.startswith('PROTOCOL_') and name != 'PROTOCOL_SSLv23',
+ "_SSLMethod", __name__,
+ lambda name: name.startswith("PROTOCOL_") and name != "PROTOCOL_SSLv23",
source=_ssl)
_IntFlag._convert_(
- 'Options', __name__,
- lambda name: name.startswith('OP_'),
+ "Options", __name__,
+ lambda name: name.startswith("OP_"),
source=_ssl)
_IntEnum._convert_(
- 'AlertDescription', __name__,
- lambda name: name.startswith('ALERT_DESCRIPTION_'),
+ "AlertDescription", __name__,
+ lambda name: name.startswith("ALERT_DESCRIPTION_"),
source=_ssl)
_IntEnum._convert_(
- 'SSLErrorNumber', __name__,
- lambda name: name.startswith('SSL_ERROR_'),
+ "SSLErrorNumber", __name__,
+ lambda name: name.startswith("SSL_ERROR_"),
source=_ssl)
_IntFlag._convert_(
- 'VerifyFlags', __name__,
- lambda name: name.startswith('VERIFY_'),
+ "VerifyFlags", __name__,
+ lambda name: name.startswith("VERIFY_"),
source=_ssl)
_IntEnum._convert_(
- 'VerifyMode', __name__,
- lambda name: name.startswith('CERT_'),
+ "VerifyMode", __name__,
+ lambda name: name.startswith("CERT_"),
source=_ssl)
PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_TLS
_PROTOCOL_NAMES = {value: name for name, value in _SSLMethod.__members__.items()}
-_SSLv2_IF_EXISTS = getattr(_SSLMethod, 'PROTOCOL_SSLv2', None)
+_SSLv2_IF_EXISTS = getattr(_SSLMethod, "PROTOCOL_SSLv2", None)
class TLSVersion(_IntEnum):
@@ -251,7 +244,7 @@ class _TLSMessageType(_IntEnum):
if sys.platform == "win32":
- from _ssl import enum_certificates, enum_crls
+ from _ssl import enum_certificates
from socket import socket, SOCK_STREAM, create_connection
from socket import SOL_SOCKET, SO_TYPE, _GLOBAL_DEFAULT_TIMEOUT
@@ -263,9 +256,9 @@ class _TLSMessageType(_IntEnum):
socket_error = OSError # keep that public name in module namespace
-CHANNEL_BINDING_TYPES = ['tls-unique']
+CHANNEL_BINDING_TYPES = ["tls-unique"]
-HAS_NEVER_CHECK_COMMON_NAME = hasattr(_ssl, 'HOSTFLAG_NEVER_CHECK_SUBJECT')
+HAS_NEVER_CHECK_COMMON_NAME = hasattr(_ssl, "HOSTFLAG_NEVER_CHECK_SUBJECT")
_RESTRICTED_SERVER_CIPHERS = _DEFAULT_CIPHERS
@@ -286,7 +279,7 @@ def _dnsname_match(dn, hostname):
if not dn:
return False
- wildcards = dn.count('*')
+ wildcards = dn.count("*")
# speed up common case w/o wildcards
if not wildcards:
return dn.lower() == hostname.lower()
@@ -295,9 +288,9 @@ def _dnsname_match(dn, hostname):
raise CertificateError(
"too many wildcards in certificate DNS name: {!r}.".format(dn))
- dn_leftmost, sep, dn_remainder = dn.partition('.')
+ dn_leftmost, sep, dn_remainder = dn.partition(".")
- if '*' in dn_remainder:
+ if "*" in dn_remainder:
# Only match wildcard in leftmost segment.
raise CertificateError(
"wildcard can only be present in the leftmost label: "
@@ -309,13 +302,13 @@ def _dnsname_match(dn, hostname):
"sole wildcard without additional labels are not support: "
"{!r}.".format(dn))
- if dn_leftmost != '*':
+ if dn_leftmost != "*":
# no partial wildcard matching
raise CertificateError(
"partial wildcards in leftmost label are not supported: "
"{!r}.".format(dn))
- hostname_leftmost, sep, hostname_remainder = hostname.partition('.')
+ hostname_leftmost, sep, hostname_remainder = hostname.partition(".")
if not hostname_leftmost or not sep:
# wildcard must match at least one char
return False
@@ -397,31 +390,31 @@ def match_hostname(cert, hostname):
# Not an IP address (common case)
host_ip = None
dnsnames = []
- san = cert.get('subjectAltName', ())
+ san = cert.get("subjectAltName", ())
for key, value in san:
- if key == 'DNS':
+ if key == "DNS":
if host_ip is None and _dnsname_match(value, hostname):
return
dnsnames.append(value)
- elif key == 'IP Address':
+ elif key == "IP Address":
if host_ip is not None and _ipaddress_match(value, host_ip):
return
dnsnames.append(value)
if not dnsnames:
# The subject is only checked when there is no dNSName entry
# in subjectAltName
- for sub in cert.get('subject', ()):
+ for sub in cert.get("subject", ()):
for key, value in sub:
# XXX according to RFC 2818, the most specific Common Name
# must be used.
- if key == 'commonName':
+ if key == "commonName":
if _dnsname_match(value, hostname):
return
dnsnames.append(value)
if len(dnsnames) > 1:
raise CertificateError("hostname %r "
"doesn't match either of %s"
- % (hostname, ', '.join(map(repr, dnsnames))))
+ % (hostname, ", ".join(map(repr, dnsnames))))
elif len(dnsnames) == 1:
raise CertificateError("hostname %r "
"doesn't match %r"
@@ -473,8 +466,8 @@ def fromname(cls, name):
class Purpose(_ASN1Object, _Enum):
"""SSLContext purpose flags with X509v3 Extended Key Usage objects
"""
- SERVER_AUTH = '1.3.6.1.5.5.7.3.1'
- CLIENT_AUTH = '1.3.6.1.5.5.7.3.2'
+ SERVER_AUTH = "1.3.6.1.5.5.7.3.1"
+ CLIENT_AUTH = "1.3.6.1.5.5.7.3.2"
class SSLContext(_SSLContext):
@@ -500,9 +493,9 @@ def _encode_hostname(self, hostname):
if hostname is None:
return None
elif isinstance(hostname, str):
- return hostname.encode('idna').decode('ascii')
+ return hostname.encode("idna").decode("ascii")
else:
- return hostname.decode('ascii')
+ return hostname.decode("ascii")
def wrap_socket(self, sock, server_side=False,
do_handshake_on_connect=True,
@@ -538,9 +531,9 @@ def set_npn_protocols(self, npn_protocols):
)
protos = bytearray()
for protocol in npn_protocols:
- b = bytes(protocol, 'ascii')
+ b = bytes(protocol, "ascii")
if len(b) == 0 or len(b) > 255:
- raise SSLError('NPN protocols must be 1 to 255 in length')
+ raise SSLError("NPN protocols must be 1 to 255 in length")
protos.append(len(b))
protos.extend(b)
@@ -562,9 +555,9 @@ def shim_cb(sslobj, servername, sslctx):
def set_alpn_protocols(self, alpn_protocols):
protos = bytearray()
for protocol in alpn_protocols:
- b = bytes(protocol, 'ascii')
+ b = bytes(protocol, "ascii")
if len(b) == 0 or len(b) > 255:
- raise SSLError('ALPN protocols must be 1 to 255 in length')
+ raise SSLError("ALPN protocols must be 1 to 255 in length")
protos.append(len(b))
protos.extend(b)
@@ -592,7 +585,7 @@ def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
self._load_windows_store_certs(storename, purpose)
self.set_default_verify_paths()
- if hasattr(_SSLContext, 'minimum_version'):
+ if hasattr(_SSLContext, "minimum_version"):
@property
def minimum_version(self):
return TLSVersion(super().minimum_version)
@@ -619,7 +612,7 @@ def options(self):
def options(self, value):
super(SSLContext, SSLContext).options.__set__(self, value)
- if hasattr(_ssl, 'HOSTFLAG_NEVER_CHECK_SUBJECT'):
+ if hasattr(_ssl, "HOSTFLAG_NEVER_CHECK_SUBJECT"):
@property
def hostname_checks_common_name(self):
ncs = self._host_flags & _ssl.HOSTFLAG_NEVER_CHECK_SUBJECT
@@ -681,7 +674,7 @@ def _msg_callback(self, callback):
super(SSLContext, SSLContext)._msg_callback.__set__(self, None)
return
- if not hasattr(callback, '__call__'):
+ if not hasattr(callback, "__call__"):
raise TypeError(f"{callback} is not callable.")
def inner(conn, direction, version, content_type, msg_type, data):
@@ -770,8 +763,8 @@ def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
# root CA certificates for the given purpose. This may fail silently.
context.load_default_certs(purpose)
# OpenSSL 1.1.1 keylog file
- if hasattr(context, 'keylog_filename'):
- keylogfile = os.environ.get('SSLKEYLOGFILE')
+ if hasattr(context, "keylog_filename"):
+ keylogfile = os.environ.get("SSLKEYLOGFILE")
if keylogfile and not sys.flags.ignore_environment:
context.keylog_filename = keylogfile
return context
@@ -824,8 +817,8 @@ def _create_unverified_context(protocol=None, *, cert_reqs=CERT_NONE,
# root CA certificates for the given purpose. This may fail silently.
context.load_default_certs(purpose)
# OpenSSL 1.1.1 keylog file
- if hasattr(context, 'keylog_filename'):
- keylogfile = os.environ.get('SSLKEYLOGFILE')
+ if hasattr(context, "keylog_filename"):
+ keylogfile = os.environ.get("SSLKEYLOGFILE")
if keylogfile and not sys.flags.ignore_environment:
context.keylog_filename = keylogfile
return context
@@ -1064,7 +1057,7 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
# EINVAL occurs for recv(1) on non-connected on unix sockets.
if e.errno not in (errno.ENOTCONN, errno.EINVAL):
raise
- notconn_pre_handshake_data = b''
+ notconn_pre_handshake_data = b""
self.setblocking(blocking)
if notconn_pre_handshake_data:
# This prevents pending data sent to the socket before it was
@@ -1168,7 +1161,7 @@ def read(self, len=1024, buffer=None):
if buffer is not None:
return 0
else:
- return b''
+ return b""
else:
raise
@@ -1497,7 +1490,7 @@ def cert_time_to_seconds(cert_time):
"Jan","Feb","Mar","Apr","May","Jun",
"Jul","Aug","Sep","Oct","Nov","Dec"
)
- time_format = ' %d %H:%M:%S %Y GMT' # NOTE: no month, fixed GMT
+ time_format = " %d %H:%M:%S %Y GMT" # NOTE: no month, fixed GMT
try:
month_number = months.index(cert_time[:3].title()) + 1
except ValueError:
@@ -1517,11 +1510,11 @@ def DER_cert_to_PEM_cert(der_cert_bytes):
"""Takes a certificate in binary DER format and returns the
PEM version of it as a string."""
- f = str(base64.standard_b64encode(der_cert_bytes), 'ASCII', 'strict')
+ f = str(base64.standard_b64encode(der_cert_bytes), "ASCII", "strict")
ss = [PEM_HEADER]
ss += [f[i:i+64] for i in range(0, len(f), 64)]
- ss.append(PEM_FOOTER + '\n')
- return '\n'.join(ss)
+ ss.append(PEM_FOOTER + "\n")
+ return "\n".join(ss)
def PEM_cert_to_DER_cert(pem_cert_string):
"""Takes a certificate in ASCII PEM format and returns the
@@ -1534,7 +1527,7 @@ def PEM_cert_to_DER_cert(pem_cert_string):
raise ValueError("Invalid PEM encoding; must end with %s"
% PEM_FOOTER)
d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
- return base64.decodebytes(d.encode('ASCII', 'strict'))
+ return base64.decodebytes(d.encode("ASCII", "strict"))
def get_server_certificate(addr, ssl_version=PROTOCOL_TLS_CLIENT,
ca_certs=None, timeout=_GLOBAL_DEFAULT_TIMEOUT):
@@ -1559,4 +1552,4 @@ def get_server_certificate(addr, ssl_version=PROTOCOL_TLS_CLIENT,
return DER_cert_to_PEM_cert(dercert)
def get_protocol_name(protocol_code):
- return _PROTOCOL_NAMES.get(protocol_code, '')
+ return _PROTOCOL_NAMES.get(protocol_code, "")
diff --git a/.venv3.10/Lib/statistics.py b/.venv3.10/Lib/statistics.py
index 52f17851..98378252 100644
--- a/.venv3.10/Lib/statistics.py
+++ b/.venv3.10/Lib/statistics.py
@@ -105,26 +105,26 @@
"""
__all__ = [
- 'NormalDist',
- 'StatisticsError',
- 'correlation',
- 'covariance',
- 'fmean',
- 'geometric_mean',
- 'harmonic_mean',
- 'linear_regression',
- 'mean',
- 'median',
- 'median_grouped',
- 'median_high',
- 'median_low',
- 'mode',
- 'multimode',
- 'pstdev',
- 'pvariance',
- 'quantiles',
- 'stdev',
- 'variance',
+ "NormalDist",
+ "StatisticsError",
+ "correlation",
+ "covariance",
+ "fmean",
+ "geometric_mean",
+ "harmonic_mean",
+ "linear_regression",
+ "mean",
+ "median",
+ "median_grouped",
+ "median_high",
+ "median_low",
+ "mode",
+ "multimode",
+ "pstdev",
+ "pvariance",
+ "quantiles",
+ "stdev",
+ "variance",
]
import math
@@ -280,7 +280,7 @@ def _convert(value, T):
def _find_lteq(a, x):
- 'Locate the leftmost value exactly equal to x'
+ "Locate the leftmost value exactly equal to x"
i = bisect_left(a, x)
if i != len(a) and a[i] == x:
return i
@@ -288,14 +288,14 @@ def _find_lteq(a, x):
def _find_rteq(a, l, x):
- 'Locate the rightmost value exactly equal to x'
+ "Locate the rightmost value exactly equal to x"
i = bisect_right(a, x, lo=l)
if i != (len(a) + 1) and a[i - 1] == x:
return i - 1
raise ValueError
-def _fail_neg(values, errmsg='negative value'):
+def _fail_neg(values, errmsg="negative value"):
"""Iterate over values, failing if any are less than zero."""
for x in values:
if x < 0:
@@ -325,7 +325,7 @@ def mean(data):
data = list(data)
n = len(data)
if n < 1:
- raise StatisticsError('mean requires at least one data point')
+ raise StatisticsError("mean requires at least one data point")
T, total, count = _sum(data)
assert count == n
return _convert(total / n, T)
@@ -355,7 +355,7 @@ def count(iterable):
try:
return total / n
except ZeroDivisionError:
- raise StatisticsError('fmean requires at least one data point') from None
+ raise StatisticsError("fmean requires at least one data point") from None
def geometric_mean(data):
@@ -373,8 +373,8 @@ def geometric_mean(data):
try:
return exp(fmean(map(log, data)))
except ValueError:
- raise StatisticsError('geometric mean requires a non-empty dataset '
- 'containing positive numbers') from None
+ raise StatisticsError("geometric mean requires a non-empty dataset "
+ "containing positive numbers") from None
def harmonic_mean(data, weights=None):
@@ -402,10 +402,10 @@ def harmonic_mean(data, weights=None):
"""
if iter(data) is data:
data = list(data)
- errmsg = 'harmonic mean does not support negative values'
+ errmsg = "harmonic mean does not support negative values"
n = len(data)
if n < 1:
- raise StatisticsError('harmonic_mean requires at least one data point')
+ raise StatisticsError("harmonic_mean requires at least one data point")
elif n == 1 and weights is None:
x = data[0]
if isinstance(x, (numbers.Real, Decimal)):
@@ -413,7 +413,7 @@ def harmonic_mean(data, weights=None):
raise StatisticsError(errmsg)
return x
else:
- raise TypeError('unsupported type')
+ raise TypeError("unsupported type")
if weights is None:
weights = repeat(1, n)
sum_weights = n
@@ -421,7 +421,7 @@ def harmonic_mean(data, weights=None):
if iter(weights) is weights:
weights = list(weights)
if len(weights) != n:
- raise StatisticsError('Number of weights does not match data size')
+ raise StatisticsError("Number of weights does not match data size")
_, sum_weights, _ = _sum(w for w in _fail_neg(weights, errmsg))
try:
data = _fail_neg(data, errmsg)
@@ -429,7 +429,7 @@ def harmonic_mean(data, weights=None):
except ZeroDivisionError:
return 0
if total <= 0:
- raise StatisticsError('Weighted sum must be positive')
+ raise StatisticsError("Weighted sum must be positive")
return _convert(sum_weights / total, T)
# FIXME: investigate ways to calculate medians without sorting? Quickselect?
@@ -535,7 +535,7 @@ class 3.5-4.5, and interpolation is used to estimate it.
x = data[n // 2]
for obj in (x, interval):
if isinstance(obj, (str, bytes)):
- raise TypeError('expected number but got %r' % obj)
+ raise TypeError("expected number but got %r" % obj)
try:
L = x - interval / 2 # The lower limit of the median interval.
except TypeError:
@@ -580,7 +580,7 @@ def mode(data):
try:
return pairs[0][0]
except IndexError:
- raise StatisticsError('no mode for empty data') from None
+ raise StatisticsError("no mode for empty data") from None
def multimode(data):
@@ -638,7 +638,7 @@ def multimode(data):
# position is that fewer options make for easier choices and that
# external packages can be used for anything more advanced.
-def quantiles(data, *, n=4, method='exclusive'):
+def quantiles(data, *, n=4, method="exclusive"):
"""Divide *data* into *n* continuous intervals with equal probability.
Returns a list of (n - 1) cut points separating the intervals.
@@ -655,12 +655,12 @@ def quantiles(data, *, n=4, method='exclusive'):
maximum value is treated as the 100th percentile.
"""
if n < 1:
- raise StatisticsError('n must be at least 1')
+ raise StatisticsError("n must be at least 1")
data = sorted(data)
ld = len(data)
if ld < 2:
- raise StatisticsError('must have at least two data points')
- if method == 'inclusive':
+ raise StatisticsError("must have at least two data points")
+ if method == "inclusive":
m = ld - 1
result = []
for i in range(1, n):
@@ -668,7 +668,7 @@ def quantiles(data, *, n=4, method='exclusive'):
interpolated = (data[j] * (n - delta) + data[j + 1] * delta) / n
result.append(interpolated)
return result
- if method == 'exclusive':
+ if method == "exclusive":
m = ld + 1
result = []
for i in range(1, n):
@@ -678,7 +678,7 @@ def quantiles(data, *, n=4, method='exclusive'):
interpolated = (data[j - 1] * (n - delta) + data[j] * delta) / n
result.append(interpolated)
return result
- raise ValueError(f'Unknown method: {method!r}')
+ raise ValueError(f"Unknown method: {method!r}")
# === Measures of spread ===
@@ -764,7 +764,7 @@ def variance(data, xbar=None):
data = list(data)
n = len(data)
if n < 2:
- raise StatisticsError('variance requires at least two data points')
+ raise StatisticsError("variance requires at least two data points")
T, ss = _ss(data, xbar)
return _convert(ss / (n - 1), T)
@@ -808,7 +808,7 @@ def pvariance(data, mu=None):
data = list(data)
n = len(data)
if n < 1:
- raise StatisticsError('pvariance requires at least one data point')
+ raise StatisticsError("pvariance requires at least one data point")
T, ss = _ss(data, mu)
return _convert(ss / n, T)
@@ -877,9 +877,9 @@ def covariance(x, y, /):
"""
n = len(x)
if len(y) != n:
- raise StatisticsError('covariance requires that both inputs have same number of data points')
+ raise StatisticsError("covariance requires that both inputs have same number of data points")
if n < 2:
- raise StatisticsError('covariance requires at least two data points')
+ raise StatisticsError("covariance requires at least two data points")
xbar = fsum(x) / n
ybar = fsum(y) / n
sxy = fsum((xi - xbar) * (yi - ybar) for xi, yi in zip(x, y))
@@ -905,9 +905,9 @@ def correlation(x, y, /):
"""
n = len(x)
if len(y) != n:
- raise StatisticsError('correlation requires that both inputs have same number of data points')
+ raise StatisticsError("correlation requires that both inputs have same number of data points")
if n < 2:
- raise StatisticsError('correlation requires at least two data points')
+ raise StatisticsError("correlation requires at least two data points")
xbar = fsum(x) / n
ybar = fsum(y) / n
sxy = fsum((xi - xbar) * (yi - ybar) for xi, yi in zip(x, y))
@@ -916,10 +916,10 @@ def correlation(x, y, /):
try:
return sxy / sqrt(sxx * syy)
except ZeroDivisionError:
- raise StatisticsError('at least one of the inputs is constant')
+ raise StatisticsError("at least one of the inputs is constant")
-LinearRegression = namedtuple('LinearRegression', ('slope', 'intercept'))
+LinearRegression = namedtuple("LinearRegression", ("slope", "intercept"))
def linear_regression(x, y, /):
@@ -949,9 +949,9 @@ def linear_regression(x, y, /):
"""
n = len(x)
if len(y) != n:
- raise StatisticsError('linear regression requires that both inputs have same number of data points')
+ raise StatisticsError("linear regression requires that both inputs have same number of data points")
if n < 2:
- raise StatisticsError('linear regression requires at least two data points')
+ raise StatisticsError("linear regression requires at least two data points")
xbar = fsum(x) / n
ybar = fsum(y) / n
sxy = fsum((xi - xbar) * (yi - ybar) for xi, yi in zip(x, y))
@@ -959,7 +959,7 @@ def linear_regression(x, y, /):
try:
slope = sxy / sxx # equivalent to: covariance(x, y) / variance(x)
except ZeroDivisionError:
- raise StatisticsError('x is constant')
+ raise StatisticsError("x is constant")
intercept = ybar - slope * xbar
return LinearRegression(slope=slope, intercept=intercept)
@@ -1054,14 +1054,14 @@ class NormalDist:
# https://en.wikipedia.org/wiki/Variance#Properties
__slots__ = {
- '_mu': 'Arithmetic mean of a normal distribution',
- '_sigma': 'Standard deviation of a normal distribution',
+ "_mu": "Arithmetic mean of a normal distribution",
+ "_sigma": "Standard deviation of a normal distribution",
}
def __init__(self, mu=0.0, sigma=1.0):
"NormalDist where mu is the mean and sigma is the standard deviation."
if sigma < 0.0:
- raise StatisticsError('sigma must be non-negative')
+ raise StatisticsError("sigma must be non-negative")
self._mu = float(mu)
self._sigma = float(sigma)
@@ -1083,13 +1083,13 @@ def pdf(self, x):
"Probability density function. P(x <= X < x+dx) / dx"
variance = self._sigma ** 2.0
if not variance:
- raise StatisticsError('pdf() not defined when sigma is zero')
+ raise StatisticsError("pdf() not defined when sigma is zero")
return exp((x - self._mu)**2.0 / (-2.0*variance)) / sqrt(tau*variance)
def cdf(self, x):
"Cumulative distribution function. P(X <= x)"
if not self._sigma:
- raise StatisticsError('cdf() not defined when sigma is zero')
+ raise StatisticsError("cdf() not defined when sigma is zero")
return 0.5 * (1.0 + erf((x - self._mu) / (self._sigma * sqrt(2.0))))
def inv_cdf(self, p):
@@ -1103,9 +1103,9 @@ def inv_cdf(self, p):
function.
"""
if p <= 0.0 or p >= 1.0:
- raise StatisticsError('p must be in the range 0.0 < p < 1.0')
+ raise StatisticsError("p must be in the range 0.0 < p < 1.0")
if self._sigma <= 0.0:
- raise StatisticsError('cdf() not defined when sigma at or below zero')
+ raise StatisticsError("cdf() not defined when sigma at or below zero")
return _normal_dist_inv_cdf(p, self._mu, self._sigma)
def quantiles(self, n=4):
@@ -1136,13 +1136,13 @@ def overlap(self, other):
# normal densities" -- Henry F. Inman and Edwin L. Bradley Jr
# http://dx.doi.org/10.1080/03610928908830127
if not isinstance(other, NormalDist):
- raise TypeError('Expected another NormalDist instance')
+ raise TypeError("Expected another NormalDist instance")
X, Y = self, other
if (Y._sigma, Y._mu) < (X._sigma, X._mu): # sort to assure commutativity
X, Y = Y, X
X_var, Y_var = X.variance, Y.variance
if not X_var or not Y_var:
- raise StatisticsError('overlap() not defined when sigma is zero')
+ raise StatisticsError("overlap() not defined when sigma is zero")
dv = Y_var - X_var
dm = fabs(Y._mu - X._mu)
if not dv:
@@ -1161,7 +1161,7 @@ def zscore(self, x):
"""
# https://www.statisticshowto.com/probability-and-statistics/z-score/
if not self._sigma:
- raise StatisticsError('zscore() not defined when sigma is zero')
+ raise StatisticsError("zscore() not defined when sigma is zero")
return (x - self._mu) / self._sigma
@property
@@ -1264,7 +1264,7 @@ def __hash__(self):
return hash((self._mu, self._sigma))
def __repr__(self):
- return f'{type(self).__name__}(mu={self._mu!r}, sigma={self._sigma!r})'
+ return f"{type(self).__name__}(mu={self._mu!r}, sigma={self._sigma!r})"
def __getstate__(self):
return self._mu, self._sigma
diff --git a/.venv3.10/Lib/string.py b/.venv3.10/Lib/string.py
index 489777b1..2bdaa58b 100644
--- a/.venv3.10/Lib/string.py
+++ b/.venv3.10/Lib/string.py
@@ -21,13 +21,13 @@
import _string
# Some strings for ctype-style character classification
-whitespace = ' \t\n\r\v\f'
-ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
-ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+whitespace = " \t\n\r\v\f"
+ascii_lowercase = "abcdefghijklmnopqrstuvwxyz"
+ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ascii_letters = ascii_lowercase + ascii_uppercase
-digits = '0123456789'
-hexdigits = digits + 'abcdef' + 'ABCDEF'
-octdigits = '01234567'
+digits = "0123456789"
+hexdigits = digits + "abcdef" + "ABCDEF"
+octdigits = "01234567"
punctuation = r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
printable = digits + ascii_letters + punctuation + whitespace
@@ -45,7 +45,7 @@ def capwords(s, sep=None):
sep is used to split and join the words.
"""
- return (sep or ' ').join(x.capitalize() for x in s.split(sep))
+ return (sep or " ").join(x.capitalize() for x in s.split(sep))
####################################################################
@@ -57,18 +57,18 @@ def capwords(s, sep=None):
class Template:
"""A string class for supporting $-substitutions."""
- delimiter = '$'
+ delimiter = "$"
# r'[a-z]' matches to non-ASCII letters when used with IGNORECASE, but
# without the ASCII flag. We can't add re.ASCII to flags because of
# backward compatibility. So we use the ?a local flag and [a-z] pattern.
# See https://bugs.python.org/issue31672
- idpattern = r'(?a:[_a-z][_a-z0-9]*)'
+ idpattern = r"(?a:[_a-z][_a-z0-9]*)"
braceidpattern = None
flags = _re.IGNORECASE
def __init_subclass__(cls):
super().__init_subclass__()
- if 'pattern' in cls.__dict__:
+ if "pattern" in cls.__dict__:
pattern = cls.pattern
else:
delim = _re.escape(cls.delimiter)
@@ -90,15 +90,15 @@ def __init__(self, template):
# Search for $$, $identifier, ${identifier}, and any bare $'s
def _invalid(self, mo):
- i = mo.start('invalid')
+ i = mo.start("invalid")
lines = self.template[:i].splitlines(keepends=True)
if not lines:
colno = 1
lineno = 1
else:
- colno = i - len(''.join(lines[:-1]))
+ colno = i - len("".join(lines[:-1]))
lineno = len(lines)
- raise ValueError('Invalid placeholder in string: line %d, col %d' %
+ raise ValueError("Invalid placeholder in string: line %d, col %d" %
(lineno, colno))
def substitute(self, mapping=_sentinel_dict, /, **kws):
@@ -109,14 +109,14 @@ def substitute(self, mapping=_sentinel_dict, /, **kws):
# Helper function for .sub()
def convert(mo):
# Check the most common path first.
- named = mo.group('named') or mo.group('braced')
+ named = mo.group("named") or mo.group("braced")
if named is not None:
return str(mapping[named])
- if mo.group('escaped') is not None:
+ if mo.group("escaped") is not None:
return self.delimiter
- if mo.group('invalid') is not None:
+ if mo.group("invalid") is not None:
self._invalid(mo)
- raise ValueError('Unrecognized named group in pattern',
+ raise ValueError("Unrecognized named group in pattern",
self.pattern)
return self.pattern.sub(convert, self.template)
@@ -127,17 +127,17 @@ def safe_substitute(self, mapping=_sentinel_dict, /, **kws):
mapping = _ChainMap(kws, mapping)
# Helper function for .sub()
def convert(mo):
- named = mo.group('named') or mo.group('braced')
+ named = mo.group("named") or mo.group("braced")
if named is not None:
try:
return str(mapping[named])
except KeyError:
return mo.group()
- if mo.group('escaped') is not None:
+ if mo.group("escaped") is not None:
return self.delimiter
- if mo.group('invalid') is not None:
+ if mo.group("invalid") is not None:
return mo.group()
- raise ValueError('Unrecognized named group in pattern',
+ raise ValueError("Unrecognized named group in pattern",
self.pattern)
return self.pattern.sub(convert, self.template)
@@ -169,7 +169,7 @@ def vformat(self, format_string, args, kwargs):
def _vformat(self, format_string, args, kwargs, used_args, recursion_depth,
auto_arg_index=0):
if recursion_depth < 0:
- raise ValueError('Max string recursion exceeded')
+ raise ValueError("Max string recursion exceeded")
result = []
for literal_text, field_name, format_spec, conversion in \
self.parse(format_string):
@@ -184,18 +184,18 @@ def _vformat(self, format_string, args, kwargs, used_args, recursion_depth,
# the formatting
# handle arg indexing when empty field_names are given.
- if field_name == '':
+ if field_name == "":
if auto_arg_index is False:
- raise ValueError('cannot switch from manual field '
- 'specification to automatic field '
- 'numbering')
+ raise ValueError("cannot switch from manual field "
+ "specification to automatic field "
+ "numbering")
field_name = str(auto_arg_index)
auto_arg_index += 1
elif field_name.isdigit():
if auto_arg_index:
- raise ValueError('cannot switch from manual field '
- 'specification to automatic field '
- 'numbering')
+ raise ValueError("cannot switch from manual field "
+ "specification to automatic field "
+ "numbering")
# disable auto arg incrementing, if it gets
# used later on, then an exception will be raised
auto_arg_index = False
@@ -217,7 +217,7 @@ def _vformat(self, format_string, args, kwargs, used_args, recursion_depth,
# format the object and append to the result
result.append(self.format_field(obj, format_spec))
- return ''.join(result), auto_arg_index
+ return "".join(result), auto_arg_index
def get_value(self, key, args, kwargs):
@@ -239,11 +239,11 @@ def convert_field(self, value, conversion):
# do any conversion on the resulting object
if conversion is None:
return value
- elif conversion == 's':
+ elif conversion == "s":
return str(value)
- elif conversion == 'r':
+ elif conversion == "r":
return repr(value)
- elif conversion == 'a':
+ elif conversion == "a":
return ascii(value)
raise ValueError("Unknown conversion specifier {0!s}".format(conversion))
diff --git a/.venv3.10/Lib/stringprep.py b/.venv3.10/Lib/stringprep.py
index 44ecdb26..803a0bcc 100644
--- a/.venv3.10/Lib/stringprep.py
+++ b/.venv3.10/Lib/stringprep.py
@@ -7,10 +7,10 @@
from unicodedata import ucd_3_2_0 as unicodedata
-assert unicodedata.unidata_version == '3.2.0'
+assert unicodedata.unidata_version == "3.2.0"
def in_table_a1(code):
- if unicodedata.category(code) != 'Cn': return False
+ if unicodedata.category(code) != "Cn": return False
c = ord(code)
if 0xFDD0 <= c < 0xFDF0: return False
return (c & 0xFFFF) not in (0xFFFE, 0xFFFF)
@@ -22,169 +22,169 @@ def in_table_b1(code):
b3_exceptions = {
-0xb5:'\u03bc', 0xdf:'ss', 0x130:'i\u0307', 0x149:'\u02bcn',
-0x17f:'s', 0x1f0:'j\u030c', 0x345:'\u03b9', 0x37a:' \u03b9',
-0x390:'\u03b9\u0308\u0301', 0x3b0:'\u03c5\u0308\u0301', 0x3c2:'\u03c3', 0x3d0:'\u03b2',
-0x3d1:'\u03b8', 0x3d2:'\u03c5', 0x3d3:'\u03cd', 0x3d4:'\u03cb',
-0x3d5:'\u03c6', 0x3d6:'\u03c0', 0x3f0:'\u03ba', 0x3f1:'\u03c1',
-0x3f2:'\u03c3', 0x3f5:'\u03b5', 0x587:'\u0565\u0582', 0x1e96:'h\u0331',
-0x1e97:'t\u0308', 0x1e98:'w\u030a', 0x1e99:'y\u030a', 0x1e9a:'a\u02be',
-0x1e9b:'\u1e61', 0x1f50:'\u03c5\u0313', 0x1f52:'\u03c5\u0313\u0300', 0x1f54:'\u03c5\u0313\u0301',
-0x1f56:'\u03c5\u0313\u0342', 0x1f80:'\u1f00\u03b9', 0x1f81:'\u1f01\u03b9', 0x1f82:'\u1f02\u03b9',
-0x1f83:'\u1f03\u03b9', 0x1f84:'\u1f04\u03b9', 0x1f85:'\u1f05\u03b9', 0x1f86:'\u1f06\u03b9',
-0x1f87:'\u1f07\u03b9', 0x1f88:'\u1f00\u03b9', 0x1f89:'\u1f01\u03b9', 0x1f8a:'\u1f02\u03b9',
-0x1f8b:'\u1f03\u03b9', 0x1f8c:'\u1f04\u03b9', 0x1f8d:'\u1f05\u03b9', 0x1f8e:'\u1f06\u03b9',
-0x1f8f:'\u1f07\u03b9', 0x1f90:'\u1f20\u03b9', 0x1f91:'\u1f21\u03b9', 0x1f92:'\u1f22\u03b9',
-0x1f93:'\u1f23\u03b9', 0x1f94:'\u1f24\u03b9', 0x1f95:'\u1f25\u03b9', 0x1f96:'\u1f26\u03b9',
-0x1f97:'\u1f27\u03b9', 0x1f98:'\u1f20\u03b9', 0x1f99:'\u1f21\u03b9', 0x1f9a:'\u1f22\u03b9',
-0x1f9b:'\u1f23\u03b9', 0x1f9c:'\u1f24\u03b9', 0x1f9d:'\u1f25\u03b9', 0x1f9e:'\u1f26\u03b9',
-0x1f9f:'\u1f27\u03b9', 0x1fa0:'\u1f60\u03b9', 0x1fa1:'\u1f61\u03b9', 0x1fa2:'\u1f62\u03b9',
-0x1fa3:'\u1f63\u03b9', 0x1fa4:'\u1f64\u03b9', 0x1fa5:'\u1f65\u03b9', 0x1fa6:'\u1f66\u03b9',
-0x1fa7:'\u1f67\u03b9', 0x1fa8:'\u1f60\u03b9', 0x1fa9:'\u1f61\u03b9', 0x1faa:'\u1f62\u03b9',
-0x1fab:'\u1f63\u03b9', 0x1fac:'\u1f64\u03b9', 0x1fad:'\u1f65\u03b9', 0x1fae:'\u1f66\u03b9',
-0x1faf:'\u1f67\u03b9', 0x1fb2:'\u1f70\u03b9', 0x1fb3:'\u03b1\u03b9', 0x1fb4:'\u03ac\u03b9',
-0x1fb6:'\u03b1\u0342', 0x1fb7:'\u03b1\u0342\u03b9', 0x1fbc:'\u03b1\u03b9', 0x1fbe:'\u03b9',
-0x1fc2:'\u1f74\u03b9', 0x1fc3:'\u03b7\u03b9', 0x1fc4:'\u03ae\u03b9', 0x1fc6:'\u03b7\u0342',
-0x1fc7:'\u03b7\u0342\u03b9', 0x1fcc:'\u03b7\u03b9', 0x1fd2:'\u03b9\u0308\u0300', 0x1fd3:'\u03b9\u0308\u0301',
-0x1fd6:'\u03b9\u0342', 0x1fd7:'\u03b9\u0308\u0342', 0x1fe2:'\u03c5\u0308\u0300', 0x1fe3:'\u03c5\u0308\u0301',
-0x1fe4:'\u03c1\u0313', 0x1fe6:'\u03c5\u0342', 0x1fe7:'\u03c5\u0308\u0342', 0x1ff2:'\u1f7c\u03b9',
-0x1ff3:'\u03c9\u03b9', 0x1ff4:'\u03ce\u03b9', 0x1ff6:'\u03c9\u0342', 0x1ff7:'\u03c9\u0342\u03b9',
-0x1ffc:'\u03c9\u03b9', 0x20a8:'rs', 0x2102:'c', 0x2103:'\xb0c',
-0x2107:'\u025b', 0x2109:'\xb0f', 0x210b:'h', 0x210c:'h',
-0x210d:'h', 0x2110:'i', 0x2111:'i', 0x2112:'l',
-0x2115:'n', 0x2116:'no', 0x2119:'p', 0x211a:'q',
-0x211b:'r', 0x211c:'r', 0x211d:'r', 0x2120:'sm',
-0x2121:'tel', 0x2122:'tm', 0x2124:'z', 0x2128:'z',
-0x212c:'b', 0x212d:'c', 0x2130:'e', 0x2131:'f',
-0x2133:'m', 0x213e:'\u03b3', 0x213f:'\u03c0', 0x2145:'d',
-0x3371:'hpa', 0x3373:'au', 0x3375:'ov', 0x3380:'pa',
-0x3381:'na', 0x3382:'\u03bca', 0x3383:'ma', 0x3384:'ka',
-0x3385:'kb', 0x3386:'mb', 0x3387:'gb', 0x338a:'pf',
-0x338b:'nf', 0x338c:'\u03bcf', 0x3390:'hz', 0x3391:'khz',
-0x3392:'mhz', 0x3393:'ghz', 0x3394:'thz', 0x33a9:'pa',
-0x33aa:'kpa', 0x33ab:'mpa', 0x33ac:'gpa', 0x33b4:'pv',
-0x33b5:'nv', 0x33b6:'\u03bcv', 0x33b7:'mv', 0x33b8:'kv',
-0x33b9:'mv', 0x33ba:'pw', 0x33bb:'nw', 0x33bc:'\u03bcw',
-0x33bd:'mw', 0x33be:'kw', 0x33bf:'mw', 0x33c0:'k\u03c9',
-0x33c1:'m\u03c9', 0x33c3:'bq', 0x33c6:'c\u2215kg', 0x33c7:'co.',
-0x33c8:'db', 0x33c9:'gy', 0x33cb:'hp', 0x33cd:'kk',
-0x33ce:'km', 0x33d7:'ph', 0x33d9:'ppm', 0x33da:'pr',
-0x33dc:'sv', 0x33dd:'wb', 0xfb00:'ff', 0xfb01:'fi',
-0xfb02:'fl', 0xfb03:'ffi', 0xfb04:'ffl', 0xfb05:'st',
-0xfb06:'st', 0xfb13:'\u0574\u0576', 0xfb14:'\u0574\u0565', 0xfb15:'\u0574\u056b',
-0xfb16:'\u057e\u0576', 0xfb17:'\u0574\u056d', 0x1d400:'a', 0x1d401:'b',
-0x1d402:'c', 0x1d403:'d', 0x1d404:'e', 0x1d405:'f',
-0x1d406:'g', 0x1d407:'h', 0x1d408:'i', 0x1d409:'j',
-0x1d40a:'k', 0x1d40b:'l', 0x1d40c:'m', 0x1d40d:'n',
-0x1d40e:'o', 0x1d40f:'p', 0x1d410:'q', 0x1d411:'r',
-0x1d412:'s', 0x1d413:'t', 0x1d414:'u', 0x1d415:'v',
-0x1d416:'w', 0x1d417:'x', 0x1d418:'y', 0x1d419:'z',
-0x1d434:'a', 0x1d435:'b', 0x1d436:'c', 0x1d437:'d',
-0x1d438:'e', 0x1d439:'f', 0x1d43a:'g', 0x1d43b:'h',
-0x1d43c:'i', 0x1d43d:'j', 0x1d43e:'k', 0x1d43f:'l',
-0x1d440:'m', 0x1d441:'n', 0x1d442:'o', 0x1d443:'p',
-0x1d444:'q', 0x1d445:'r', 0x1d446:'s', 0x1d447:'t',
-0x1d448:'u', 0x1d449:'v', 0x1d44a:'w', 0x1d44b:'x',
-0x1d44c:'y', 0x1d44d:'z', 0x1d468:'a', 0x1d469:'b',
-0x1d46a:'c', 0x1d46b:'d', 0x1d46c:'e', 0x1d46d:'f',
-0x1d46e:'g', 0x1d46f:'h', 0x1d470:'i', 0x1d471:'j',
-0x1d472:'k', 0x1d473:'l', 0x1d474:'m', 0x1d475:'n',
-0x1d476:'o', 0x1d477:'p', 0x1d478:'q', 0x1d479:'r',
-0x1d47a:'s', 0x1d47b:'t', 0x1d47c:'u', 0x1d47d:'v',
-0x1d47e:'w', 0x1d47f:'x', 0x1d480:'y', 0x1d481:'z',
-0x1d49c:'a', 0x1d49e:'c', 0x1d49f:'d', 0x1d4a2:'g',
-0x1d4a5:'j', 0x1d4a6:'k', 0x1d4a9:'n', 0x1d4aa:'o',
-0x1d4ab:'p', 0x1d4ac:'q', 0x1d4ae:'s', 0x1d4af:'t',
-0x1d4b0:'u', 0x1d4b1:'v', 0x1d4b2:'w', 0x1d4b3:'x',
-0x1d4b4:'y', 0x1d4b5:'z', 0x1d4d0:'a', 0x1d4d1:'b',
-0x1d4d2:'c', 0x1d4d3:'d', 0x1d4d4:'e', 0x1d4d5:'f',
-0x1d4d6:'g', 0x1d4d7:'h', 0x1d4d8:'i', 0x1d4d9:'j',
-0x1d4da:'k', 0x1d4db:'l', 0x1d4dc:'m', 0x1d4dd:'n',
-0x1d4de:'o', 0x1d4df:'p', 0x1d4e0:'q', 0x1d4e1:'r',
-0x1d4e2:'s', 0x1d4e3:'t', 0x1d4e4:'u', 0x1d4e5:'v',
-0x1d4e6:'w', 0x1d4e7:'x', 0x1d4e8:'y', 0x1d4e9:'z',
-0x1d504:'a', 0x1d505:'b', 0x1d507:'d', 0x1d508:'e',
-0x1d509:'f', 0x1d50a:'g', 0x1d50d:'j', 0x1d50e:'k',
-0x1d50f:'l', 0x1d510:'m', 0x1d511:'n', 0x1d512:'o',
-0x1d513:'p', 0x1d514:'q', 0x1d516:'s', 0x1d517:'t',
-0x1d518:'u', 0x1d519:'v', 0x1d51a:'w', 0x1d51b:'x',
-0x1d51c:'y', 0x1d538:'a', 0x1d539:'b', 0x1d53b:'d',
-0x1d53c:'e', 0x1d53d:'f', 0x1d53e:'g', 0x1d540:'i',
-0x1d541:'j', 0x1d542:'k', 0x1d543:'l', 0x1d544:'m',
-0x1d546:'o', 0x1d54a:'s', 0x1d54b:'t', 0x1d54c:'u',
-0x1d54d:'v', 0x1d54e:'w', 0x1d54f:'x', 0x1d550:'y',
-0x1d56c:'a', 0x1d56d:'b', 0x1d56e:'c', 0x1d56f:'d',
-0x1d570:'e', 0x1d571:'f', 0x1d572:'g', 0x1d573:'h',
-0x1d574:'i', 0x1d575:'j', 0x1d576:'k', 0x1d577:'l',
-0x1d578:'m', 0x1d579:'n', 0x1d57a:'o', 0x1d57b:'p',
-0x1d57c:'q', 0x1d57d:'r', 0x1d57e:'s', 0x1d57f:'t',
-0x1d580:'u', 0x1d581:'v', 0x1d582:'w', 0x1d583:'x',
-0x1d584:'y', 0x1d585:'z', 0x1d5a0:'a', 0x1d5a1:'b',
-0x1d5a2:'c', 0x1d5a3:'d', 0x1d5a4:'e', 0x1d5a5:'f',
-0x1d5a6:'g', 0x1d5a7:'h', 0x1d5a8:'i', 0x1d5a9:'j',
-0x1d5aa:'k', 0x1d5ab:'l', 0x1d5ac:'m', 0x1d5ad:'n',
-0x1d5ae:'o', 0x1d5af:'p', 0x1d5b0:'q', 0x1d5b1:'r',
-0x1d5b2:'s', 0x1d5b3:'t', 0x1d5b4:'u', 0x1d5b5:'v',
-0x1d5b6:'w', 0x1d5b7:'x', 0x1d5b8:'y', 0x1d5b9:'z',
-0x1d5d4:'a', 0x1d5d5:'b', 0x1d5d6:'c', 0x1d5d7:'d',
-0x1d5d8:'e', 0x1d5d9:'f', 0x1d5da:'g', 0x1d5db:'h',
-0x1d5dc:'i', 0x1d5dd:'j', 0x1d5de:'k', 0x1d5df:'l',
-0x1d5e0:'m', 0x1d5e1:'n', 0x1d5e2:'o', 0x1d5e3:'p',
-0x1d5e4:'q', 0x1d5e5:'r', 0x1d5e6:'s', 0x1d5e7:'t',
-0x1d5e8:'u', 0x1d5e9:'v', 0x1d5ea:'w', 0x1d5eb:'x',
-0x1d5ec:'y', 0x1d5ed:'z', 0x1d608:'a', 0x1d609:'b',
-0x1d60a:'c', 0x1d60b:'d', 0x1d60c:'e', 0x1d60d:'f',
-0x1d60e:'g', 0x1d60f:'h', 0x1d610:'i', 0x1d611:'j',
-0x1d612:'k', 0x1d613:'l', 0x1d614:'m', 0x1d615:'n',
-0x1d616:'o', 0x1d617:'p', 0x1d618:'q', 0x1d619:'r',
-0x1d61a:'s', 0x1d61b:'t', 0x1d61c:'u', 0x1d61d:'v',
-0x1d61e:'w', 0x1d61f:'x', 0x1d620:'y', 0x1d621:'z',
-0x1d63c:'a', 0x1d63d:'b', 0x1d63e:'c', 0x1d63f:'d',
-0x1d640:'e', 0x1d641:'f', 0x1d642:'g', 0x1d643:'h',
-0x1d644:'i', 0x1d645:'j', 0x1d646:'k', 0x1d647:'l',
-0x1d648:'m', 0x1d649:'n', 0x1d64a:'o', 0x1d64b:'p',
-0x1d64c:'q', 0x1d64d:'r', 0x1d64e:'s', 0x1d64f:'t',
-0x1d650:'u', 0x1d651:'v', 0x1d652:'w', 0x1d653:'x',
-0x1d654:'y', 0x1d655:'z', 0x1d670:'a', 0x1d671:'b',
-0x1d672:'c', 0x1d673:'d', 0x1d674:'e', 0x1d675:'f',
-0x1d676:'g', 0x1d677:'h', 0x1d678:'i', 0x1d679:'j',
-0x1d67a:'k', 0x1d67b:'l', 0x1d67c:'m', 0x1d67d:'n',
-0x1d67e:'o', 0x1d67f:'p', 0x1d680:'q', 0x1d681:'r',
-0x1d682:'s', 0x1d683:'t', 0x1d684:'u', 0x1d685:'v',
-0x1d686:'w', 0x1d687:'x', 0x1d688:'y', 0x1d689:'z',
-0x1d6a8:'\u03b1', 0x1d6a9:'\u03b2', 0x1d6aa:'\u03b3', 0x1d6ab:'\u03b4',
-0x1d6ac:'\u03b5', 0x1d6ad:'\u03b6', 0x1d6ae:'\u03b7', 0x1d6af:'\u03b8',
-0x1d6b0:'\u03b9', 0x1d6b1:'\u03ba', 0x1d6b2:'\u03bb', 0x1d6b3:'\u03bc',
-0x1d6b4:'\u03bd', 0x1d6b5:'\u03be', 0x1d6b6:'\u03bf', 0x1d6b7:'\u03c0',
-0x1d6b8:'\u03c1', 0x1d6b9:'\u03b8', 0x1d6ba:'\u03c3', 0x1d6bb:'\u03c4',
-0x1d6bc:'\u03c5', 0x1d6bd:'\u03c6', 0x1d6be:'\u03c7', 0x1d6bf:'\u03c8',
-0x1d6c0:'\u03c9', 0x1d6d3:'\u03c3', 0x1d6e2:'\u03b1', 0x1d6e3:'\u03b2',
-0x1d6e4:'\u03b3', 0x1d6e5:'\u03b4', 0x1d6e6:'\u03b5', 0x1d6e7:'\u03b6',
-0x1d6e8:'\u03b7', 0x1d6e9:'\u03b8', 0x1d6ea:'\u03b9', 0x1d6eb:'\u03ba',
-0x1d6ec:'\u03bb', 0x1d6ed:'\u03bc', 0x1d6ee:'\u03bd', 0x1d6ef:'\u03be',
-0x1d6f0:'\u03bf', 0x1d6f1:'\u03c0', 0x1d6f2:'\u03c1', 0x1d6f3:'\u03b8',
-0x1d6f4:'\u03c3', 0x1d6f5:'\u03c4', 0x1d6f6:'\u03c5', 0x1d6f7:'\u03c6',
-0x1d6f8:'\u03c7', 0x1d6f9:'\u03c8', 0x1d6fa:'\u03c9', 0x1d70d:'\u03c3',
-0x1d71c:'\u03b1', 0x1d71d:'\u03b2', 0x1d71e:'\u03b3', 0x1d71f:'\u03b4',
-0x1d720:'\u03b5', 0x1d721:'\u03b6', 0x1d722:'\u03b7', 0x1d723:'\u03b8',
-0x1d724:'\u03b9', 0x1d725:'\u03ba', 0x1d726:'\u03bb', 0x1d727:'\u03bc',
-0x1d728:'\u03bd', 0x1d729:'\u03be', 0x1d72a:'\u03bf', 0x1d72b:'\u03c0',
-0x1d72c:'\u03c1', 0x1d72d:'\u03b8', 0x1d72e:'\u03c3', 0x1d72f:'\u03c4',
-0x1d730:'\u03c5', 0x1d731:'\u03c6', 0x1d732:'\u03c7', 0x1d733:'\u03c8',
-0x1d734:'\u03c9', 0x1d747:'\u03c3', 0x1d756:'\u03b1', 0x1d757:'\u03b2',
-0x1d758:'\u03b3', 0x1d759:'\u03b4', 0x1d75a:'\u03b5', 0x1d75b:'\u03b6',
-0x1d75c:'\u03b7', 0x1d75d:'\u03b8', 0x1d75e:'\u03b9', 0x1d75f:'\u03ba',
-0x1d760:'\u03bb', 0x1d761:'\u03bc', 0x1d762:'\u03bd', 0x1d763:'\u03be',
-0x1d764:'\u03bf', 0x1d765:'\u03c0', 0x1d766:'\u03c1', 0x1d767:'\u03b8',
-0x1d768:'\u03c3', 0x1d769:'\u03c4', 0x1d76a:'\u03c5', 0x1d76b:'\u03c6',
-0x1d76c:'\u03c7', 0x1d76d:'\u03c8', 0x1d76e:'\u03c9', 0x1d781:'\u03c3',
-0x1d790:'\u03b1', 0x1d791:'\u03b2', 0x1d792:'\u03b3', 0x1d793:'\u03b4',
-0x1d794:'\u03b5', 0x1d795:'\u03b6', 0x1d796:'\u03b7', 0x1d797:'\u03b8',
-0x1d798:'\u03b9', 0x1d799:'\u03ba', 0x1d79a:'\u03bb', 0x1d79b:'\u03bc',
-0x1d79c:'\u03bd', 0x1d79d:'\u03be', 0x1d79e:'\u03bf', 0x1d79f:'\u03c0',
-0x1d7a0:'\u03c1', 0x1d7a1:'\u03b8', 0x1d7a2:'\u03c3', 0x1d7a3:'\u03c4',
-0x1d7a4:'\u03c5', 0x1d7a5:'\u03c6', 0x1d7a6:'\u03c7', 0x1d7a7:'\u03c8',
-0x1d7a8:'\u03c9', 0x1d7bb:'\u03c3', }
+0xb5:"\u03bc", 0xdf:"ss", 0x130:"i\u0307", 0x149:"\u02bcn",
+0x17f:"s", 0x1f0:"j\u030c", 0x345:"\u03b9", 0x37a:" \u03b9",
+0x390:"\u03b9\u0308\u0301", 0x3b0:"\u03c5\u0308\u0301", 0x3c2:"\u03c3", 0x3d0:"\u03b2",
+0x3d1:"\u03b8", 0x3d2:"\u03c5", 0x3d3:"\u03cd", 0x3d4:"\u03cb",
+0x3d5:"\u03c6", 0x3d6:"\u03c0", 0x3f0:"\u03ba", 0x3f1:"\u03c1",
+0x3f2:"\u03c3", 0x3f5:"\u03b5", 0x587:"\u0565\u0582", 0x1e96:"h\u0331",
+0x1e97:"t\u0308", 0x1e98:"w\u030a", 0x1e99:"y\u030a", 0x1e9a:"a\u02be",
+0x1e9b:"\u1e61", 0x1f50:"\u03c5\u0313", 0x1f52:"\u03c5\u0313\u0300", 0x1f54:"\u03c5\u0313\u0301",
+0x1f56:"\u03c5\u0313\u0342", 0x1f80:"\u1f00\u03b9", 0x1f81:"\u1f01\u03b9", 0x1f82:"\u1f02\u03b9",
+0x1f83:"\u1f03\u03b9", 0x1f84:"\u1f04\u03b9", 0x1f85:"\u1f05\u03b9", 0x1f86:"\u1f06\u03b9",
+0x1f87:"\u1f07\u03b9", 0x1f88:"\u1f00\u03b9", 0x1f89:"\u1f01\u03b9", 0x1f8a:"\u1f02\u03b9",
+0x1f8b:"\u1f03\u03b9", 0x1f8c:"\u1f04\u03b9", 0x1f8d:"\u1f05\u03b9", 0x1f8e:"\u1f06\u03b9",
+0x1f8f:"\u1f07\u03b9", 0x1f90:"\u1f20\u03b9", 0x1f91:"\u1f21\u03b9", 0x1f92:"\u1f22\u03b9",
+0x1f93:"\u1f23\u03b9", 0x1f94:"\u1f24\u03b9", 0x1f95:"\u1f25\u03b9", 0x1f96:"\u1f26\u03b9",
+0x1f97:"\u1f27\u03b9", 0x1f98:"\u1f20\u03b9", 0x1f99:"\u1f21\u03b9", 0x1f9a:"\u1f22\u03b9",
+0x1f9b:"\u1f23\u03b9", 0x1f9c:"\u1f24\u03b9", 0x1f9d:"\u1f25\u03b9", 0x1f9e:"\u1f26\u03b9",
+0x1f9f:"\u1f27\u03b9", 0x1fa0:"\u1f60\u03b9", 0x1fa1:"\u1f61\u03b9", 0x1fa2:"\u1f62\u03b9",
+0x1fa3:"\u1f63\u03b9", 0x1fa4:"\u1f64\u03b9", 0x1fa5:"\u1f65\u03b9", 0x1fa6:"\u1f66\u03b9",
+0x1fa7:"\u1f67\u03b9", 0x1fa8:"\u1f60\u03b9", 0x1fa9:"\u1f61\u03b9", 0x1faa:"\u1f62\u03b9",
+0x1fab:"\u1f63\u03b9", 0x1fac:"\u1f64\u03b9", 0x1fad:"\u1f65\u03b9", 0x1fae:"\u1f66\u03b9",
+0x1faf:"\u1f67\u03b9", 0x1fb2:"\u1f70\u03b9", 0x1fb3:"\u03b1\u03b9", 0x1fb4:"\u03ac\u03b9",
+0x1fb6:"\u03b1\u0342", 0x1fb7:"\u03b1\u0342\u03b9", 0x1fbc:"\u03b1\u03b9", 0x1fbe:"\u03b9",
+0x1fc2:"\u1f74\u03b9", 0x1fc3:"\u03b7\u03b9", 0x1fc4:"\u03ae\u03b9", 0x1fc6:"\u03b7\u0342",
+0x1fc7:"\u03b7\u0342\u03b9", 0x1fcc:"\u03b7\u03b9", 0x1fd2:"\u03b9\u0308\u0300", 0x1fd3:"\u03b9\u0308\u0301",
+0x1fd6:"\u03b9\u0342", 0x1fd7:"\u03b9\u0308\u0342", 0x1fe2:"\u03c5\u0308\u0300", 0x1fe3:"\u03c5\u0308\u0301",
+0x1fe4:"\u03c1\u0313", 0x1fe6:"\u03c5\u0342", 0x1fe7:"\u03c5\u0308\u0342", 0x1ff2:"\u1f7c\u03b9",
+0x1ff3:"\u03c9\u03b9", 0x1ff4:"\u03ce\u03b9", 0x1ff6:"\u03c9\u0342", 0x1ff7:"\u03c9\u0342\u03b9",
+0x1ffc:"\u03c9\u03b9", 0x20a8:"rs", 0x2102:"c", 0x2103:"\xb0c",
+0x2107:"\u025b", 0x2109:"\xb0f", 0x210b:"h", 0x210c:"h",
+0x210d:"h", 0x2110:"i", 0x2111:"i", 0x2112:"l",
+0x2115:"n", 0x2116:"no", 0x2119:"p", 0x211a:"q",
+0x211b:"r", 0x211c:"r", 0x211d:"r", 0x2120:"sm",
+0x2121:"tel", 0x2122:"tm", 0x2124:"z", 0x2128:"z",
+0x212c:"b", 0x212d:"c", 0x2130:"e", 0x2131:"f",
+0x2133:"m", 0x213e:"\u03b3", 0x213f:"\u03c0", 0x2145:"d",
+0x3371:"hpa", 0x3373:"au", 0x3375:"ov", 0x3380:"pa",
+0x3381:"na", 0x3382:"\u03bca", 0x3383:"ma", 0x3384:"ka",
+0x3385:"kb", 0x3386:"mb", 0x3387:"gb", 0x338a:"pf",
+0x338b:"nf", 0x338c:"\u03bcf", 0x3390:"hz", 0x3391:"khz",
+0x3392:"mhz", 0x3393:"ghz", 0x3394:"thz", 0x33a9:"pa",
+0x33aa:"kpa", 0x33ab:"mpa", 0x33ac:"gpa", 0x33b4:"pv",
+0x33b5:"nv", 0x33b6:"\u03bcv", 0x33b7:"mv", 0x33b8:"kv",
+0x33b9:"mv", 0x33ba:"pw", 0x33bb:"nw", 0x33bc:"\u03bcw",
+0x33bd:"mw", 0x33be:"kw", 0x33bf:"mw", 0x33c0:"k\u03c9",
+0x33c1:"m\u03c9", 0x33c3:"bq", 0x33c6:"c\u2215kg", 0x33c7:"co.",
+0x33c8:"db", 0x33c9:"gy", 0x33cb:"hp", 0x33cd:"kk",
+0x33ce:"km", 0x33d7:"ph", 0x33d9:"ppm", 0x33da:"pr",
+0x33dc:"sv", 0x33dd:"wb", 0xfb00:"ff", 0xfb01:"fi",
+0xfb02:"fl", 0xfb03:"ffi", 0xfb04:"ffl", 0xfb05:"st",
+0xfb06:"st", 0xfb13:"\u0574\u0576", 0xfb14:"\u0574\u0565", 0xfb15:"\u0574\u056b",
+0xfb16:"\u057e\u0576", 0xfb17:"\u0574\u056d", 0x1d400:"a", 0x1d401:"b",
+0x1d402:"c", 0x1d403:"d", 0x1d404:"e", 0x1d405:"f",
+0x1d406:"g", 0x1d407:"h", 0x1d408:"i", 0x1d409:"j",
+0x1d40a:"k", 0x1d40b:"l", 0x1d40c:"m", 0x1d40d:"n",
+0x1d40e:"o", 0x1d40f:"p", 0x1d410:"q", 0x1d411:"r",
+0x1d412:"s", 0x1d413:"t", 0x1d414:"u", 0x1d415:"v",
+0x1d416:"w", 0x1d417:"x", 0x1d418:"y", 0x1d419:"z",
+0x1d434:"a", 0x1d435:"b", 0x1d436:"c", 0x1d437:"d",
+0x1d438:"e", 0x1d439:"f", 0x1d43a:"g", 0x1d43b:"h",
+0x1d43c:"i", 0x1d43d:"j", 0x1d43e:"k", 0x1d43f:"l",
+0x1d440:"m", 0x1d441:"n", 0x1d442:"o", 0x1d443:"p",
+0x1d444:"q", 0x1d445:"r", 0x1d446:"s", 0x1d447:"t",
+0x1d448:"u", 0x1d449:"v", 0x1d44a:"w", 0x1d44b:"x",
+0x1d44c:"y", 0x1d44d:"z", 0x1d468:"a", 0x1d469:"b",
+0x1d46a:"c", 0x1d46b:"d", 0x1d46c:"e", 0x1d46d:"f",
+0x1d46e:"g", 0x1d46f:"h", 0x1d470:"i", 0x1d471:"j",
+0x1d472:"k", 0x1d473:"l", 0x1d474:"m", 0x1d475:"n",
+0x1d476:"o", 0x1d477:"p", 0x1d478:"q", 0x1d479:"r",
+0x1d47a:"s", 0x1d47b:"t", 0x1d47c:"u", 0x1d47d:"v",
+0x1d47e:"w", 0x1d47f:"x", 0x1d480:"y", 0x1d481:"z",
+0x1d49c:"a", 0x1d49e:"c", 0x1d49f:"d", 0x1d4a2:"g",
+0x1d4a5:"j", 0x1d4a6:"k", 0x1d4a9:"n", 0x1d4aa:"o",
+0x1d4ab:"p", 0x1d4ac:"q", 0x1d4ae:"s", 0x1d4af:"t",
+0x1d4b0:"u", 0x1d4b1:"v", 0x1d4b2:"w", 0x1d4b3:"x",
+0x1d4b4:"y", 0x1d4b5:"z", 0x1d4d0:"a", 0x1d4d1:"b",
+0x1d4d2:"c", 0x1d4d3:"d", 0x1d4d4:"e", 0x1d4d5:"f",
+0x1d4d6:"g", 0x1d4d7:"h", 0x1d4d8:"i", 0x1d4d9:"j",
+0x1d4da:"k", 0x1d4db:"l", 0x1d4dc:"m", 0x1d4dd:"n",
+0x1d4de:"o", 0x1d4df:"p", 0x1d4e0:"q", 0x1d4e1:"r",
+0x1d4e2:"s", 0x1d4e3:"t", 0x1d4e4:"u", 0x1d4e5:"v",
+0x1d4e6:"w", 0x1d4e7:"x", 0x1d4e8:"y", 0x1d4e9:"z",
+0x1d504:"a", 0x1d505:"b", 0x1d507:"d", 0x1d508:"e",
+0x1d509:"f", 0x1d50a:"g", 0x1d50d:"j", 0x1d50e:"k",
+0x1d50f:"l", 0x1d510:"m", 0x1d511:"n", 0x1d512:"o",
+0x1d513:"p", 0x1d514:"q", 0x1d516:"s", 0x1d517:"t",
+0x1d518:"u", 0x1d519:"v", 0x1d51a:"w", 0x1d51b:"x",
+0x1d51c:"y", 0x1d538:"a", 0x1d539:"b", 0x1d53b:"d",
+0x1d53c:"e", 0x1d53d:"f", 0x1d53e:"g", 0x1d540:"i",
+0x1d541:"j", 0x1d542:"k", 0x1d543:"l", 0x1d544:"m",
+0x1d546:"o", 0x1d54a:"s", 0x1d54b:"t", 0x1d54c:"u",
+0x1d54d:"v", 0x1d54e:"w", 0x1d54f:"x", 0x1d550:"y",
+0x1d56c:"a", 0x1d56d:"b", 0x1d56e:"c", 0x1d56f:"d",
+0x1d570:"e", 0x1d571:"f", 0x1d572:"g", 0x1d573:"h",
+0x1d574:"i", 0x1d575:"j", 0x1d576:"k", 0x1d577:"l",
+0x1d578:"m", 0x1d579:"n", 0x1d57a:"o", 0x1d57b:"p",
+0x1d57c:"q", 0x1d57d:"r", 0x1d57e:"s", 0x1d57f:"t",
+0x1d580:"u", 0x1d581:"v", 0x1d582:"w", 0x1d583:"x",
+0x1d584:"y", 0x1d585:"z", 0x1d5a0:"a", 0x1d5a1:"b",
+0x1d5a2:"c", 0x1d5a3:"d", 0x1d5a4:"e", 0x1d5a5:"f",
+0x1d5a6:"g", 0x1d5a7:"h", 0x1d5a8:"i", 0x1d5a9:"j",
+0x1d5aa:"k", 0x1d5ab:"l", 0x1d5ac:"m", 0x1d5ad:"n",
+0x1d5ae:"o", 0x1d5af:"p", 0x1d5b0:"q", 0x1d5b1:"r",
+0x1d5b2:"s", 0x1d5b3:"t", 0x1d5b4:"u", 0x1d5b5:"v",
+0x1d5b6:"w", 0x1d5b7:"x", 0x1d5b8:"y", 0x1d5b9:"z",
+0x1d5d4:"a", 0x1d5d5:"b", 0x1d5d6:"c", 0x1d5d7:"d",
+0x1d5d8:"e", 0x1d5d9:"f", 0x1d5da:"g", 0x1d5db:"h",
+0x1d5dc:"i", 0x1d5dd:"j", 0x1d5de:"k", 0x1d5df:"l",
+0x1d5e0:"m", 0x1d5e1:"n", 0x1d5e2:"o", 0x1d5e3:"p",
+0x1d5e4:"q", 0x1d5e5:"r", 0x1d5e6:"s", 0x1d5e7:"t",
+0x1d5e8:"u", 0x1d5e9:"v", 0x1d5ea:"w", 0x1d5eb:"x",
+0x1d5ec:"y", 0x1d5ed:"z", 0x1d608:"a", 0x1d609:"b",
+0x1d60a:"c", 0x1d60b:"d", 0x1d60c:"e", 0x1d60d:"f",
+0x1d60e:"g", 0x1d60f:"h", 0x1d610:"i", 0x1d611:"j",
+0x1d612:"k", 0x1d613:"l", 0x1d614:"m", 0x1d615:"n",
+0x1d616:"o", 0x1d617:"p", 0x1d618:"q", 0x1d619:"r",
+0x1d61a:"s", 0x1d61b:"t", 0x1d61c:"u", 0x1d61d:"v",
+0x1d61e:"w", 0x1d61f:"x", 0x1d620:"y", 0x1d621:"z",
+0x1d63c:"a", 0x1d63d:"b", 0x1d63e:"c", 0x1d63f:"d",
+0x1d640:"e", 0x1d641:"f", 0x1d642:"g", 0x1d643:"h",
+0x1d644:"i", 0x1d645:"j", 0x1d646:"k", 0x1d647:"l",
+0x1d648:"m", 0x1d649:"n", 0x1d64a:"o", 0x1d64b:"p",
+0x1d64c:"q", 0x1d64d:"r", 0x1d64e:"s", 0x1d64f:"t",
+0x1d650:"u", 0x1d651:"v", 0x1d652:"w", 0x1d653:"x",
+0x1d654:"y", 0x1d655:"z", 0x1d670:"a", 0x1d671:"b",
+0x1d672:"c", 0x1d673:"d", 0x1d674:"e", 0x1d675:"f",
+0x1d676:"g", 0x1d677:"h", 0x1d678:"i", 0x1d679:"j",
+0x1d67a:"k", 0x1d67b:"l", 0x1d67c:"m", 0x1d67d:"n",
+0x1d67e:"o", 0x1d67f:"p", 0x1d680:"q", 0x1d681:"r",
+0x1d682:"s", 0x1d683:"t", 0x1d684:"u", 0x1d685:"v",
+0x1d686:"w", 0x1d687:"x", 0x1d688:"y", 0x1d689:"z",
+0x1d6a8:"\u03b1", 0x1d6a9:"\u03b2", 0x1d6aa:"\u03b3", 0x1d6ab:"\u03b4",
+0x1d6ac:"\u03b5", 0x1d6ad:"\u03b6", 0x1d6ae:"\u03b7", 0x1d6af:"\u03b8",
+0x1d6b0:"\u03b9", 0x1d6b1:"\u03ba", 0x1d6b2:"\u03bb", 0x1d6b3:"\u03bc",
+0x1d6b4:"\u03bd", 0x1d6b5:"\u03be", 0x1d6b6:"\u03bf", 0x1d6b7:"\u03c0",
+0x1d6b8:"\u03c1", 0x1d6b9:"\u03b8", 0x1d6ba:"\u03c3", 0x1d6bb:"\u03c4",
+0x1d6bc:"\u03c5", 0x1d6bd:"\u03c6", 0x1d6be:"\u03c7", 0x1d6bf:"\u03c8",
+0x1d6c0:"\u03c9", 0x1d6d3:"\u03c3", 0x1d6e2:"\u03b1", 0x1d6e3:"\u03b2",
+0x1d6e4:"\u03b3", 0x1d6e5:"\u03b4", 0x1d6e6:"\u03b5", 0x1d6e7:"\u03b6",
+0x1d6e8:"\u03b7", 0x1d6e9:"\u03b8", 0x1d6ea:"\u03b9", 0x1d6eb:"\u03ba",
+0x1d6ec:"\u03bb", 0x1d6ed:"\u03bc", 0x1d6ee:"\u03bd", 0x1d6ef:"\u03be",
+0x1d6f0:"\u03bf", 0x1d6f1:"\u03c0", 0x1d6f2:"\u03c1", 0x1d6f3:"\u03b8",
+0x1d6f4:"\u03c3", 0x1d6f5:"\u03c4", 0x1d6f6:"\u03c5", 0x1d6f7:"\u03c6",
+0x1d6f8:"\u03c7", 0x1d6f9:"\u03c8", 0x1d6fa:"\u03c9", 0x1d70d:"\u03c3",
+0x1d71c:"\u03b1", 0x1d71d:"\u03b2", 0x1d71e:"\u03b3", 0x1d71f:"\u03b4",
+0x1d720:"\u03b5", 0x1d721:"\u03b6", 0x1d722:"\u03b7", 0x1d723:"\u03b8",
+0x1d724:"\u03b9", 0x1d725:"\u03ba", 0x1d726:"\u03bb", 0x1d727:"\u03bc",
+0x1d728:"\u03bd", 0x1d729:"\u03be", 0x1d72a:"\u03bf", 0x1d72b:"\u03c0",
+0x1d72c:"\u03c1", 0x1d72d:"\u03b8", 0x1d72e:"\u03c3", 0x1d72f:"\u03c4",
+0x1d730:"\u03c5", 0x1d731:"\u03c6", 0x1d732:"\u03c7", 0x1d733:"\u03c8",
+0x1d734:"\u03c9", 0x1d747:"\u03c3", 0x1d756:"\u03b1", 0x1d757:"\u03b2",
+0x1d758:"\u03b3", 0x1d759:"\u03b4", 0x1d75a:"\u03b5", 0x1d75b:"\u03b6",
+0x1d75c:"\u03b7", 0x1d75d:"\u03b8", 0x1d75e:"\u03b9", 0x1d75f:"\u03ba",
+0x1d760:"\u03bb", 0x1d761:"\u03bc", 0x1d762:"\u03bd", 0x1d763:"\u03be",
+0x1d764:"\u03bf", 0x1d765:"\u03c0", 0x1d766:"\u03c1", 0x1d767:"\u03b8",
+0x1d768:"\u03c3", 0x1d769:"\u03c4", 0x1d76a:"\u03c5", 0x1d76b:"\u03c6",
+0x1d76c:"\u03c7", 0x1d76d:"\u03c8", 0x1d76e:"\u03c9", 0x1d781:"\u03c3",
+0x1d790:"\u03b1", 0x1d791:"\u03b2", 0x1d792:"\u03b3", 0x1d793:"\u03b4",
+0x1d794:"\u03b5", 0x1d795:"\u03b6", 0x1d796:"\u03b7", 0x1d797:"\u03b8",
+0x1d798:"\u03b9", 0x1d799:"\u03ba", 0x1d79a:"\u03bb", 0x1d79b:"\u03bc",
+0x1d79c:"\u03bd", 0x1d79d:"\u03be", 0x1d79e:"\u03bf", 0x1d79f:"\u03c0",
+0x1d7a0:"\u03c1", 0x1d7a1:"\u03b8", 0x1d7a2:"\u03c3", 0x1d7a3:"\u03c4",
+0x1d7a4:"\u03c5", 0x1d7a5:"\u03c6", 0x1d7a6:"\u03c7", 0x1d7a7:"\u03c8",
+0x1d7a8:"\u03c9", 0x1d7bb:"\u03c3", }
def map_table_b3(code):
r = b3_exceptions.get(ord(code))
diff --git a/.venv3.10/Lib/struct.py b/.venv3.10/Lib/struct.py
index d6bba588..7fd4cef1 100644
--- a/.venv3.10/Lib/struct.py
+++ b/.venv3.10/Lib/struct.py
@@ -1,15 +1,13 @@
__all__ = [
# Functions
- 'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from',
- 'iter_unpack',
+ "calcsize", "pack", "pack_into", "unpack", "unpack_from",
+ "iter_unpack",
# Classes
- 'Struct',
+ "Struct",
# Exceptions
- 'error'
+ "error"
]
from _struct import *
-from _struct import _clearcache
-from _struct import __doc__
diff --git a/.venv3.10/Lib/subprocess.py b/.venv3.10/Lib/subprocess.py
index f1e3d64d..c3c19b46 100644
--- a/.venv3.10/Lib/subprocess.py
+++ b/.venv3.10/Lib/subprocess.py
@@ -75,15 +75,6 @@
import select
import selectors
else:
- from _winapi import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
- STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
- STD_ERROR_HANDLE, SW_HIDE,
- STARTF_USESTDHANDLES, STARTF_USESHOWWINDOW,
- ABOVE_NORMAL_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS,
- HIGH_PRIORITY_CLASS, IDLE_PRIORITY_CLASS,
- NORMAL_PRIORITY_CLASS, REALTIME_PRIORITY_CLASS,
- CREATE_NO_WINDOW, DETACHED_PROCESS,
- CREATE_DEFAULT_ERROR_MODE, CREATE_BREAKAWAY_FROM_JOB)
__all__.extend(["CREATE_NEW_CONSOLE", "CREATE_NEW_PROCESS_GROUP",
"STD_INPUT_HANDLE", "STD_OUTPUT_HANDLE",
@@ -179,8 +170,8 @@ def __init__(self, *, dwFlags=0, hStdInput=None, hStdOutput=None,
def copy(self):
attr_list = self.lpAttributeList.copy()
- if 'handle_list' in attr_list:
- attr_list['handle_list'] = list(attr_list['handle_list'])
+ if "handle_list" in attr_list:
+ attr_list["handle_list"] = list(attr_list["handle_list"])
return STARTUPINFO(dwFlags=self.dwFlags,
hStdInput=self.hStdInput,
@@ -212,12 +203,12 @@ def __repr__(self):
# When select or poll has indicated that the file is writable,
# we can write up to _PIPE_BUF bytes without risk of blocking.
# POSIX defines PIPE_BUF as >= 512.
- _PIPE_BUF = getattr(select, 'PIPE_BUF', 512)
+ _PIPE_BUF = getattr(select, "PIPE_BUF", 512)
# poll/select have the advantage of not requiring any extra file
# descriptor, contrarily to epoll/kqueue (also, they require a single
# syscall).
- if hasattr(selectors, 'PollSelector'):
+ if hasattr(selectors, "PollSelector"):
_PopenSelector = selectors.PollSelector
else:
_PopenSelector = selectors.SelectSelector
@@ -271,7 +262,7 @@ def _optim_args_from_interpreter_flags():
args = []
value = sys.flags.optimize
if value > 0:
- args.append('-' + 'O' * value)
+ args.append("-" + "O" * value)
return args
@@ -279,57 +270,57 @@ def _args_from_interpreter_flags():
"""Return a list of command-line arguments reproducing the current
settings in sys.flags, sys.warnoptions and sys._xoptions."""
flag_opt_map = {
- 'debug': 'd',
+ "debug": "d",
# 'inspect': 'i',
# 'interactive': 'i',
- 'dont_write_bytecode': 'B',
- 'no_site': 'S',
- 'verbose': 'v',
- 'bytes_warning': 'b',
- 'quiet': 'q',
+ "dont_write_bytecode": "B",
+ "no_site": "S",
+ "verbose": "v",
+ "bytes_warning": "b",
+ "quiet": "q",
# -O is handled in _optim_args_from_interpreter_flags()
}
args = _optim_args_from_interpreter_flags()
for flag, opt in flag_opt_map.items():
v = getattr(sys.flags, flag)
if v > 0:
- args.append('-' + opt * v)
+ args.append("-" + opt * v)
if sys.flags.isolated:
- args.append('-I')
+ args.append("-I")
else:
if sys.flags.ignore_environment:
- args.append('-E')
+ args.append("-E")
if sys.flags.no_user_site:
- args.append('-s')
+ args.append("-s")
# -W options
warnopts = sys.warnoptions[:]
bytes_warning = sys.flags.bytes_warning
- xoptions = getattr(sys, '_xoptions', {})
- dev_mode = ('dev' in xoptions)
+ xoptions = getattr(sys, "_xoptions", {})
+ dev_mode = ("dev" in xoptions)
if bytes_warning > 1:
warnopts.remove("error::BytesWarning")
elif bytes_warning:
warnopts.remove("default::BytesWarning")
if dev_mode:
- warnopts.remove('default')
+ warnopts.remove("default")
for opt in warnopts:
- args.append('-W' + opt)
+ args.append("-W" + opt)
# -X options
if dev_mode:
- args.extend(('-X', 'dev'))
- for opt in ('faulthandler', 'tracemalloc', 'importtime',
- 'showrefcount', 'utf8'):
+ args.extend(("-X", "dev"))
+ for opt in ("faulthandler", "tracemalloc", "importtime",
+ "showrefcount", "utf8"):
if opt in xoptions:
value = xoptions[opt]
if value is True:
arg = opt
else:
- arg = '%s=%s' % (opt, value)
- args.extend(('-X', arg))
+ arg = "%s=%s" % (opt, value)
+ args.extend(("-X", arg))
return args
@@ -405,18 +396,18 @@ def check_output(*popenargs, timeout=None, **kwargs):
decoded according to locale encoding, or by "encoding" if set. Text mode
is triggered by setting any of text, encoding, errors or universal_newlines.
"""
- if 'stdout' in kwargs:
- raise ValueError('stdout argument not allowed, it will be overridden.')
+ if "stdout" in kwargs:
+ raise ValueError("stdout argument not allowed, it will be overridden.")
- if 'input' in kwargs and kwargs['input'] is None:
+ if "input" in kwargs and kwargs["input"] is None:
# Explicitly passing input=None was previously equivalent to passing an
# empty string. That is maintained here for backwards compatibility.
- if kwargs.get('universal_newlines') or kwargs.get('text') or kwargs.get('encoding') \
- or kwargs.get('errors'):
- empty = ''
+ if kwargs.get("universal_newlines") or kwargs.get("text") or kwargs.get("encoding") \
+ or kwargs.get("errors"):
+ empty = ""
else:
- empty = b''
- kwargs['input'] = empty
+ empty = b""
+ kwargs["input"] = empty
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
**kwargs).stdout
@@ -440,13 +431,13 @@ def __init__(self, args, returncode, stdout=None, stderr=None):
self.stderr = stderr
def __repr__(self):
- args = ['args={!r}'.format(self.args),
- 'returncode={!r}'.format(self.returncode)]
+ args = ["args={!r}".format(self.args),
+ "returncode={!r}".format(self.returncode)]
if self.stdout is not None:
- args.append('stdout={!r}'.format(self.stdout))
+ args.append("stdout={!r}".format(self.stdout))
if self.stderr is not None:
- args.append('stderr={!r}'.format(self.stderr))
- return "{}({})".format(type(self).__name__, ', '.join(args))
+ args.append("stderr={!r}".format(self.stderr))
+ return "{}({})".format(type(self).__name__, ", ".join(args))
__class_getitem__ = classmethod(types.GenericAlias)
@@ -489,16 +480,16 @@ def run(*popenargs,
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
- if kwargs.get('stdin') is not None:
- raise ValueError('stdin and input arguments may not both be used.')
- kwargs['stdin'] = PIPE
+ if kwargs.get("stdin") is not None:
+ raise ValueError("stdin and input arguments may not both be used.")
+ kwargs["stdin"] = PIPE
if capture_output:
- if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
- raise ValueError('stdout and stderr arguments may not be used '
- 'with capture_output.')
- kwargs['stdout'] = PIPE
- kwargs['stderr'] = PIPE
+ if kwargs.get("stdout") is not None or kwargs.get("stderr") is not None:
+ raise ValueError("stdout and stderr arguments may not be used "
+ "with capture_output.")
+ kwargs["stdout"] = PIPE
+ kwargs["stderr"] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
@@ -565,19 +556,19 @@ def list2cmdline(seq):
# Add a space to separate this argument from the others
if result:
- result.append(' ')
+ result.append(" ")
needquote = (" " in arg) or ("\t" in arg) or not arg
if needquote:
result.append('"')
for c in arg:
- if c == '\\':
+ if c == "\\":
# Don't know if we need to double yet.
bs_buf.append(c)
elif c == '"':
# Double backslashes.
- result.append('\\' * len(bs_buf)*2)
+ result.append("\\" * len(bs_buf)*2)
bs_buf = []
result.append('\\"')
else:
@@ -595,7 +586,7 @@ def list2cmdline(seq):
result.extend(bs_buf)
result.append('"')
- return ''.join(result)
+ return "".join(result)
# Various tools for executing commands and looking at their output and status.
@@ -628,7 +619,7 @@ def getstatusoutput(cmd):
except CalledProcessError as ex:
data = ex.output
exitcode = ex.returncode
- if data[-1:] == '\n':
+ if data[-1:] == "\n":
data = data[:-1]
return exitcode, data
@@ -658,27 +649,27 @@ def _use_posix_spawn():
Prefer an implementation which can use vfork() in some cases for best
performance.
"""
- if _mswindows or not hasattr(os, 'posix_spawn'):
+ if _mswindows or not hasattr(os, "posix_spawn"):
# os.posix_spawn() is not available
return False
- if sys.platform in ('darwin', 'sunos5'):
+ if sys.platform in ("darwin", "sunos5"):
# posix_spawn() is a syscall on both macOS and Solaris,
# and properly reports errors
return True
# Check libc name and runtime libc version
try:
- ver = os.confstr('CS_GNU_LIBC_VERSION')
+ ver = os.confstr("CS_GNU_LIBC_VERSION")
# parse 'glibc 2.28' as ('glibc', (2, 28))
parts = ver.split(maxsplit=1)
if len(parts) != 2:
# reject unknown format
raise ValueError
libc = parts[0]
- version = tuple(map(int, parts[1].split('.')))
+ version = tuple(map(int, parts[1].split(".")))
- if sys.platform == 'linux' and libc == 'glibc' and version >= (2, 24):
+ if sys.platform == "linux" and libc == "glibc" and version >= (2, 24):
# glibc 2.24 has a new Linux posix_spawn implementation using vfork
# which properly reports errors to the parent process.
return True
@@ -813,9 +804,9 @@ def __init__(self, args, bufsize=-1, executable=None,
# Validate the combinations of text and universal_newlines
if (text is not None and universal_newlines is not None
and bool(universal_newlines) != bool(text)):
- raise SubprocessError('Cannot disambiguate when both text '
- 'and universal_newlines are supplied but '
- 'different. Pass one or the other.')
+ raise SubprocessError("Cannot disambiguate when both text "
+ "and universal_newlines are supplied but "
+ "different. Pass one or the other.")
# Input and output objects. The general principle is like
# this:
@@ -875,7 +866,7 @@ def __init__(self, args, bufsize=-1, executable=None,
gid = None
if group is not None:
- if not hasattr(os, 'setregid'):
+ if not hasattr(os, "setregid"):
raise ValueError("The 'group' parameter is not supported on the "
"current platform")
@@ -898,7 +889,7 @@ def __init__(self, args, bufsize=-1, executable=None,
gids = None
if extra_groups is not None:
- if not hasattr(os, 'setgroups'):
+ if not hasattr(os, "setgroups"):
raise ValueError("The 'extra_groups' parameter is not "
"supported on the current platform")
@@ -931,7 +922,7 @@ def __init__(self, args, bufsize=-1, executable=None,
uid = None
if user is not None:
- if not hasattr(os, 'setreuid'):
+ if not hasattr(os, "setreuid"):
raise ValueError("The 'user' parameter is not supported on "
"the current platform")
@@ -952,18 +943,18 @@ def __init__(self, args, bufsize=-1, executable=None,
try:
if p2cwrite != -1:
- self.stdin = io.open(p2cwrite, 'wb', bufsize)
+ self.stdin = io.open(p2cwrite, "wb", bufsize)
if self.text_mode:
self.stdin = io.TextIOWrapper(self.stdin, write_through=True,
line_buffering=line_buffering,
encoding=encoding, errors=errors)
if c2pread != -1:
- self.stdout = io.open(c2pread, 'rb', bufsize)
+ self.stdout = io.open(c2pread, "rb", bufsize)
if self.text_mode:
self.stdout = io.TextIOWrapper(self.stdout,
encoding=encoding, errors=errors)
if errread != -1:
- self.stderr = io.open(errread, 'rb', bufsize)
+ self.stderr = io.open(errread, "rb", bufsize)
if self.text_mode:
self.stderr = io.TextIOWrapper(self.stderr,
encoding=encoding, errors=errors)
@@ -993,7 +984,7 @@ def __init__(self, args, bufsize=-1, executable=None,
to_close.append(c2pwrite)
if stderr == PIPE:
to_close.append(errwrite)
- if hasattr(self, '_devnull'):
+ if hasattr(self, "_devnull"):
to_close.append(self._devnull)
for fd in to_close:
try:
@@ -1078,7 +1069,7 @@ def __del__(self, _maxsize=sys.maxsize, _warn=warnings.warn):
_active.append(self)
def _get_devnull(self):
- if not hasattr(self, '_devnull'):
+ if not hasattr(self, "_devnull"):
self._devnull = os.open(os.devnull, os.O_RDWR)
return self._devnull
@@ -1197,8 +1188,8 @@ def _check_timeout(self, endtime, orig_timeout, stdout_seq, stderr_seq,
if skip_check_and_raise or _time() > endtime:
raise TimeoutExpired(
self.args, orig_timeout,
- output=b''.join(stdout_seq) if stdout_seq else None,
- stderr=b''.join(stderr_seq) if stderr_seq else None)
+ output=b"".join(stdout_seq) if stdout_seq else None,
+ stderr=b"".join(stderr_seq) if stderr_seq else None)
def wait(self, timeout=None):
@@ -1229,7 +1220,7 @@ def _close_pipe_fds(self,
c2pread, c2pwrite,
errread, errwrite):
# self._devnull is not always defined.
- devnull_fd = getattr(self, '_devnull', None)
+ devnull_fd = getattr(self, "_devnull", None)
with contextlib.ExitStack() as stack:
if _mswindows:
@@ -1369,12 +1360,12 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
pass
elif isinstance(args, bytes):
if shell:
- raise TypeError('bytes args is not allowed on Windows')
+ raise TypeError("bytes args is not allowed on Windows")
args = list2cmdline([args])
elif isinstance(args, os.PathLike):
if shell:
- raise TypeError('path-like args is not allowed when '
- 'shell is true')
+ raise TypeError("path-like args is not allowed when "
+ "shell is true")
args = list2cmdline([args])
else:
args = list2cmdline(args)
@@ -1433,12 +1424,12 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
# application directory, and also the current directory if
# NeedCurrentDirectoryForExePathW(ExeName) is true, so try
# to avoid executing unqualified "cmd.exe".
- comspec = os.environ.get('ComSpec')
+ comspec = os.environ.get("ComSpec")
if not comspec:
- system_root = os.environ.get('SystemRoot', '')
- comspec = os.path.join(system_root, 'System32', 'cmd.exe')
+ system_root = os.environ.get("SystemRoot", "")
+ comspec = os.path.join(system_root, "System32", "cmd.exe")
if not os.path.isabs(comspec):
- raise FileNotFoundError('shell not found: neither %ComSpec% nor %SystemRoot% is set')
+ raise FileNotFoundError("shell not found: neither %ComSpec% nor %SystemRoot% is set")
if os.path.isabs(comspec):
executable = comspec
else:
@@ -1673,11 +1664,11 @@ def _posix_spawn(self, args, executable, env, restore_signals,
if restore_signals:
# See _Py_RestoreSignals() in Python/pylifecycle.c
sigset = []
- for signame in ('SIGPIPE', 'SIGXFZ', 'SIGXFSZ'):
+ for signame in ("SIGPIPE", "SIGXFZ", "SIGXFSZ"):
signum = getattr(signal, signame, None)
if signum is not None:
sigset.append(signum)
- kwargs['setsigdef'] = sigset
+ kwargs["setsigdef"] = sigset
file_actions = []
for fd in (p2cwrite, c2pread, errread):
@@ -1691,7 +1682,7 @@ def _posix_spawn(self, args, executable, env, restore_signals,
if fd != -1:
file_actions.append((os.POSIX_SPAWN_DUP2, fd, fd2))
if file_actions:
- kwargs['file_actions'] = file_actions
+ kwargs["file_actions"] = file_actions
self.pid = os.posix_spawn(executable, args, env, **kwargs)
self._child_created = True
@@ -1715,16 +1706,16 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
args = [args]
elif isinstance(args, os.PathLike):
if shell:
- raise TypeError('path-like args is not allowed when '
- 'shell is true')
+ raise TypeError("path-like args is not allowed when "
+ "shell is true")
args = [args]
else:
args = list(args)
if shell:
# On Android the default shell is at '/system/bin/sh'.
- unix_shell = ('/system/bin/sh' if
- hasattr(sys, 'getandroidapilevel') else '/bin/sh')
+ unix_shell = ("/system/bin/sh" if
+ hasattr(sys, "getandroidapilevel") else "/bin/sh")
args = [unix_shell, "-c"] + args
if executable:
args[0] = executable
@@ -1778,9 +1769,9 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
env_list = []
for k, v in env.items():
k = os.fsencode(k)
- if b'=' in k:
+ if b"=" in k:
raise ValueError("illegal environment variable name")
- env_list.append(k + b'=' + os.fsencode(v))
+ env_list.append(k + b"=" + os.fsencode(v))
else:
env_list = None # Use execv instead of execve.
executable = os.fsencode(executable)
@@ -1836,18 +1827,18 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
try:
exception_name, hex_errno, err_msg = (
- errpipe_data.split(b':', 2))
+ errpipe_data.split(b":", 2))
# The encoding here should match the encoding
# written in by the subprocess implementations
# like _posixsubprocess
err_msg = err_msg.decode()
except ValueError:
- exception_name = b'SubprocessError'
- hex_errno = b'0'
- err_msg = 'Bad exception data from child: {!r}'.format(
+ exception_name = b"SubprocessError"
+ hex_errno = b"0"
+ err_msg = "Bad exception data from child: {!r}".format(
bytes(errpipe_data))
child_exception_type = getattr(
- builtins, exception_name.decode('ascii'),
+ builtins, exception_name.decode("ascii"),
SubprocessError)
if issubclass(child_exception_type, OSError) and hex_errno:
errno_num = int(hex_errno, 16)
@@ -2015,8 +2006,8 @@ def _communicate(self, input, endtime, orig_timeout):
stdout, stderr,
skip_check_and_raise=True)
raise RuntimeError( # Impossible :)
- '_check_timeout(..., skip_check_and_raise=True) '
- 'failed to raise TimeoutExpired.')
+ "_check_timeout(..., skip_check_and_raise=True) "
+ "failed to raise TimeoutExpired.")
ready = selector.select(timeout)
self._check_timeout(endtime, orig_timeout, stdout, stderr)
@@ -2048,9 +2039,9 @@ def _communicate(self, input, endtime, orig_timeout):
# All data exchanged. Translate lists into strings.
if stdout is not None:
- stdout = b''.join(stdout)
+ stdout = b"".join(stdout)
if stderr is not None:
- stderr = b''.join(stderr)
+ stderr = b"".join(stderr)
# Translate newlines, if requested.
# This also turns bytes into strings.
diff --git a/.venv3.10/Lib/sunau.py b/.venv3.10/Lib/sunau.py
index 79750a9d..e9f67b9c 100644
--- a/.venv3.10/Lib/sunau.py
+++ b/.venv3.10/Lib/sunau.py
@@ -106,8 +106,8 @@
from collections import namedtuple
-_sunau_params = namedtuple('_sunau_params',
- 'nchannels sampwidth framerate nframes comptype compname')
+_sunau_params = namedtuple("_sunau_params",
+ "nchannels sampwidth framerate nframes comptype compname")
# from
AUDIO_FILE_MAGIC = 0x2e736e64
@@ -157,9 +157,9 @@ def _write_u32(file, x):
class Au_read:
def __init__(self, f):
- if type(f) == type(''):
+ if type(f) == type(""):
import builtins
- f = builtins.open(f, 'rb')
+ f = builtins.open(f, "rb")
self._opened = True
else:
self._opened = False
@@ -180,18 +180,18 @@ def initfp(self, file):
self._soundpos = 0
magic = int(_read_u32(file))
if magic != AUDIO_FILE_MAGIC:
- raise Error('bad magic number')
+ raise Error("bad magic number")
self._hdr_size = int(_read_u32(file))
if self._hdr_size < 24:
- raise Error('header size too small')
+ raise Error("header size too small")
if self._hdr_size > 100:
- raise Error('header size ridiculously large')
+ raise Error("header size ridiculously large")
self._data_size = _read_u32(file)
if self._data_size != AUDIO_UNKNOWN_SIZE:
self._data_size = int(self._data_size)
self._encoding = int(_read_u32(file))
if self._encoding not in _simple_encodings:
- raise Error('encoding not (yet) supported')
+ raise Error("encoding not (yet) supported")
if self._encoding in (AUDIO_FILE_ENCODING_MULAW_8,
AUDIO_FILE_ENCODING_ALAW_8):
self._sampwidth = 2
@@ -205,17 +205,17 @@ def initfp(self, file):
elif self._encoding == AUDIO_FILE_ENCODING_LINEAR_32:
self._framesize = self._sampwidth = 4
else:
- raise Error('unknown encoding')
+ raise Error("unknown encoding")
self._framerate = int(_read_u32(file))
self._nchannels = int(_read_u32(file))
if not self._nchannels:
- raise Error('bad # of channels')
+ raise Error("bad # of channels")
self._framesize = self._framesize * self._nchannels
if self._hdr_size > 24:
self._info = file.read(self._hdr_size - 24)
- self._info, _, _ = self._info.partition(b'\0')
+ self._info, _, _ = self._info.partition(b"\0")
else:
- self._info = b''
+ self._info = b""
try:
self._data_pos = file.tell()
except (AttributeError, OSError):
@@ -242,19 +242,19 @@ def getnframes(self):
def getcomptype(self):
if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
- return 'ULAW'
+ return "ULAW"
elif self._encoding == AUDIO_FILE_ENCODING_ALAW_8:
- return 'ALAW'
+ return "ALAW"
else:
- return 'NONE'
+ return "NONE"
def getcompname(self):
if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
- return 'CCITT G.711 u-law'
+ return "CCITT G.711 u-law"
elif self._encoding == AUDIO_FILE_ENCODING_ALAW_8:
- return 'CCITT G.711 A-law'
+ return "CCITT G.711 A-law"
else:
- return 'not compressed'
+ return "not compressed"
def getparams(self):
return _sunau_params(self.getnchannels(), self.getsampwidth(),
@@ -265,7 +265,7 @@ def getmarkers(self):
return None
def getmark(self, id):
- raise Error('no marks')
+ raise Error("no marks")
def readframes(self, nframes):
if self._encoding in _simple_encodings:
@@ -282,7 +282,7 @@ def readframes(self, nframes):
def rewind(self):
if self._data_pos is None:
- raise OSError('cannot seek')
+ raise OSError("cannot seek")
self._file.seek(self._data_pos)
self._soundpos = 0
@@ -291,9 +291,9 @@ def tell(self):
def setpos(self, pos):
if pos < 0 or pos > self.getnframes():
- raise Error('position not in range')
+ raise Error("position not in range")
if self._data_pos is None:
- raise OSError('cannot seek')
+ raise OSError("cannot seek")
self._file.seek(self._data_pos + pos * self._framesize)
self._soundpos = pos
@@ -307,9 +307,9 @@ def close(self):
class Au_write:
def __init__(self, f):
- if type(f) == type(''):
+ if type(f) == type(""):
import builtins
- f = builtins.open(f, 'wb')
+ f = builtins.open(f, "wb")
self._opened = True
else:
self._opened = False
@@ -336,69 +336,69 @@ def initfp(self, file):
self._nframeswritten = 0
self._datawritten = 0
self._datalength = 0
- self._info = b''
- self._comptype = 'ULAW' # default is U-law
+ self._info = b""
+ self._comptype = "ULAW" # default is U-law
def setnchannels(self, nchannels):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
if nchannels not in (1, 2, 4):
- raise Error('only 1, 2, or 4 channels supported')
+ raise Error("only 1, 2, or 4 channels supported")
self._nchannels = nchannels
def getnchannels(self):
if not self._nchannels:
- raise Error('number of channels not set')
+ raise Error("number of channels not set")
return self._nchannels
def setsampwidth(self, sampwidth):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
if sampwidth not in (1, 2, 3, 4):
- raise Error('bad sample width')
+ raise Error("bad sample width")
self._sampwidth = sampwidth
def getsampwidth(self):
if not self._framerate:
- raise Error('sample width not specified')
+ raise Error("sample width not specified")
return self._sampwidth
def setframerate(self, framerate):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
self._framerate = framerate
def getframerate(self):
if not self._framerate:
- raise Error('frame rate not set')
+ raise Error("frame rate not set")
return self._framerate
def setnframes(self, nframes):
if self._nframeswritten:
- raise Error('cannot change parameters after starting to write')
+ raise Error("cannot change parameters after starting to write")
if nframes < 0:
- raise Error('# of frames cannot be negative')
+ raise Error("# of frames cannot be negative")
self._nframes = nframes
def getnframes(self):
return self._nframeswritten
def setcomptype(self, type, name):
- if type in ('NONE', 'ULAW'):
+ if type in ("NONE", "ULAW"):
self._comptype = type
else:
- raise Error('unknown compression type')
+ raise Error("unknown compression type")
def getcomptype(self):
return self._comptype
def getcompname(self):
- if self._comptype == 'ULAW':
- return 'CCITT G.711 u-law'
- elif self._comptype == 'ALAW':
- return 'CCITT G.711 A-law'
+ if self._comptype == "ULAW":
+ return "CCITT G.711 u-law"
+ elif self._comptype == "ALAW":
+ return "CCITT G.711 A-law"
else:
- return 'not compressed'
+ return "not compressed"
def setparams(self, params):
nchannels, sampwidth, framerate, nframes, comptype, compname = params
@@ -418,9 +418,9 @@ def tell(self):
def writeframesraw(self, data):
if not isinstance(data, (bytes, bytearray)):
- data = memoryview(data).cast('B')
+ data = memoryview(data).cast("B")
self._ensure_header_written()
- if self._comptype == 'ULAW':
+ if self._comptype == "ULAW":
import audioop
data = audioop.lin2ulaw(data, self._sampwidth)
nframes = len(data) // self._framesize
@@ -455,15 +455,15 @@ def close(self):
def _ensure_header_written(self):
if not self._nframeswritten:
if not self._nchannels:
- raise Error('# of channels not specified')
+ raise Error("# of channels not specified")
if not self._sampwidth:
- raise Error('sample width not specified')
+ raise Error("sample width not specified")
if not self._framerate:
- raise Error('frame rate not specified')
+ raise Error("frame rate not specified")
self._write_header()
def _write_header(self):
- if self._comptype == 'NONE':
+ if self._comptype == "NONE":
if self._sampwidth == 1:
encoding = AUDIO_FILE_ENCODING_LINEAR_8
self._framesize = 1
@@ -477,12 +477,12 @@ def _write_header(self):
encoding = AUDIO_FILE_ENCODING_LINEAR_32
self._framesize = 4
else:
- raise Error('internal error')
- elif self._comptype == 'ULAW':
+ raise Error("internal error")
+ elif self._comptype == "ULAW":
encoding = AUDIO_FILE_ENCODING_MULAW_8
self._framesize = 1
else:
- raise Error('internal error')
+ raise Error("internal error")
self._framesize = self._framesize * self._nchannels
_write_u32(self._file, AUDIO_FILE_MAGIC)
header_size = 25 + len(self._info)
@@ -502,11 +502,11 @@ def _write_header(self):
_write_u32(self._file, self._framerate)
_write_u32(self._file, self._nchannels)
self._file.write(self._info)
- self._file.write(b'\0'*(header_size - len(self._info) - 24))
+ self._file.write(b"\0"*(header_size - len(self._info) - 24))
def _patchheader(self):
if self._form_length_pos is None:
- raise OSError('cannot seek')
+ raise OSError("cannot seek")
self._file.seek(self._form_length_pos)
_write_u32(self._file, self._datawritten)
self._datalength = self._datawritten
@@ -514,13 +514,13 @@ def _patchheader(self):
def open(f, mode=None):
if mode is None:
- if hasattr(f, 'mode'):
+ if hasattr(f, "mode"):
mode = f.mode
else:
- mode = 'rb'
- if mode in ('r', 'rb'):
+ mode = "rb"
+ if mode in ("r", "rb"):
return Au_read(f)
- elif mode in ('w', 'wb'):
+ elif mode in ("w", "wb"):
return Au_write(f)
else:
raise Error("mode must be 'r', 'rb', 'w', or 'wb'")
diff --git a/.venv3.10/Lib/symtable.py b/.venv3.10/Lib/symtable.py
index e11e5fff..a326c655 100644
--- a/.venv3.10/Lib/symtable.py
+++ b/.venv3.10/Lib/symtable.py
@@ -1,7 +1,7 @@
"""Interface to the compiler's internal symbol tables"""
import _symtable
-from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM,
+from _symtable import (DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
@@ -313,7 +313,8 @@ def get_namespace(self):
return self.__namespaces[0]
if __name__ == "__main__":
- import os, sys
+ import os
+ import sys
with open(sys.argv[0]) as f:
src = f.read()
mod = symtable(src, os.path.split(sys.argv[0])[1], "exec")
diff --git a/.venv3.10/Lib/sysconfig.py b/.venv3.10/Lib/sysconfig.py
index 5d124267..6ce8ffed 100644
--- a/.venv3.10/Lib/sysconfig.py
+++ b/.venv3.10/Lib/sysconfig.py
@@ -5,56 +5,56 @@
from os.path import pardir, realpath
__all__ = [
- 'get_config_h_filename',
- 'get_config_var',
- 'get_config_vars',
- 'get_makefile_filename',
- 'get_path',
- 'get_path_names',
- 'get_paths',
- 'get_platform',
- 'get_python_version',
- 'get_scheme_names',
- 'parse_config_h',
+ "get_config_h_filename",
+ "get_config_var",
+ "get_config_vars",
+ "get_makefile_filename",
+ "get_path",
+ "get_path_names",
+ "get_paths",
+ "get_platform",
+ "get_python_version",
+ "get_scheme_names",
+ "parse_config_h",
]
# Keys for get_config_var() that are never converted to Python integers.
_ALWAYS_STR = {
- 'MACOSX_DEPLOYMENT_TARGET',
+ "MACOSX_DEPLOYMENT_TARGET",
}
_INSTALL_SCHEMES = {
- 'posix_prefix': {
- 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
- 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
- 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
- 'include':
- '{installed_base}/include/python{py_version_short}{abiflags}',
- 'platinclude':
- '{installed_platbase}/include/python{py_version_short}{abiflags}',
- 'scripts': '{base}/bin',
- 'data': '{base}',
+ "posix_prefix": {
+ "stdlib": "{installed_base}/{platlibdir}/python{py_version_short}",
+ "platstdlib": "{platbase}/{platlibdir}/python{py_version_short}",
+ "purelib": "{base}/lib/python{py_version_short}/site-packages",
+ "platlib": "{platbase}/{platlibdir}/python{py_version_short}/site-packages",
+ "include":
+ "{installed_base}/include/python{py_version_short}{abiflags}",
+ "platinclude":
+ "{installed_platbase}/include/python{py_version_short}{abiflags}",
+ "scripts": "{base}/bin",
+ "data": "{base}",
},
- 'posix_home': {
- 'stdlib': '{installed_base}/lib/python',
- 'platstdlib': '{base}/lib/python',
- 'purelib': '{base}/lib/python',
- 'platlib': '{base}/lib/python',
- 'include': '{installed_base}/include/python',
- 'platinclude': '{installed_base}/include/python',
- 'scripts': '{base}/bin',
- 'data': '{base}',
+ "posix_home": {
+ "stdlib": "{installed_base}/lib/python",
+ "platstdlib": "{base}/lib/python",
+ "purelib": "{base}/lib/python",
+ "platlib": "{base}/lib/python",
+ "include": "{installed_base}/include/python",
+ "platinclude": "{installed_base}/include/python",
+ "scripts": "{base}/bin",
+ "data": "{base}",
},
- 'nt': {
- 'stdlib': '{installed_base}/Lib',
- 'platstdlib': '{base}/Lib',
- 'purelib': '{base}/Lib/site-packages',
- 'platlib': '{base}/Lib/site-packages',
- 'include': '{installed_base}/Include',
- 'platinclude': '{installed_base}/Include',
- 'scripts': '{base}/Scripts',
- 'data': '{base}',
+ "nt": {
+ "stdlib": "{installed_base}/Lib",
+ "platstdlib": "{base}/Lib",
+ "purelib": "{base}/Lib/site-packages",
+ "platlib": "{base}/Lib/site-packages",
+ "include": "{installed_base}/Include",
+ "platinclude": "{installed_base}/Include",
+ "scripts": "{base}/Scripts",
+ "data": "{base}",
},
}
@@ -88,41 +88,41 @@ def joinuser(*args):
if _HAS_USER_BASE:
_INSTALL_SCHEMES |= {
# NOTE: When modifying "purelib" scheme, update site._get_path() too.
- 'nt_user': {
- 'stdlib': '{userbase}/Python{py_version_nodot_plat}',
- 'platstdlib': '{userbase}/Python{py_version_nodot_plat}',
- 'purelib': '{userbase}/Python{py_version_nodot_plat}/site-packages',
- 'platlib': '{userbase}/Python{py_version_nodot_plat}/site-packages',
- 'include': '{userbase}/Python{py_version_nodot_plat}/Include',
- 'scripts': '{userbase}/Python{py_version_nodot_plat}/Scripts',
- 'data': '{userbase}',
+ "nt_user": {
+ "stdlib": "{userbase}/Python{py_version_nodot_plat}",
+ "platstdlib": "{userbase}/Python{py_version_nodot_plat}",
+ "purelib": "{userbase}/Python{py_version_nodot_plat}/site-packages",
+ "platlib": "{userbase}/Python{py_version_nodot_plat}/site-packages",
+ "include": "{userbase}/Python{py_version_nodot_plat}/Include",
+ "scripts": "{userbase}/Python{py_version_nodot_plat}/Scripts",
+ "data": "{userbase}",
},
- 'posix_user': {
- 'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
- 'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
- 'include': '{userbase}/include/python{py_version_short}',
- 'scripts': '{userbase}/bin',
- 'data': '{userbase}',
+ "posix_user": {
+ "stdlib": "{userbase}/{platlibdir}/python{py_version_short}",
+ "platstdlib": "{userbase}/{platlibdir}/python{py_version_short}",
+ "purelib": "{userbase}/lib/python{py_version_short}/site-packages",
+ "platlib": "{userbase}/lib/python{py_version_short}/site-packages",
+ "include": "{userbase}/include/python{py_version_short}",
+ "scripts": "{userbase}/bin",
+ "data": "{userbase}",
},
- 'osx_framework_user': {
- 'stdlib': '{userbase}/lib/python',
- 'platstdlib': '{userbase}/lib/python',
- 'purelib': '{userbase}/lib/python/site-packages',
- 'platlib': '{userbase}/lib/python/site-packages',
- 'include': '{userbase}/include/python{py_version_short}',
- 'scripts': '{userbase}/bin',
- 'data': '{userbase}',
+ "osx_framework_user": {
+ "stdlib": "{userbase}/lib/python",
+ "platstdlib": "{userbase}/lib/python",
+ "purelib": "{userbase}/lib/python/site-packages",
+ "platlib": "{userbase}/lib/python/site-packages",
+ "include": "{userbase}/include/python{py_version_short}",
+ "scripts": "{userbase}/bin",
+ "data": "{userbase}",
},
}
-_SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
- 'scripts', 'data')
+_SCHEME_KEYS = ("stdlib", "platstdlib", "purelib", "platlib", "include",
+ "scripts", "data")
_PY_VERSION = sys.version.split()[0]
-_PY_VERSION_SHORT = f'{sys.version_info[0]}.{sys.version_info[1]}'
-_PY_VERSION_SHORT_NO_DOT = f'{sys.version_info[0]}{sys.version_info[1]}'
+_PY_VERSION_SHORT = f"{sys.version_info[0]}.{sys.version_info[1]}"
+_PY_VERSION_SHORT_NO_DOT = f"{sys.version_info[0]}{sys.version_info[1]}"
_PREFIX = os.path.normpath(sys.prefix)
_BASE_PREFIX = os.path.normpath(sys.base_prefix)
_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
@@ -150,8 +150,8 @@ def _safe_realpath(path):
# unable to retrieve the real program name
_PROJECT_BASE = _safe_realpath(os.getcwd())
-if (os.name == 'nt' and
- _PROJECT_BASE.lower().endswith(('\\pcbuild\\win32', '\\pcbuild\\amd64'))):
+if (os.name == "nt" and
+ _PROJECT_BASE.lower().endswith(("\\pcbuild\\win32", "\\pcbuild\\amd64"))):
_PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))
# set for cross builds
@@ -164,9 +164,9 @@ def _is_python_source_dir(d):
return True
return False
-_sys_home = getattr(sys, '_home', None)
+_sys_home = getattr(sys, "_home", None)
-if os.name == 'nt':
+if os.name == "nt":
def _fix_pcbuild(d):
if d and os.path.normcase(d).startswith(
os.path.normcase(os.path.join(_PREFIX, "PCbuild"))):
@@ -183,15 +183,15 @@ def is_python_build(check_home=False):
_PYTHON_BUILD = is_python_build(True)
if _PYTHON_BUILD:
- for scheme in ('posix_prefix', 'posix_home'):
+ for scheme in ("posix_prefix", "posix_home"):
# On POSIX-y platforms, Python will:
# - Build from .h files in 'headers' (which is only added to the
# scheme when building CPython)
# - Install .h files to 'include'
scheme = _INSTALL_SCHEMES[scheme]
- scheme['headers'] = scheme['include']
- scheme['include'] = '{srcdir}/Include'
- scheme['platinclude'] = '{projectbase}/.'
+ scheme["headers"] = scheme["include"]
+ scheme["include"] = "{srcdir}/Include"
+ scheme["platinclude"] = "{projectbase}/."
def _subst_vars(s, local_vars):
@@ -201,7 +201,7 @@ def _subst_vars(s, local_vars):
try:
return s.format(**os.environ)
except KeyError:
- raise AttributeError(f'{var}') from None
+ raise AttributeError(f"{var}") from None
def _extend_dict(target_dict, other_dict):
target_keys = target_dict.keys()
@@ -218,29 +218,29 @@ def _expand_vars(scheme, vars):
_extend_dict(vars, get_config_vars())
for key, value in _INSTALL_SCHEMES[scheme].items():
- if os.name in ('posix', 'nt'):
+ if os.name in ("posix", "nt"):
value = os.path.expanduser(value)
res[key] = os.path.normpath(_subst_vars(value, vars))
return res
def _get_preferred_schemes():
- if os.name == 'nt':
+ if os.name == "nt":
return {
- 'prefix': 'nt',
- 'home': 'posix_home',
- 'user': 'nt_user',
+ "prefix": "nt",
+ "home": "posix_home",
+ "user": "nt_user",
}
- if sys.platform == 'darwin' and sys._framework:
+ if sys.platform == "darwin" and sys._framework:
return {
- 'prefix': 'posix_prefix',
- 'home': 'posix_home',
- 'user': 'osx_framework_user',
+ "prefix": "posix_prefix",
+ "home": "posix_home",
+ "user": "osx_framework_user",
}
return {
- 'prefix': 'posix_prefix',
- 'home': 'posix_home',
- 'user': 'posix_user',
+ "prefix": "posix_prefix",
+ "home": "posix_home",
+ "user": "posix_user",
}
@@ -255,7 +255,7 @@ def get_preferred_scheme(key):
def get_default_scheme():
- return get_preferred_scheme('prefix')
+ return get_preferred_scheme("prefix")
def _parse_makefile(filename, vars=None, keep_unresolved=True):
@@ -277,14 +277,14 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True):
lines = f.readlines()
for line in lines:
- if line.startswith('#') or line.strip() == '':
+ if line.startswith("#") or line.strip() == "":
continue
m = re.match(_variable_rx, line)
if m:
n, v = m.group(1, 2)
v = v.strip()
# `$$' is a literal `$' in make
- tmpv = v.replace('$$', '')
+ tmpv = v.replace("$$", "")
if "$" in tmpv:
notdone[n] = v
@@ -296,7 +296,7 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True):
v = int(v)
except ValueError:
# insert literal `$'
- done[n] = v.replace('$$', '$')
+ done[n] = v.replace("$$", "$")
else:
done[n] = v
@@ -307,7 +307,7 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True):
# be made available without that prefix through sysconfig.
# Special care is needed to ensure that variable expansion works, even
# if the expansion uses the name without a prefix.
- renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')
+ renamed_variables = ("CFLAGS", "LDFLAGS", "CPPFLAGS")
while len(variables) > 0:
for name in tuple(variables):
@@ -331,15 +331,15 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True):
item = os.environ[n]
elif n in renamed_variables:
- if (name.startswith('PY_') and
+ if (name.startswith("PY_") and
name[3:] in renamed_variables):
item = ""
- elif 'PY_' + n in notdone:
+ elif "PY_" + n in notdone:
found = False
else:
- item = str(done['PY_' + n])
+ item = str(done["PY_" + n])
else:
done[n] = item = ""
@@ -360,7 +360,7 @@ def _parse_makefile(filename, vars=None, keep_unresolved=True):
done[name] = value
variables.remove(name)
- if name.startswith('PY_') \
+ if name.startswith("PY_") \
and name[3:] in renamed_variables:
name = name[3:]
@@ -390,20 +390,20 @@ def get_makefile_filename():
"""Return the path of the Makefile."""
if _PYTHON_BUILD:
return os.path.join(_sys_home or _PROJECT_BASE, "Makefile")
- if hasattr(sys, 'abiflags'):
- config_dir_name = f'config-{_PY_VERSION_SHORT}{sys.abiflags}'
+ if hasattr(sys, "abiflags"):
+ config_dir_name = f"config-{_PY_VERSION_SHORT}{sys.abiflags}"
else:
- config_dir_name = 'config'
- if hasattr(sys.implementation, '_multiarch'):
- config_dir_name += f'-{sys.implementation._multiarch}'
- return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile')
+ config_dir_name = "config"
+ if hasattr(sys.implementation, "_multiarch"):
+ config_dir_name += f"-{sys.implementation._multiarch}"
+ return os.path.join(get_path("stdlib"), config_dir_name, "Makefile")
def _get_sysconfigdata_name():
- multiarch = getattr(sys.implementation, '_multiarch', '')
+ multiarch = getattr(sys.implementation, "_multiarch", "")
return os.environ.get(
- '_PYTHON_SYSCONFIGDATA_NAME',
- f'_sysconfigdata_{sys.abiflags}_{sys.platform}_{multiarch}',
+ "_PYTHON_SYSCONFIGDATA_NAME",
+ f"_sysconfigdata_{sys.abiflags}_{sys.platform}_{multiarch}",
)
@@ -434,7 +434,7 @@ def _generate_posix_vars():
# -- these paths are relative to the Python source, but when installed
# the scripts are in another directory.
if _PYTHON_BUILD:
- vars['BLDSHARED'] = vars['LDSHARED']
+ vars["BLDSHARED"] = vars["LDSHARED"]
# There's a chicken-and-egg situation on OS X with regards to the
# _sysconfigdata module after the changes introduced by #15298:
@@ -448,33 +448,33 @@ def _generate_posix_vars():
# This is more than sufficient for ensuring the subsequent call to
# get_platform() succeeds.
name = _get_sysconfigdata_name()
- if 'darwin' in sys.platform:
+ if "darwin" in sys.platform:
import types
module = types.ModuleType(name)
module.build_time_vars = vars
sys.modules[name] = module
- pybuilddir = f'build/lib.{get_platform()}-{_PY_VERSION_SHORT}'
+ pybuilddir = f"build/lib.{get_platform()}-{_PY_VERSION_SHORT}"
if hasattr(sys, "gettotalrefcount"):
- pybuilddir += '-pydebug'
+ pybuilddir += "-pydebug"
os.makedirs(pybuilddir, exist_ok=True)
- destfile = os.path.join(pybuilddir, name + '.py')
+ destfile = os.path.join(pybuilddir, name + ".py")
- with open(destfile, 'w', encoding='utf8') as f:
- f.write('# system configuration generated and used by'
- ' the sysconfig module\n')
- f.write('build_time_vars = ')
+ with open(destfile, "w", encoding="utf8") as f:
+ f.write("# system configuration generated and used by"
+ " the sysconfig module\n")
+ f.write("build_time_vars = ")
pprint.pprint(vars, stream=f)
# Create file used for sys.path fixup -- see Modules/getpath.c
- with open('pybuilddir.txt', 'w', encoding='utf8') as f:
+ with open("pybuilddir.txt", "w", encoding="utf8") as f:
f.write(pybuilddir)
def _init_posix(vars):
"""Initialize the module as appropriate for POSIX systems."""
# _sysconfigdata is generated at build time, see _generate_posix_vars()
name = _get_sysconfigdata_name()
- _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+ _temp = __import__(name, globals(), locals(), ["build_time_vars"], 0)
build_time_vars = _temp.build_time_vars
vars.update(build_time_vars)
@@ -482,14 +482,14 @@ def _init_non_posix(vars):
"""Initialize the module as appropriate for NT"""
# set basic install directories
import _imp
- vars['LIBDEST'] = get_path('stdlib')
- vars['BINLIBDEST'] = get_path('platstdlib')
- vars['INCLUDEPY'] = get_path('include')
- vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0]
- vars['EXE'] = '.exe'
- vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
- vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))
- vars['TZPATH'] = ''
+ vars["LIBDEST"] = get_path("stdlib")
+ vars["BINLIBDEST"] = get_path("platstdlib")
+ vars["INCLUDEPY"] = get_path("include")
+ vars["EXT_SUFFIX"] = _imp.extension_suffixes()[0]
+ vars["EXE"] = ".exe"
+ vars["VERSION"] = _PY_VERSION_SHORT_NO_DOT
+ vars["BINDIR"] = os.path.dirname(_safe_realpath(sys.executable))
+ vars["TZPATH"] = ""
#
# public APIs
@@ -538,8 +538,8 @@ def get_config_h_filename():
else:
inc_dir = _sys_home or _PROJECT_BASE
else:
- inc_dir = get_path('platinclude')
- return os.path.join(inc_dir, 'pyconfig.h')
+ inc_dir = get_path("platinclude")
+ return os.path.join(inc_dir, "pyconfig.h")
def get_scheme_names():
@@ -588,45 +588,45 @@ def get_config_vars(*args):
# Normalized versions of prefix and exec_prefix are handy to have;
# in fact, these are the standard versions used most places in the
# Distutils.
- _CONFIG_VARS['prefix'] = _PREFIX
- _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX
- _CONFIG_VARS['py_version'] = _PY_VERSION
- _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
- _CONFIG_VARS['py_version_nodot'] = _PY_VERSION_SHORT_NO_DOT
- _CONFIG_VARS['installed_base'] = _BASE_PREFIX
- _CONFIG_VARS['base'] = _PREFIX
- _CONFIG_VARS['installed_platbase'] = _BASE_EXEC_PREFIX
- _CONFIG_VARS['platbase'] = _EXEC_PREFIX
- _CONFIG_VARS['projectbase'] = _PROJECT_BASE
- _CONFIG_VARS['platlibdir'] = sys.platlibdir
+ _CONFIG_VARS["prefix"] = _PREFIX
+ _CONFIG_VARS["exec_prefix"] = _EXEC_PREFIX
+ _CONFIG_VARS["py_version"] = _PY_VERSION
+ _CONFIG_VARS["py_version_short"] = _PY_VERSION_SHORT
+ _CONFIG_VARS["py_version_nodot"] = _PY_VERSION_SHORT_NO_DOT
+ _CONFIG_VARS["installed_base"] = _BASE_PREFIX
+ _CONFIG_VARS["base"] = _PREFIX
+ _CONFIG_VARS["installed_platbase"] = _BASE_EXEC_PREFIX
+ _CONFIG_VARS["platbase"] = _EXEC_PREFIX
+ _CONFIG_VARS["projectbase"] = _PROJECT_BASE
+ _CONFIG_VARS["platlibdir"] = sys.platlibdir
try:
- _CONFIG_VARS['abiflags'] = sys.abiflags
+ _CONFIG_VARS["abiflags"] = sys.abiflags
except AttributeError:
# sys.abiflags may not be defined on all platforms.
- _CONFIG_VARS['abiflags'] = ''
+ _CONFIG_VARS["abiflags"] = ""
try:
- _CONFIG_VARS['py_version_nodot_plat'] = sys.winver.replace('.', '')
+ _CONFIG_VARS["py_version_nodot_plat"] = sys.winver.replace(".", "")
except AttributeError:
- _CONFIG_VARS['py_version_nodot_plat'] = ''
+ _CONFIG_VARS["py_version_nodot_plat"] = ""
- if os.name == 'nt':
+ if os.name == "nt":
_init_non_posix(_CONFIG_VARS)
- _CONFIG_VARS['TZPATH'] = os.path.join(_PREFIX, "share", "zoneinfo")
- if os.name == 'posix':
+ _CONFIG_VARS["TZPATH"] = os.path.join(_PREFIX, "share", "zoneinfo")
+ if os.name == "posix":
_init_posix(_CONFIG_VARS)
# For backward compatibility, see issue19555
- SO = _CONFIG_VARS.get('EXT_SUFFIX')
+ SO = _CONFIG_VARS.get("EXT_SUFFIX")
if SO is not None:
- _CONFIG_VARS['SO'] = SO
+ _CONFIG_VARS["SO"] = SO
if _HAS_USER_BASE:
# Setting 'userbase' is done below the call to the
# init function to enable using 'get_config_var' in
# the init-function.
- _CONFIG_VARS['userbase'] = _getuserbase()
+ _CONFIG_VARS["userbase"] = _getuserbase()
# Always convert srcdir to an absolute path
- srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
- if os.name == 'posix':
+ srcdir = _CONFIG_VARS.get("srcdir", _PROJECT_BASE)
+ if os.name == "posix":
if _PYTHON_BUILD:
# If srcdir is a relative path (typically '.' or '..')
# then it should be interpreted relative to the directory
@@ -639,11 +639,11 @@ def get_config_vars(*args):
# directory containing the Makefile since we know it
# exists.
srcdir = os.path.dirname(get_makefile_filename())
- _CONFIG_VARS['srcdir'] = _safe_realpath(srcdir)
+ _CONFIG_VARS["srcdir"] = _safe_realpath(srcdir)
# OS X platforms require special customization to handle
# multi-architecture, multi-os-version installers
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
import _osx_support
_osx_support.customize_config_vars(_CONFIG_VARS)
@@ -662,9 +662,9 @@ def get_config_var(name):
Equivalent to get_config_vars().get(name)
"""
- if name == 'SO':
+ if name == "SO":
import warnings
- warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
+ warnings.warn("SO is deprecated, use EXT_SUFFIX", DeprecationWarning, 2)
return get_config_vars().get(name)
@@ -689,16 +689,16 @@ def get_platform():
For other non-POSIX platforms, currently just returns 'sys.platform'.
"""
- if os.name == 'nt':
- if 'amd64' in sys.version.lower():
- return 'win-amd64'
- if '(arm)' in sys.version.lower():
- return 'win-arm32'
- if '(arm64)' in sys.version.lower():
- return 'win-arm64'
+ if os.name == "nt":
+ if "amd64" in sys.version.lower():
+ return "win-amd64"
+ if "(arm)" in sys.version.lower():
+ return "win-arm32"
+ if "(arm64)" in sys.version.lower():
+ return "win-arm64"
return sys.platform
- if os.name != "posix" or not hasattr(os, 'uname'):
+ if os.name != "posix" or not hasattr(os, "uname"):
# XXX what about the architecture? NT is Intel or Alpha
return sys.platform
@@ -711,9 +711,9 @@ def get_platform():
# Convert the OS name to lowercase, remove '/' characters, and translate
# spaces (for "Power Macintosh")
- osname = osname.lower().replace('/', '')
- machine = machine.replace(' ', '_')
- machine = machine.replace('/', '-')
+ osname = osname.lower().replace("/", "")
+ machine = machine.replace(" ", "_")
+ machine = machine.replace("/", "-")
if osname[:5] == "linux":
# At least on Linux/Intel, 'machine' is the processor --
@@ -736,7 +736,7 @@ def get_platform():
elif osname[:6] == "cygwin":
osname = "cygwin"
import re
- rel_re = re.compile(r'[\d.]+')
+ rel_re = re.compile(r"[\d.]+")
m = rel_re.match(release)
if m:
release = m.group()
@@ -782,23 +782,23 @@ def expand_makefile_vars(s, vars):
def _print_dict(title, data):
for index, (key, value) in enumerate(sorted(data.items())):
if index == 0:
- print(f'{title}: ')
+ print(f"{title}: ")
print(f'\t{key} = "{value}"')
def _main():
"""Display all information sysconfig detains."""
- if '--generate-posix-vars' in sys.argv:
+ if "--generate-posix-vars" in sys.argv:
_generate_posix_vars()
return
print(f'Platform: "{get_platform()}"')
print(f'Python version: "{get_python_version()}"')
print(f'Current installation scheme: "{get_default_scheme()}"')
print()
- _print_dict('Paths', get_paths())
+ _print_dict("Paths", get_paths())
print()
- _print_dict('Variables', get_config_vars())
+ _print_dict("Variables", get_config_vars())
-if __name__ == '__main__':
+if __name__ == "__main__":
_main()
diff --git a/.venv3.10/Lib/tabnanny.py b/.venv3.10/Lib/tabnanny.py
index a47f5a96..6a8238fd 100644
--- a/.venv3.10/Lib/tabnanny.py
+++ b/.venv3.10/Lib/tabnanny.py
@@ -46,9 +46,9 @@ def main():
errprint(msg)
return
for o, a in opts:
- if o == '-q':
+ if o == "-q":
filename_only = filename_only + 1
- if o == '-v':
+ if o == "-v":
verbose = verbose + 1
if not args:
errprint("Usage:", sys.argv[0], "[-v] file_or_directory ...")
@@ -120,7 +120,7 @@ def check(file):
print("offending line: %r" % (line,))
print(nag.get_msg())
else:
- if ' ' in file: file = '"' + file + '"'
+ if " " in file: file = '"' + file + '"'
if filename_only: print(file)
else: print(file, badline, repr(line))
return
@@ -133,7 +133,7 @@ def check(file):
class Whitespace:
# the characters used for space and tab
- S, T = ' \t'
+ S, T = " \t"
# members:
# raw
@@ -270,7 +270,7 @@ def format_witnesses(w):
prefix = "at tab size"
if len(w) > 1:
prefix = prefix + "s"
- return prefix + " " + ', '.join(firsts)
+ return prefix + " " + ", ".join(firsts)
def process_tokens(tokens):
INDENT = tokenize.INDENT
@@ -327,5 +327,5 @@ def process_tokens(tokens):
raise NannyNag(start[0], msg, line)
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/.venv3.10/Lib/tarfile.py b/.venv3.10/Lib/tarfile.py
index 0aa2474b..469800e9 100644
--- a/.venv3.10/Lib/tarfile.py
+++ b/.venv3.10/Lib/tarfile.py
@@ -46,7 +46,6 @@
import struct
import copy
import re
-import warnings
try:
import pwd
@@ -262,10 +261,10 @@ def copyfileobj(src, dst, length=None, exception=OSError, bufsize=None):
return
def _safe_print(s):
- encoding = getattr(sys.stdout, 'encoding', None)
+ encoding = getattr(sys.stdout, "encoding", None)
if encoding is not None:
- s = s.encode(encoding, 'backslashreplace').decode(encoding)
- print(s, end=' ')
+ s = s.encode(encoding, "backslashreplace").decode(encoding)
+ print(s, end=" ")
class TarError(Exception):
@@ -348,7 +347,7 @@ def __init__(self, name, mode, comptype, fileobj, bufsize):
fileobj = _LowLevelFile(name, mode)
self._extfileobj = False
- if comptype == '*':
+ if comptype == "*":
# Enable transparent compression detection for the
# stream interface
fileobj = _StreamProxy(fileobj)
@@ -724,38 +723,38 @@ class FilterError(TarError):
class AbsolutePathError(FilterError):
def __init__(self, tarinfo):
self.tarinfo = tarinfo
- super().__init__(f'member {tarinfo.name!r} has an absolute path')
+ super().__init__(f"member {tarinfo.name!r} has an absolute path")
class OutsideDestinationError(FilterError):
def __init__(self, tarinfo, path):
self.tarinfo = tarinfo
self._path = path
- super().__init__(f'{tarinfo.name!r} would be extracted to {path!r}, '
- + 'which is outside the destination')
+ super().__init__(f"{tarinfo.name!r} would be extracted to {path!r}, "
+ + "which is outside the destination")
class SpecialFileError(FilterError):
def __init__(self, tarinfo):
self.tarinfo = tarinfo
- super().__init__(f'{tarinfo.name!r} is a special file')
+ super().__init__(f"{tarinfo.name!r} is a special file")
class AbsoluteLinkError(FilterError):
def __init__(self, tarinfo):
self.tarinfo = tarinfo
- super().__init__(f'{tarinfo.name!r} is a link to an absolute path')
+ super().__init__(f"{tarinfo.name!r} is a link to an absolute path")
class LinkOutsideDestinationError(FilterError):
def __init__(self, tarinfo, path):
self.tarinfo = tarinfo
self._path = path
- super().__init__(f'{tarinfo.name!r} would link to {path!r}, '
- + 'which is outside the destination')
+ super().__init__(f"{tarinfo.name!r} would link to {path!r}, "
+ + "which is outside the destination")
class LinkFallbackError(FilterError):
def __init__(self, tarinfo, path):
self.tarinfo = tarinfo
self._path = path
- super().__init__(f'link {tarinfo.name!r} would be extracted as a '
- + f'copy of {path!r}, which was rejected')
+ super().__init__(f"link {tarinfo.name!r} would be extracted as a "
+ + f"copy of {path!r}, which was rejected")
# Errors caused by filters -- both "fatal" and "non-fatal" -- that
# we consider to be issues with the argument, rather than a bug in the
@@ -768,8 +767,8 @@ def _get_filtered_attrs(member, dest_path, for_data=True):
dest_path = os.path.realpath(dest_path, strict=os.path.ALLOW_MISSING)
# Strip leading / (tar's directory separator) from filenames.
# Include os.sep (target OS directory separator) as well.
- if name.startswith(('/', os.sep)):
- name = new_attrs['name'] = member.path.lstrip('/' + os.sep)
+ if name.startswith(("/", os.sep)):
+ name = new_attrs["name"] = member.path.lstrip("/" + os.sep)
if os.path.isabs(name):
# Path is absolute even after stripping.
# For example, 'C:/foo' on Windows.
@@ -799,24 +798,24 @@ def _get_filtered_attrs(member, dest_path, for_data=True):
# Reject special files
raise SpecialFileError(member)
if mode != member.mode:
- new_attrs['mode'] = mode
+ new_attrs["mode"] = mode
if for_data:
# Ignore ownership for 'data'
if member.uid is not None:
- new_attrs['uid'] = None
+ new_attrs["uid"] = None
if member.gid is not None:
- new_attrs['gid'] = None
+ new_attrs["gid"] = None
if member.uname is not None:
- new_attrs['uname'] = None
+ new_attrs["uname"] = None
if member.gname is not None:
- new_attrs['gname'] = None
+ new_attrs["gname"] = None
# Check link destination for 'data'
if member.islnk() or member.issym():
if os.path.isabs(member.linkname):
raise AbsoluteLinkError(member)
normalized = os.path.normpath(member.linkname)
if normalized != member.linkname:
- new_attrs['linkname'] = normalized
+ new_attrs["linkname"] = normalized
if member.issym():
target_path = os.path.join(dest_path,
os.path.dirname(name),
@@ -870,27 +869,27 @@ class TarInfo(object):
"""
__slots__ = dict(
- name = 'Name of the archive member.',
- mode = 'Permission bits.',
- uid = 'User ID of the user who originally stored this member.',
- gid = 'Group ID of the user who originally stored this member.',
- size = 'Size in bytes.',
- mtime = 'Time of last modification.',
- chksum = 'Header checksum.',
- type = ('File type. type is usually one of these constants: '
- 'REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, '
- 'CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.'),
- linkname = ('Name of the target file name, which is only present '
- 'in TarInfo objects of type LNKTYPE and SYMTYPE.'),
- uname = 'User name.',
- gname = 'Group name.',
- devmajor = 'Device major number.',
- devminor = 'Device minor number.',
- offset = 'The tar header starts here.',
+ name = "Name of the archive member.",
+ mode = "Permission bits.",
+ uid = "User ID of the user who originally stored this member.",
+ gid = "Group ID of the user who originally stored this member.",
+ size = "Size in bytes.",
+ mtime = "Time of last modification.",
+ chksum = "Header checksum.",
+ type = ("File type. type is usually one of these constants: "
+ "REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, "
+ "CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE."),
+ linkname = ("Name of the target file name, which is only present "
+ "in TarInfo objects of type LNKTYPE and SYMTYPE."),
+ uname = "User name.",
+ gname = "Group name.",
+ devmajor = "Device major number.",
+ devminor = "Device minor number.",
+ offset = "The tar header starts here.",
offset_data = "The file's data starts here.",
- pax_headers = ('A dictionary containing key-value pairs of an '
- 'associated pax extended header.'),
- sparse = 'Sparse member information.',
+ pax_headers = ("A dictionary containing key-value pairs of an "
+ "associated pax extended header."),
+ sparse = "Sparse member information.",
tarfile = None,
_sparse_structs = None,
_link_target = None,
@@ -1584,11 +1583,11 @@ def _apply_pax_info(self, pax_headers, encoding, errors):
"""
for keyword, value in pax_headers.items():
if keyword == "GNU.sparse.name":
- setattr(self, "path", value)
+ self.path = value
elif keyword == "GNU.sparse.size":
- setattr(self, "size", int(value))
+ self.size = int(value)
elif keyword == "GNU.sparse.realsize":
- setattr(self, "size", int(value))
+ self.size = int(value)
elif keyword in PAX_FIELDS:
if keyword in PAX_NUMBER_FIELDS:
try:
@@ -1622,42 +1621,42 @@ def _block(self, count):
return blocks * BLOCKSIZE
def isreg(self):
- 'Return True if the Tarinfo object is a regular file.'
+ "Return True if the Tarinfo object is a regular file."
return self.type in REGULAR_TYPES
def isfile(self):
- 'Return True if the Tarinfo object is a regular file.'
+ "Return True if the Tarinfo object is a regular file."
return self.isreg()
def isdir(self):
- 'Return True if it is a directory.'
+ "Return True if it is a directory."
return self.type == DIRTYPE
def issym(self):
- 'Return True if it is a symbolic link.'
+ "Return True if it is a symbolic link."
return self.type == SYMTYPE
def islnk(self):
- 'Return True if it is a hard link.'
+ "Return True if it is a hard link."
return self.type == LNKTYPE
def ischr(self):
- 'Return True if it is a character device.'
+ "Return True if it is a character device."
return self.type == CHRTYPE
def isblk(self):
- 'Return True if it is a block device.'
+ "Return True if it is a block device."
return self.type == BLKTYPE
def isfifo(self):
- 'Return True if it is a FIFO.'
+ "Return True if it is a FIFO."
return self.type == FIFOTYPE
def issparse(self):
return self.sparse is not None
def isdev(self):
- 'Return True if it is one of character device, block device or FIFO.'
+ "Return True if it is one of character device, block device or FIFO."
return self.type in (CHRTYPE, BLKTYPE, FIFOTYPE)
# class TarInfo
@@ -1843,7 +1842,7 @@ def open(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs):
if mode in ("r", "r:*"):
# Find out which *open() is appropriate for opening the file.
def not_compressed(comptype):
- return cls.OPEN_METH[comptype] == 'taropen'
+ return cls.OPEN_METH[comptype] == "taropen"
error_msgs = []
for comptype in sorted(cls.OPEN_METH, key=not_compressed):
func = getattr(cls, cls.OPEN_METH[comptype])
@@ -1852,11 +1851,11 @@ def not_compressed(comptype):
try:
return func(name, "r", fileobj, **kwargs)
except (ReadError, CompressionError) as e:
- error_msgs.append(f'- method {comptype}: {e!r}')
+ error_msgs.append(f"- method {comptype}: {e!r}")
if fileobj is not None:
fileobj.seek(saved_pos)
continue
- error_msgs_summary = '\n'.join(error_msgs)
+ error_msgs_summary = "\n".join(error_msgs)
raise ReadError(f"file could not be opened successfully:\n{error_msgs_summary}")
elif ":" in mode:
@@ -1918,7 +1917,7 @@ def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
try:
fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
except OSError as e:
- if fileobj is not None and mode == 'r':
+ if fileobj is not None and mode == "r":
raise ReadError("not a gzip file") from e
raise
@@ -1926,7 +1925,7 @@ def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
t = cls.taropen(name, mode, fileobj, **kwargs)
except OSError as e:
fileobj.close()
- if mode == 'r':
+ if mode == "r":
raise ReadError("not a gzip file") from e
raise
except:
@@ -1954,7 +1953,7 @@ def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
t = cls.taropen(name, mode, fileobj, **kwargs)
except (OSError, EOFError) as e:
fileobj.close()
- if mode == 'r':
+ if mode == "r":
raise ReadError("not a bzip2 file") from e
raise
except:
@@ -1982,7 +1981,7 @@ def xzopen(cls, name, mode="r", fileobj=None, preset=None, **kwargs):
t = cls.taropen(name, mode, fileobj, **kwargs)
except (LZMAError, EOFError) as e:
fileobj.close()
- if mode == 'r':
+ if mode == "r":
raise ReadError("not an lzma file") from e
raise
except:
@@ -2029,7 +2028,7 @@ def getmember(self, name):
than once in the archive, its last occurrence is assumed to be the
most up-to-date version.
"""
- tarinfo = self._getmember(name.rstrip('/'))
+ tarinfo = self._getmember(name.rstrip("/"))
if tarinfo is None:
raise KeyError("filename %r not found" % name)
return tarinfo
@@ -2270,9 +2269,9 @@ def _get_filter_function(self, filter):
return fully_trusted_filter
if isinstance(filter, str):
raise TypeError(
- 'String names are not supported for '
- + 'TarFile.extraction_filter. Use a function such as '
- + 'tarfile.data_filter directly.')
+ "String names are not supported for "
+ + "TarFile.extraction_filter. Use a function such as "
+ + "tarfile.data_filter directly.")
return filter
if callable(filter):
return filter
@@ -2331,18 +2330,18 @@ def extractall(self, path=".", members=None, *, numeric_owner=False,
continue
if tarinfo is None:
self._log_no_directory_fixup(unfiltered,
- 'excluded by filter')
+ "excluded by filter")
continue
dirpath = os.path.join(path, tarinfo.name)
try:
lstat = os.lstat(dirpath)
except FileNotFoundError:
- self._log_no_directory_fixup(tarinfo, 'missing')
+ self._log_no_directory_fixup(tarinfo, "missing")
continue
if not stat.S_ISDIR(lstat.st_mode):
# This is no longer a directory; presumably a later
# member overwrote the entry.
- self._log_no_directory_fixup(tarinfo, 'not a directory')
+ self._log_no_directory_fixup(tarinfo, "not a directory")
continue
self.chown(tarinfo, dirpath, numeric_owner=numeric_owner)
self.utime(tarinfo, dirpath)
@@ -2697,7 +2696,7 @@ def utime(self, tarinfo, targetpath):
mtime = tarinfo.mtime
if mtime is None:
return
- if not hasattr(os, 'utime'):
+ if not hasattr(os, "utime"):
return
try:
os.utime(targetpath, (mtime, mtime))
@@ -2751,7 +2750,7 @@ def next(self):
try:
import zlib
if isinstance(e, zlib.error):
- raise ReadError(f'zlib error: {e}') from None
+ raise ReadError(f"zlib error: {e}") from None
else:
raise e
except ImportError:
@@ -2923,49 +2922,49 @@ def is_tarfile(name):
def main():
import argparse
- description = 'A simple command-line interface for tarfile module.'
+ description = "A simple command-line interface for tarfile module."
parser = argparse.ArgumentParser(description=description)
- parser.add_argument('-v', '--verbose', action='store_true', default=False,
- help='Verbose output')
- parser.add_argument('--filter', metavar='',
+ parser.add_argument("-v", "--verbose", action="store_true", default=False,
+ help="Verbose output")
+ parser.add_argument("--filter", metavar="",
choices=_NAMED_FILTERS,
- help='Filter for extraction')
+ help="Filter for extraction")
group = parser.add_mutually_exclusive_group(required=True)
- group.add_argument('-l', '--list', metavar='',
- help='Show listing of a tarfile')
- group.add_argument('-e', '--extract', nargs='+',
- metavar=('', ''),
- help='Extract tarfile into target dir')
- group.add_argument('-c', '--create', nargs='+',
- metavar=('', ''),
- help='Create tarfile from sources')
- group.add_argument('-t', '--test', metavar='',
- help='Test if a tarfile is valid')
+ group.add_argument("-l", "--list", metavar="",
+ help="Show listing of a tarfile")
+ group.add_argument("-e", "--extract", nargs="+",
+ metavar=("", ""),
+ help="Extract tarfile into target dir")
+ group.add_argument("-c", "--create", nargs="+",
+ metavar=("", ""),
+ help="Create tarfile from sources")
+ group.add_argument("-t", "--test", metavar="",
+ help="Test if a tarfile is valid")
args = parser.parse_args()
if args.filter and args.extract is None:
- parser.exit(1, '--filter is only valid for extraction\n')
+ parser.exit(1, "--filter is only valid for extraction\n")
if args.test is not None:
src = args.test
if is_tarfile(src):
- with open(src, 'r') as tar:
+ with open(src, "r") as tar:
tar.getmembers()
print(tar.getmembers(), file=sys.stderr)
if args.verbose:
- print('{!r} is a tar archive.'.format(src))
+ print("{!r} is a tar archive.".format(src))
else:
- parser.exit(1, '{!r} is not a tar archive.\n'.format(src))
+ parser.exit(1, "{!r} is not a tar archive.\n".format(src))
elif args.list is not None:
src = args.list
if is_tarfile(src):
- with TarFile.open(src, 'r:*') as tf:
+ with TarFile.open(src, "r:*") as tf:
tf.list(verbose=args.verbose)
else:
- parser.exit(1, '{!r} is not a tar archive.\n'.format(src))
+ parser.exit(1, "{!r} is not a tar archive.\n".format(src))
elif args.extract is not None:
if len(args.extract) == 1:
@@ -2977,35 +2976,35 @@ def main():
parser.exit(1, parser.format_help())
if is_tarfile(src):
- with TarFile.open(src, 'r:*') as tf:
+ with TarFile.open(src, "r:*") as tf:
tf.extractall(path=curdir, filter=args.filter)
if args.verbose:
- if curdir == '.':
- msg = '{!r} file is extracted.'.format(src)
+ if curdir == ".":
+ msg = "{!r} file is extracted.".format(src)
else:
- msg = ('{!r} file is extracted '
- 'into {!r} directory.').format(src, curdir)
+ msg = ("{!r} file is extracted "
+ "into {!r} directory.").format(src, curdir)
print(msg)
else:
- parser.exit(1, '{!r} is not a tar archive.\n'.format(src))
+ parser.exit(1, "{!r} is not a tar archive.\n".format(src))
elif args.create is not None:
tar_name = args.create.pop(0)
_, ext = os.path.splitext(tar_name)
compressions = {
# gz
- '.gz': 'gz',
- '.tgz': 'gz',
+ ".gz": "gz",
+ ".tgz": "gz",
# xz
- '.xz': 'xz',
- '.txz': 'xz',
+ ".xz": "xz",
+ ".txz": "xz",
# bz2
- '.bz2': 'bz2',
- '.tbz': 'bz2',
- '.tbz2': 'bz2',
- '.tb2': 'bz2',
+ ".bz2": "bz2",
+ ".tbz": "bz2",
+ ".tbz2": "bz2",
+ ".tb2": "bz2",
}
- tar_mode = 'w:' + compressions[ext] if ext in compressions else 'w'
+ tar_mode = "w:" + compressions[ext] if ext in compressions else "w"
tar_files = args.create
with TarFile.open(tar_name, tar_mode) as tf:
@@ -3013,7 +3012,7 @@ def main():
tf.add(file_name)
if args.verbose:
- print('{!r} file created.'.format(tar_name))
+ print("{!r} file created.".format(tar_name))
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/.venv3.10/Lib/telnetlib.py b/.venv3.10/Lib/telnetlib.py
index 8ce053e8..a5f2a728 100644
--- a/.venv3.10/Lib/telnetlib.py
+++ b/.venv3.10/Lib/telnetlib.py
@@ -132,7 +132,7 @@
# poll/select have the advantage of not requiring any extra file descriptor,
# contrarily to epoll/kqueue (also, they require a single syscall).
-if hasattr(selectors, 'PollSelector'):
+if hasattr(selectors, "PollSelector"):
_TelnetSelector = selectors.PollSelector
else:
_TelnetSelector = selectors.SelectSelector
@@ -206,13 +206,13 @@ def __init__(self, host=None, port=0,
self.port = port
self.timeout = timeout
self.sock = None
- self.rawq = b''
+ self.rawq = b""
self.irawq = 0
- self.cookedq = b''
+ self.cookedq = b""
self.eof = 0
- self.iacseq = b'' # Buffer for IAC sequence.
+ self.iacseq = b"" # Buffer for IAC sequence.
self.sb = 0 # flag for SB and SE sequence.
- self.sbdataq = b''
+ self.sbdataq = b""
self.option_callback = None
if host is not None:
self.open(host, port, timeout)
@@ -246,7 +246,7 @@ def msg(self, msg, *args):
"""
if self.debuglevel > 0:
- print('Telnet(%s,%s):' % (self.host, self.port), end=' ')
+ print("Telnet(%s,%s):" % (self.host, self.port), end=" ")
if args:
print(msg % args)
else:
@@ -265,7 +265,7 @@ def close(self):
sock = self.sock
self.sock = None
self.eof = True
- self.iacseq = b''
+ self.iacseq = b""
self.sb = 0
if sock:
sock.close()
@@ -335,7 +335,7 @@ def read_all(self):
self.fill_rawq()
self.process_rawq()
buf = self.cookedq
- self.cookedq = b''
+ self.cookedq = b""
return buf
def read_some(self):
@@ -350,7 +350,7 @@ def read_some(self):
self.fill_rawq()
self.process_rawq()
buf = self.cookedq
- self.cookedq = b''
+ self.cookedq = b""
return buf
def read_very_eager(self):
@@ -400,9 +400,9 @@ def read_very_lazy(self):
"""
buf = self.cookedq
- self.cookedq = b''
+ self.cookedq = b""
if not buf and self.eof and not self.rawq:
- raise EOFError('telnet connection closed')
+ raise EOFError("telnet connection closed")
return buf
def read_sb_data(self):
@@ -414,7 +414,7 @@ def read_sb_data(self):
"""
buf = self.sbdataq
- self.sbdataq = b''
+ self.sbdataq = b""
return buf
def set_option_negotiation_callback(self, callback):
@@ -428,7 +428,7 @@ def process_rawq(self):
the midst of an IAC sequence.
"""
- buf = [b'', b'']
+ buf = [b"", b""]
try:
while self.rawq:
c = self.rawq_getchar()
@@ -448,17 +448,17 @@ def process_rawq(self):
self.iacseq += c
continue
- self.iacseq = b''
+ self.iacseq = b""
if c == IAC:
buf[self.sb] = buf[self.sb] + c
else:
if c == SB: # SB ... SE start.
self.sb = 1
- self.sbdataq = b''
+ self.sbdataq = b""
elif c == SE:
self.sb = 0
self.sbdataq = self.sbdataq + buf[1]
- buf[1] = b''
+ buf[1] = b""
if self.option_callback:
# Callback is supposed to look into
# the sbdataq
@@ -467,27 +467,27 @@ def process_rawq(self):
# We can't offer automatic processing of
# suboptions. Alas, we should not get any
# unless we did a WILL/DO before.
- self.msg('IAC %d not recognized' % ord(c))
+ self.msg("IAC %d not recognized" % ord(c))
elif len(self.iacseq) == 2:
cmd = self.iacseq[1:2]
- self.iacseq = b''
+ self.iacseq = b""
opt = c
if cmd in (DO, DONT):
- self.msg('IAC %s %d',
- cmd == DO and 'DO' or 'DONT', ord(opt))
+ self.msg("IAC %s %d",
+ cmd == DO and "DO" or "DONT", ord(opt))
if self.option_callback:
self.option_callback(self.sock, cmd, opt)
else:
self.sock.sendall(IAC + WONT + opt)
elif cmd in (WILL, WONT):
- self.msg('IAC %s %d',
- cmd == WILL and 'WILL' or 'WONT', ord(opt))
+ self.msg("IAC %s %d",
+ cmd == WILL and "WILL" or "WONT", ord(opt))
if self.option_callback:
self.option_callback(self.sock, cmd, opt)
else:
self.sock.sendall(IAC + DONT + opt)
except EOFError: # raised by self.rawq_getchar()
- self.iacseq = b'' # Reset on EOF
+ self.iacseq = b"" # Reset on EOF
self.sb = 0
pass
self.cookedq = self.cookedq + buf[0]
@@ -507,7 +507,7 @@ def rawq_getchar(self):
c = self.rawq[self.irawq:self.irawq+1]
self.irawq = self.irawq + 1
if self.irawq >= len(self.rawq):
- self.rawq = b''
+ self.rawq = b""
self.irawq = 0
return c
@@ -519,7 +519,7 @@ def fill_rawq(self):
"""
if self.irawq >= len(self.rawq):
- self.rawq = b''
+ self.rawq = b""
self.irawq = 0
# The buffer size should be fairly small so as to avoid quadratic
# behavior in process_rawq() above
@@ -549,13 +549,13 @@ def interact(self):
try:
text = self.read_eager()
except EOFError:
- print('*** Connection closed by remote host ***')
+ print("*** Connection closed by remote host ***")
return
if text:
- sys.stdout.write(text.decode('ascii'))
+ sys.stdout.write(text.decode("ascii"))
sys.stdout.flush()
elif key.fileobj is sys.stdin:
- line = sys.stdin.readline().encode('ascii')
+ line = sys.stdin.readline().encode("ascii")
if not line:
return
self.write(line)
@@ -568,7 +568,7 @@ def mt_interact(self):
line = sys.stdin.readline()
if not line:
break
- self.write(line.encode('ascii'))
+ self.write(line.encode("ascii"))
def listener(self):
"""Helper for mt_interact() -- this executes in the other thread."""
@@ -576,10 +576,10 @@ def listener(self):
try:
data = self.read_eager()
except EOFError:
- print('*** Connection closed by remote host ***')
+ print("*** Connection closed by remote host ***")
return
if data:
- sys.stdout.write(data.decode('ascii'))
+ sys.stdout.write(data.decode("ascii"))
else:
sys.stdout.flush()
@@ -655,10 +655,10 @@ def test():
"""
debuglevel = 0
- while sys.argv[1:] and sys.argv[1] == '-d':
+ while sys.argv[1:] and sys.argv[1] == "-d":
debuglevel = debuglevel+1
del sys.argv[1]
- host = 'localhost'
+ host = "localhost"
if sys.argv[1:]:
host = sys.argv[1]
port = 0
@@ -667,11 +667,11 @@ def test():
try:
port = int(portstr)
except ValueError:
- port = socket.getservbyname(portstr, 'tcp')
+ port = socket.getservbyname(portstr, "tcp")
with Telnet() as tn:
tn.set_debuglevel(debuglevel)
tn.open(host, port, timeout=0.5)
tn.interact()
-if __name__ == '__main__':
+if __name__ == "__main__":
test()
diff --git a/.venv3.10/Lib/tempfile.py b/.venv3.10/Lib/tempfile.py
index fd78998d..126e8b13 100644
--- a/.venv3.10/Lib/tempfile.py
+++ b/.venv3.10/Lib/tempfile.py
@@ -50,14 +50,14 @@
_allocate_lock = _thread.allocate_lock
_text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
-if hasattr(_os, 'O_NOFOLLOW'):
+if hasattr(_os, "O_NOFOLLOW"):
_text_openflags |= _os.O_NOFOLLOW
_bin_openflags = _text_openflags
-if hasattr(_os, 'O_BINARY'):
+if hasattr(_os, "O_BINARY"):
_bin_openflags |= _os.O_BINARY
-if hasattr(_os, 'TMP_MAX'):
+if hasattr(_os, "TMP_MAX"):
TMP_MAX = _os.TMP_MAX
else:
TMP_MAX = 10000
@@ -142,7 +142,7 @@ class _RandomNameSequence:
@property
def rng(self):
cur_pid = _os.getpid()
- if cur_pid != getattr(self, '_rng_pid', None):
+ if cur_pid != getattr(self, "_rng_pid", None):
self._rng = _Random()
self._rng_pid = cur_pid
return self._rng
@@ -151,7 +151,7 @@ def __iter__(self):
return self
def __next__(self):
- return ''.join(self.rng.choices(self.characters, k=8))
+ return "".join(self.rng.choices(self.characters, k=8))
def _candidate_tempdir_list():
"""Generate a list of candidate temporary directories which
@@ -160,17 +160,17 @@ def _candidate_tempdir_list():
dirlist = []
# First, try the environment.
- for envname in 'TMPDIR', 'TEMP', 'TMP':
+ for envname in "TMPDIR", "TEMP", "TMP":
dirname = _os.getenv(envname)
if dirname: dirlist.append(dirname)
# Failing that, try OS-specific locations.
- if _os.name == 'nt':
- dirlist.extend([ _os.path.expanduser(r'~\AppData\Local\Temp'),
- _os.path.expandvars(r'%SYSTEMROOT%\Temp'),
- r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
+ if _os.name == "nt":
+ dirlist.extend([ _os.path.expanduser(r"~\AppData\Local\Temp"),
+ _os.path.expandvars(r"%SYSTEMROOT%\Temp"),
+ r"c:\temp", r"c:\tmp", r"\temp", r"\tmp" ])
else:
- dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])
+ dirlist.extend([ "/tmp", "/var/tmp", "/usr/tmp" ])
# As a last resort, the current directory.
try:
@@ -203,7 +203,7 @@ def _get_default_tempdir():
fd = _os.open(filename, _bin_openflags, 0o600)
try:
try:
- _os.write(fd, b'blat')
+ _os.write(fd, b"blat")
finally:
_os.close(fd)
finally:
@@ -214,7 +214,7 @@ def _get_default_tempdir():
except PermissionError:
# This exception is thrown when a directory with the chosen name
# already exists on windows.
- if (_os.name == 'nt' and _os.path.isdir(dir) and
+ if (_os.name == "nt" and _os.path.isdir(dir) and
_os.access(dir, _os.W_OK)):
continue
break # no point trying more names in this directory
@@ -259,7 +259,7 @@ def _mkstemp_inner(dir, pre, suf, flags, output_type):
except PermissionError:
# This exception is thrown when a directory with the chosen name
# already exists on windows.
- if (_os.name == 'nt' and _os.path.isdir(dir) and
+ if (_os.name == "nt" and _os.path.isdir(dir) and
_os.access(dir, _os.W_OK)):
continue
else:
@@ -273,7 +273,7 @@ def _dont_follow_symlinks(func, path, *args):
# Pass follow_symlinks=False, unless not supported on this platform.
if func in _os.supports_follow_symlinks:
func(path, *args, follow_symlinks=False)
- elif _os.name == 'nt' or not _os.path.islink(path):
+ elif _os.name == "nt" or not _os.path.islink(path):
func(path, *args)
def _resetperms(path):
@@ -387,7 +387,7 @@ def mkdtemp(suffix=None, prefix=None, dir=None):
except PermissionError:
# This exception is thrown when a directory with the chosen name
# already exists on windows.
- if (_os.name == 'nt' and _os.path.isdir(dir) and
+ if (_os.name == "nt" and _os.path.isdir(dir) and
_os.access(dir, _os.W_OK)):
continue
else:
@@ -445,7 +445,7 @@ def __init__(self, file, name, delete=True):
# NT provides delete-on-close as a primitive, so we don't need
# the wrapper to do anything special. We still use it so that
# file.name is useful (i.e. not "(fdopen)") with NamedTemporaryFile.
- if _os.name != 'nt':
+ if _os.name != "nt":
# Cache the unlinker so we don't get spurious errors at
# shutdown when the module-level "os" is None'd out. Note
# that this must be referenced as self.unlink, because the
@@ -490,9 +490,9 @@ def __getattr__(self, name):
# Attribute lookups are delegated to the underlying file
# and cached for non-numeric results
# (i.e. methods are cached, closed and friends are not)
- file = self.__dict__['file']
+ file = self.__dict__["file"]
a = getattr(file, name)
- if hasattr(a, '__call__'):
+ if hasattr(a, "__call__"):
func = a
@_functools.wraps(func)
def func_wrapper(*args, **kwargs):
@@ -535,7 +535,7 @@ def __iter__(self):
yield line
-def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
+def NamedTemporaryFile(mode="w+b", buffering=-1, encoding=None,
newline=None, suffix=None, prefix=None,
dir=None, delete=True, *, errors=None):
"""Create and return a temporary file.
@@ -560,7 +560,7 @@ def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
# Setting O_TEMPORARY in the flags causes the OS to delete
# the file when it is closed. This is only supported by Windows.
- if _os.name == 'nt' and delete:
+ if _os.name == "nt" and delete:
flags |= _os.O_TEMPORARY
if "b" not in mode:
@@ -576,19 +576,19 @@ def opener(*args):
newline=newline, encoding=encoding, errors=errors,
opener=opener)
try:
- raw = getattr(file, 'buffer', file)
- raw = getattr(raw, 'raw', raw)
+ raw = getattr(file, "buffer", file)
+ raw = getattr(raw, "raw", raw)
raw.name = name
return _TemporaryFileWrapper(file, name, delete)
except:
file.close()
raise
except:
- if name is not None and not (_os.name == 'nt' and delete):
+ if name is not None and not (_os.name == "nt" and delete):
_os.unlink(name)
raise
-if _os.name != 'posix' or _sys.platform == 'cygwin':
+if _os.name != "posix" or _sys.platform == "cygwin":
# On non-POSIX and Cygwin systems, assume that we cannot unlink a file
# while it is open.
TemporaryFile = NamedTemporaryFile
@@ -597,9 +597,9 @@ def opener(*args):
# Is the O_TMPFILE flag available and does it work?
# The flag is set to False if os.open(dir, os.O_TMPFILE) raises an
# IsADirectoryError exception
- _O_TMPFILE_WORKS = hasattr(_os, 'O_TMPFILE')
+ _O_TMPFILE_WORKS = hasattr(_os, "O_TMPFILE")
- def TemporaryFile(mode='w+b', buffering=-1, encoding=None,
+ def TemporaryFile(mode="w+b", buffering=-1, encoding=None,
newline=None, suffix=None, prefix=None,
dir=None, *, errors=None):
"""Create and return a temporary file.
@@ -634,8 +634,8 @@ def opener(*args):
file = _io.open(dir, mode, buffering=buffering,
newline=newline, encoding=encoding,
errors=errors, opener=opener)
- raw = getattr(file, 'buffer', file)
- raw = getattr(raw, 'raw', raw)
+ raw = getattr(file, "buffer", file)
+ raw = getattr(raw, "raw", raw)
raw.name = fd
return file
except IsADirectoryError:
@@ -662,15 +662,15 @@ def opener(*args):
fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
try:
_os.unlink(name)
- except BaseException as e:
+ except BaseException:
_os.close(fd)
raise
return fd
file = _io.open(dir, mode, buffering=buffering,
newline=newline, encoding=encoding, errors=errors,
opener=opener)
- raw = getattr(file, 'buffer', file)
- raw = getattr(raw, 'raw', raw)
+ raw = getattr(file, "buffer", file)
+ raw = getattr(raw, "raw", raw)
raw.name = fd
return file
@@ -681,10 +681,10 @@ class SpooledTemporaryFile:
"""
_rolled = False
- def __init__(self, max_size=0, mode='w+b', buffering=-1,
+ def __init__(self, max_size=0, mode="w+b", buffering=-1,
encoding=None, newline=None,
suffix=None, prefix=None, dir=None, *, errors=None):
- if 'b' in mode:
+ if "b" in mode:
self._file = _io.BytesIO()
else:
encoding = _io.text_encoding(encoding)
@@ -693,10 +693,10 @@ def __init__(self, max_size=0, mode='w+b', buffering=-1,
newline=newline)
self._max_size = max_size
self._rolled = False
- self._TemporaryFileArgs = {'mode': mode, 'buffering': buffering,
- 'suffix': suffix, 'prefix': prefix,
- 'encoding': encoding, 'newline': newline,
- 'dir': dir, 'errors': errors}
+ self._TemporaryFileArgs = {"mode": mode, "buffering": buffering,
+ "suffix": suffix, "prefix": prefix,
+ "encoding": encoding, "newline": newline,
+ "dir": dir, "errors": errors}
__class_getitem__ = classmethod(_types.GenericAlias)
@@ -713,7 +713,7 @@ def rollover(self):
del self._TemporaryFileArgs
pos = file.tell()
- if hasattr(newfile, 'buffer'):
+ if hasattr(newfile, "buffer"):
newfile.buffer.write(file.detach().getvalue())
else:
newfile.write(file.getvalue())
@@ -769,7 +769,7 @@ def mode(self):
try:
return self._file.mode
except AttributeError:
- return self._TemporaryFileArgs['mode']
+ return self._TemporaryFileArgs["mode"]
@property
def name(self):
diff --git a/.venv3.10/Lib/test/support/__init__.py b/.venv3.10/Lib/test/support/__init__.py
index 0d3b9634..a2154b22 100644
--- a/.venv3.10/Lib/test/support/__init__.py
+++ b/.venv3.10/Lib/test/support/__init__.py
@@ -1,7 +1,7 @@
"""Supporting definitions for the Python regression tests."""
-if __name__ != 'test.support':
- raise ImportError('support must be imported from the test package')
+if __name__ != "test.support":
+ raise ImportError("support must be imported from the test package")
import contextlib
import functools
@@ -68,11 +68,11 @@
# The timeout should be long enough for connect(), recv() and send() methods
# of socket.socket.
LOOPBACK_TIMEOUT = 5.0
-if sys.platform == 'win32' and ' 32 bit (ARM)' in sys.version:
+if sys.platform == "win32" and " 32 bit (ARM)" in sys.version:
# bpo-37553: test_socket.SendfileUsingSendTest is taking longer than 2
# seconds on Windows ARM32 buildbot
LOOPBACK_TIMEOUT = 10
-elif sys.platform == 'vxworks':
+elif sys.platform == "vxworks":
LOOPBACK_TIMEOUT = 10
# Timeout in seconds for network requests going to the internet. The timeout is
@@ -192,21 +192,21 @@ def _force_run(path, func, *args):
return func(*args)
except OSError as err:
if verbose >= 2:
- print('%s: %s' % (err.__class__.__name__, err))
- print('re-run %s%r' % (func.__name__, args))
+ print("%s: %s" % (err.__class__.__name__, err))
+ print("re-run %s%r" % (func.__name__, args))
os.chmod(path, stat.S_IRWXU)
return func(*args)
# Check whether a gui is actually available
def _is_gui_available():
- if hasattr(_is_gui_available, 'result'):
+ if hasattr(_is_gui_available, "result"):
return _is_gui_available.result
import platform
reason = None
- if sys.platform.startswith('win') and platform.win32_is_iot():
+ if sys.platform.startswith("win") and platform.win32_is_iot():
reason = "gui is not available on Windows IoT Core"
- elif sys.platform.startswith('win'):
+ elif sys.platform.startswith("win"):
# if Python is running as a service (such as the buildbot service),
# gui interaction may be disallowed
import ctypes
@@ -232,7 +232,7 @@ class USEROBJECTFLAGS(ctypes.Structure):
raise ctypes.WinError()
if not bool(uof.dwFlags & WSF_VISIBLE):
reason = "gui not available (WSF_VISIBLE flag not set)"
- elif sys.platform == 'darwin':
+ elif sys.platform == "darwin":
# The Aqua Tk implementations on OS X can abort the process if
# being called in an environment where a window server connection
# cannot be made, for instance when invoked by a buildbot or ssh
@@ -267,8 +267,8 @@ class ProcessSerialNumber(Structure):
except Exception as e:
err_string = str(e)
if len(err_string) > 50:
- err_string = err_string[:50] + ' [...]'
- reason = 'Tk unavailable due to {}: {}'.format(type(e).__name__,
+ err_string = err_string[:50] + " [...]"
+ reason = "Tk unavailable due to {}: {}".format(type(e).__name__,
err_string)
_is_gui_available.reason = reason
@@ -290,16 +290,16 @@ def requires(resource, msg=None):
if msg is None:
msg = "Use of the %r resource not enabled" % resource
raise ResourceDenied(msg)
- if resource == 'gui' and not _is_gui_available():
+ if resource == "gui" and not _is_gui_available():
raise ResourceDenied(_is_gui_available.reason)
def _get_kernel_version(sysname="Linux"):
import platform
if platform.system() != sysname:
return None
- version_txt = platform.release().split('-', 1)[0]
+ version_txt = platform.release().split("-", 1)[0]
try:
- return tuple(map(int, version_txt.split('.')))
+ return tuple(map(int, version_txt.split(".")))
except ValueError:
return None
@@ -311,11 +311,11 @@ def _requires_unix_version(sysname, min_version):
the FreeBSD version is less than 7.2.
"""
import platform
- min_version_txt = '.'.join(map(str, min_version))
- version_txt = platform.release().split('-', 1)[0]
+ min_version_txt = ".".join(map(str, min_version))
+ version_txt = platform.release().split("-", 1)[0]
if platform.system() == sysname:
try:
- version = tuple(map(int, version_txt.split('.')))
+ version = tuple(map(int, version_txt.split(".")))
except ValueError:
skip = False
else:
@@ -337,7 +337,7 @@ def requires_freebsd_version(*min_version):
For example, @requires_freebsd_version(7, 2) raises SkipTest if the FreeBSD
version is less than 7.2.
"""
- return _requires_unix_version('FreeBSD', min_version)
+ return _requires_unix_version("FreeBSD", min_version)
def requires_linux_version(*min_version):
"""Decorator raising SkipTest if the OS is Linux and the Linux version is
@@ -346,7 +346,7 @@ def requires_linux_version(*min_version):
For example, @requires_linux_version(2, 6, 32) raises SkipTest if the Linux
version is less than 2.6.32.
"""
- return _requires_unix_version('Linux', min_version)
+ return _requires_unix_version("Linux", min_version)
def requires_mac_ver(*min_version):
"""Decorator raising SkipTest if the OS is Mac OS X and the OS X
@@ -358,16 +358,16 @@ def requires_mac_ver(*min_version):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
import platform
version_txt = platform.mac_ver()[0]
try:
- version = tuple(map(int, version_txt.split('.')))
+ version = tuple(map(int, version_txt.split(".")))
except ValueError:
pass
else:
if version < min_version:
- min_version_txt = '.'.join(map(str, min_version))
+ min_version_txt = ".".join(map(str, min_version))
raise unittest.SkipTest(
"Mac OS X %s or higher required, not %s"
% (min_version_txt, version_txt))
@@ -380,22 +380,22 @@ def wrapper(*args, **kw):
def check_sanitizer(*, address=False, memory=False, ub=False):
"""Returns True if Python is compiled with sanitizer support"""
if not (address or memory or ub):
- raise ValueError('At least one of address, memory, or ub must be True')
+ raise ValueError("At least one of address, memory, or ub must be True")
- _cflags = sysconfig.get_config_var('CFLAGS') or ''
- _config_args = sysconfig.get_config_var('CONFIG_ARGS') or ''
+ _cflags = sysconfig.get_config_var("CFLAGS") or ""
+ _config_args = sysconfig.get_config_var("CONFIG_ARGS") or ""
memory_sanitizer = (
- '-fsanitize=memory' in _cflags or
- '--with-memory-sanitizer' in _config_args
+ "-fsanitize=memory" in _cflags or
+ "--with-memory-sanitizer" in _config_args
)
address_sanitizer = (
- '-fsanitize=address' in _cflags or
- '--with-memory-sanitizer' in _config_args
+ "-fsanitize=address" in _cflags or
+ "--with-memory-sanitizer" in _config_args
)
ub_sanitizer = (
- '-fsanitize=undefined' in _cflags or
- '--with-undefined-behavior-sanitizer' in _config_args
+ "-fsanitize=undefined" in _cflags or
+ "--with-undefined-behavior-sanitizer" in _config_args
)
return (
(memory and memory_sanitizer) or
@@ -407,7 +407,7 @@ def check_sanitizer(*, address=False, memory=False, ub=False):
def skip_if_sanitizer(reason=None, *, address=False, memory=False, ub=False):
"""Decorator raising SkipTest if running with a sanitizer active."""
if not reason:
- reason = 'not working with sanitizers active'
+ reason = "not working with sanitizers active"
skip = check_sanitizer(address=address, memory=memory, ub=ub)
return unittest.skipIf(skip, reason)
@@ -444,28 +444,28 @@ def dec(*args, **kwargs):
float.__getformat__("double").startswith("IEEE"),
"test requires IEEE 754 doubles")
-def requires_zlib(reason='requires zlib'):
+def requires_zlib(reason="requires zlib"):
try:
import zlib
except ImportError:
zlib = None
return unittest.skipUnless(zlib, reason)
-def requires_gzip(reason='requires gzip'):
+def requires_gzip(reason="requires gzip"):
try:
import gzip
except ImportError:
gzip = None
return unittest.skipUnless(gzip, reason)
-def requires_bz2(reason='requires bz2'):
+def requires_bz2(reason="requires bz2"):
try:
import bz2
except ImportError:
bz2 = None
return unittest.skipUnless(bz2, reason)
-def requires_lzma(reason='requires lzma'):
+def requires_lzma(reason="requires lzma"):
try:
import lzma
except ImportError:
@@ -473,14 +473,14 @@ def requires_lzma(reason='requires lzma'):
return unittest.skipUnless(lzma, reason)
requires_legacy_unicode_capi = unittest.skipUnless(unicode_legacy_string,
- 'requires legacy Unicode C API')
+ "requires legacy Unicode C API")
-is_jython = sys.platform.startswith('java')
+is_jython = sys.platform.startswith("java")
-is_android = hasattr(sys, 'getandroidapilevel')
+is_android = hasattr(sys, "getandroidapilevel")
-if sys.platform not in ('win32', 'vxworks'):
- unix_shell = '/system/bin/sh' if is_android else '/bin/sh'
+if sys.platform not in ("win32", "vxworks"):
+ unix_shell = "/system/bin/sh" if is_android else "/bin/sh"
else:
unix_shell = None
@@ -508,19 +508,19 @@ def requires_lzma(reason='requires lzma'):
def darwin_malloc_err_warning(test_name):
"""Assure user that loud errors generated by macOS libc's malloc are
expected."""
- if sys.platform != 'darwin':
+ if sys.platform != "darwin":
return
import shutil
- msg = ' NOTICE '
+ msg = " NOTICE "
detail = (f'{test_name} may generate "malloc can\'t allocate region"\n'
'warnings on macOS systems. This behavior is known. Do not\n'
'report a bug unless tests are also failing. See bpo-40928.')
padding, _ = shutil.get_terminal_size()
- print(msg.center(padding, '-'))
+ print(msg.center(padding, "-"))
print(detail)
- print('-' * padding)
+ print("-" * padding)
def findfile(filename, subdir=None):
@@ -549,9 +549,9 @@ def sortdict(dict):
withcommas = ", ".join(reprpairs)
return "{%s}" % withcommas
-def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=None):
+def check_syntax_error(testcase, statement, errtext="", *, lineno=None, offset=None):
with testcase.assertRaisesRegex(SyntaxError, errtext) as cm:
- compile(statement, '', 'exec')
+ compile(statement, "", "exec")
err = cm.exception
testcase.assertIsNotNone(err.lineno)
if lineno is not None:
@@ -562,16 +562,17 @@ def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=N
def open_urlresource(url, *args, **kw):
- import urllib.request, urllib.parse
+ import urllib.request
+ import urllib.parse
from .os_helper import unlink
try:
import gzip
except ImportError:
gzip = None
- check = kw.pop('check', None)
+ check = kw.pop("check", None)
- filename = urllib.parse.urlparse(url)[2].split('/')[-1] # '/': it's URL!
+ filename = urllib.parse.urlparse(url)[2].split("/")[-1] # '/': it's URL!
fn = os.path.join(TEST_DATA_DIR, filename)
@@ -591,15 +592,15 @@ def check_valid_file(fn):
unlink(fn)
# Verify the requirement before downloading the file
- requires('urlfetch')
+ requires("urlfetch")
if verbose:
- print('\tfetching %s ...' % url, file=get_original_stdout())
+ print("\tfetching %s ..." % url, file=get_original_stdout())
opener = urllib.request.build_opener()
if gzip:
- opener.addheaders.append(('Accept-Encoding', 'gzip'))
+ opener.addheaders.append(("Accept-Encoding", "gzip"))
f = opener.open(url, timeout=INTERNET_TIMEOUT)
- if gzip and f.headers.get('Content-Encoding') == 'gzip':
+ if gzip and f.headers.get("Content-Encoding") == "gzip":
f = gzip.GzipFile(fileobj=f)
try:
with open(fn, "wb") as out:
@@ -613,7 +614,7 @@ def check_valid_file(fn):
f = check_valid_file(fn)
if f is not None:
return f
- raise TestFailed('invalid resource %r' % fn)
+ raise TestFailed("invalid resource %r" % fn)
@contextlib.contextmanager
@@ -690,20 +691,20 @@ def disable_gc():
def python_is_optimized():
"""Find if Python was built with optimizations."""
- cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
+ cflags = sysconfig.get_config_var("PY_CFLAGS") or ""
final_opt = ""
for opt in cflags.split():
- if opt.startswith('-O'):
+ if opt.startswith("-O"):
final_opt = opt
- return final_opt not in ('', '-O0', '-Og')
+ return final_opt not in ("", "-O0", "-Og")
-_header = 'nP'
-_align = '0n'
+_header = "nP"
+_align = "0n"
if hasattr(sys, "getobjects"):
- _header = '2P' + _header
- _align = '0P'
-_vheader = _header + 'n'
+ _header = "2P" + _header
+ _align = "0P"
+_vheader = _header + "n"
def calcobjsize(fmt):
import struct
@@ -724,7 +725,7 @@ def check_sizeof(test, o, size):
if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\
((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))):
size += _testinternalcapi.SIZEOF_PYGC_HEAD
- msg = 'wrong size for %s: got %d, expected %d' \
+ msg = "wrong size for %s: got %d, expected %d" \
% (type(o), result, size)
test.assertEqual(result, size, msg)
@@ -733,13 +734,13 @@ def subTests(arg_names, arg_values, /, *, _do_cleanups=False):
"""
single_param = False
if isinstance(arg_names, str):
- arg_names = arg_names.replace(',',' ').split()
+ arg_names = arg_names.replace(","," ").split()
if len(arg_names) == 1:
single_param = True
arg_values = tuple(arg_values)
def decorator(func):
if isinstance(func, type):
- raise TypeError('subTests() can only decorate methods, not classes')
+ raise TypeError("subTests() can only decorate methods, not classes")
@functools.wraps(func)
def wrapper(self, /, *args, **kwargs):
for values in arg_values:
@@ -794,11 +795,11 @@ def inner(*args, **kwds):
tzset = time.tzset
except AttributeError:
raise unittest.SkipTest("tzset required")
- if 'TZ' in os.environ:
- orig_tz = os.environ['TZ']
+ if "TZ" in os.environ:
+ orig_tz = os.environ["TZ"]
else:
orig_tz = None
- os.environ['TZ'] = tz
+ os.environ["TZ"] = tz
tzset()
# now run the function, resetting the tz on exceptions
@@ -806,9 +807,9 @@ def inner(*args, **kwds):
return func(*args, **kwds)
finally:
if orig_tz is None:
- del os.environ['TZ']
+ del os.environ["TZ"]
else:
- os.environ['TZ'] = orig_tz
+ os.environ["TZ"] = orig_tz
time.tzset()
inner.__name__ = func.__name__
@@ -833,21 +834,21 @@ def set_memlimit(limit):
global max_memuse
global real_max_memuse
sizes = {
- 'k': 1024,
- 'm': _1M,
- 'g': _1G,
- 't': 1024*_1G,
+ "k": 1024,
+ "m": _1M,
+ "g": _1G,
+ "t": 1024*_1G,
}
- m = re.match(r'(\d+(\.\d+)?) (K|M|G|T)b?$', limit,
+ m = re.match(r"(\d+(\.\d+)?) (K|M|G|T)b?$", limit,
re.IGNORECASE | re.VERBOSE)
if m is None:
- raise ValueError('Invalid memory limit %r' % (limit,))
+ raise ValueError("Invalid memory limit %r" % (limit,))
memlimit = int(float(m.group(1)) * sizes[m.group(3).lower()])
real_max_memuse = memlimit
if memlimit > MAX_Py_ssize_t:
memlimit = MAX_Py_ssize_t
if memlimit < _2G - 1:
- raise ValueError('Memory limit %r too low to be useful' % (limit,))
+ raise ValueError("Memory limit %r too low to be useful" % (limit,))
max_memuse = memlimit
class _MemoryWatchdog:
@@ -856,15 +857,15 @@ class _MemoryWatchdog:
"""
def __init__(self):
- self.procfile = '/proc/{pid}/statm'.format(pid=os.getpid())
+ self.procfile = "/proc/{pid}/statm".format(pid=os.getpid())
self.started = False
def start(self):
import warnings
try:
- f = open(self.procfile, 'r')
+ f = open(self.procfile, "r")
except OSError as e:
- warnings.warn('/proc not available for stats: {}'.format(e),
+ warnings.warn("/proc not available for stats: {}".format(e),
RuntimeWarning)
sys.stderr.flush()
return
@@ -959,7 +960,7 @@ def _id(obj):
return obj
def requires_resource(resource):
- if resource == 'gui' and not _is_gui_available():
+ if resource == "gui" and not _is_gui_available():
return unittest.skip(_is_gui_available.reason)
if is_resource_enabled(resource):
return _id
@@ -982,13 +983,13 @@ def impl_detail(msg=None, **guards):
else:
msg = "implementation detail specific to {0}"
guardnames = sorted(guardnames.keys())
- msg = msg.format(' or '.join(guardnames))
+ msg = msg.format(" or ".join(guardnames))
return unittest.skip(msg)
def _parse_guards(guards):
# Returns a tuple ({platform_name: run_me}, default_value)
if not guards:
- return ({'cpython': True}, False)
+ return ({"cpython": True}, False)
is_true = list(guards.values())[0]
assert list(guards.values()) == [is_true] * len(guards) # all True or all False
return (guards, not is_true)
@@ -1008,7 +1009,7 @@ def check_impl_detail(**guards):
def no_tracing(func):
"""Decorator to temporarily turn off tracing for the duration of a test."""
- if not hasattr(sys, 'gettrace'):
+ if not hasattr(sys, "gettrace"):
return func
else:
@functools.wraps(func)
@@ -1093,7 +1094,7 @@ def _is_full_match_test(pattern):
#
# ignore patterns which contain fnmatch patterns: '*', '?', '[...]'
# or '[!...]'. For example, ignore 'test_access*'.
- return ('.' in pattern) and (not re.search(r'[?*\[\]]', pattern))
+ return ("." in pattern) and (not re.search(r"[?*\[\]]", pattern))
def set_match_tests(accept_patterns=None, ignore_patterns=None):
@@ -1140,7 +1141,7 @@ def _compile_match_function(patterns):
func = set(patterns).__contains__
else:
import fnmatch
- regex = '|'.join(map(fnmatch.translate, patterns))
+ regex = "|".join(map(fnmatch.translate, patterns))
# The search *is* case sensitive on purpose:
# don't use flags=re.IGNORECASE
regex_match = re.compile(regex).match
@@ -1188,8 +1189,8 @@ def _check_docstrings():
"""Just used to check if docstrings are enabled"""
MISSING_C_DOCSTRINGS = (check_impl_detail() and
- sys.platform != 'win32' and
- not sysconfig.get_config_var('WITH_DOC_STRINGS'))
+ sys.platform != "win32" and
+ not sysconfig.get_config_var("WITH_DOC_STRINGS"))
HAVE_DOCSTRINGS = (_check_docstrings.__doc__ is not None and
not MISSING_C_DOCSTRINGS)
@@ -1220,7 +1221,7 @@ def run_doctest(module, verbosity=None, optionflags=0):
if f:
raise TestFailed("%d of %d doctests failed" % (f, t))
if verbose:
- print('doctest (%s) ... %d tests with zero failures' %
+ print("doctest (%s) ... %d tests with zero failures" %
(module.__name__, t))
return f, t
@@ -1252,7 +1253,7 @@ def reap_children():
global environment_altered
# Need os.waitpid(-1, os.WNOHANG): Windows is not supported
- if not (hasattr(os, 'waitpid') and hasattr(os, 'WNOHANG')):
+ if not (hasattr(os, "waitpid") and hasattr(os, "WNOHANG")):
return
# Reap all our dead child processes so we don't leave zombies around.
@@ -1348,7 +1349,7 @@ def optim_args_from_interpreter_flags():
class Matcher(object):
- _partial_matches = ('msg', 'message')
+ _partial_matches = ("msg", "message")
def matches(self, d, **kwargs):
"""
@@ -1394,9 +1395,9 @@ def skip_if_buggy_ucrt_strfptime(test):
import locale
global _buggy_ucrt
if _buggy_ucrt is None:
- if(sys.platform == 'win32' and
- locale.getdefaultlocale()[1] == 'cp65001' and
- time.localtime().tm_zone == ''):
+ if(sys.platform == "win32" and
+ locale.getdefaultlocale()[1] == "cp65001" and
+ time.localtime().tm_zone == ""):
_buggy_ucrt = True
else:
_buggy_ucrt = False
@@ -1474,7 +1475,7 @@ def _call(self, python, args, env, returncode):
print(repr(r[0]))
print(repr(r[1]), file=sys.stderr)
raise RuntimeError(
- 'unexpected return code: {0} (0x{0:08X})'.format(p.returncode))
+ "unexpected return code: {0} (0x{0:08X})".format(p.returncode))
return r
def call_real(self, *args, returncode=0):
@@ -1502,7 +1503,7 @@ def detect_api_mismatch(ref_api, other_api, *, ignore=()):
if ignore:
missing_items -= set(ignore)
missing_items = set(m for m in missing_items
- if not m.startswith('_') or m.endswith('__'))
+ if not m.startswith("_") or m.endswith("__"))
return missing_items
@@ -1555,11 +1556,11 @@ def test__all__(self):
expected = set(extra)
for name in dir(module):
- if name.startswith('_') or name in not_exported:
+ if name.startswith("_") or name in not_exported:
continue
obj = getattr(module, name)
- if (getattr(obj, '__module__', None) in name_of_module or
- (not hasattr(obj, '__module__') and
+ if (getattr(obj, "__module__", None) in name_of_module or
+ (not hasattr(obj, "__module__") and
not isinstance(obj, types.ModuleType))):
expected.add(name)
test_case.assertCountEqual(module.__all__, expected)
@@ -1577,7 +1578,7 @@ def suppress_msvcrt_asserts(verbose=False):
| msvcrt.SEM_NOOPENFILEERRORBOX)
# CrtSetReportMode() is only available in debug build
- if hasattr(msvcrt, 'CrtSetReportMode'):
+ if hasattr(msvcrt, "CrtSetReportMode"):
for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]:
if verbose:
msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE)
@@ -1602,7 +1603,7 @@ def __enter__(self):
On UNIX, try to save the previous core file size limit, then set
soft limit to 0.
"""
- if sys.platform.startswith('win'):
+ if sys.platform.startswith("win"):
# see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx
try:
import msvcrt
@@ -1615,7 +1616,7 @@ def __enter__(self):
# bpo-23314: Suppress assert dialogs in debug builds.
# CrtSetReportMode() is only available in debug build.
- if hasattr(msvcrt, 'CrtSetReportMode'):
+ if hasattr(msvcrt, "CrtSetReportMode"):
self.old_modes = {}
for report_type in [msvcrt.CRT_WARN,
msvcrt.CRT_ERROR,
@@ -1640,7 +1641,7 @@ def __enter__(self):
except (ValueError, OSError):
pass
- if sys.platform == 'darwin':
+ if sys.platform == "darwin":
import subprocess
# Check if the 'Crash Reporter' on OSX was configured
# in 'Developer' mode and warn that it will get triggered
@@ -1648,16 +1649,16 @@ def __enter__(self):
#
# This assumes that this context manager is used in tests
# that might trigger the next manager.
- cmd = ['/usr/bin/defaults', 'read',
- 'com.apple.CrashReporter', 'DialogType']
+ cmd = ["/usr/bin/defaults", "read",
+ "com.apple.CrashReporter", "DialogType"]
proc = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
with proc:
stdout = proc.communicate()[0]
- if stdout.strip() == b'developer':
+ if stdout.strip() == b"developer":
print("this test triggers the Crash Reporter, "
- "that is intentional", end='', flush=True)
+ "that is intentional", end="", flush=True)
return self
@@ -1666,7 +1667,7 @@ def __exit__(self, *ignore_exc):
if self.old_value is None:
return
- if sys.platform.startswith('win'):
+ if sys.platform.startswith("win"):
import msvcrt
msvcrt.SetErrorMode(self.old_value)
@@ -1807,7 +1808,7 @@ def setswitchinterval(interval):
if _is_android_emulator is None:
import subprocess
_is_android_emulator = (subprocess.check_output(
- ['getprop', 'ro.kernel.qemu']).strip() == b'1')
+ ["getprop", "ro.kernel.qemu"]).strip() == b"1")
if _is_android_emulator:
interval = minimum_interval
return sys.setswitchinterval(interval)
@@ -1845,7 +1846,7 @@ def __init__(self):
self.signal = signal
self.signals = signal.valid_signals()
# SIGKILL and SIGSTOP signals cannot be ignored nor caught
- for signame in ('SIGKILL', 'SIGSTOP'):
+ for signame in ("SIGKILL", "SIGSTOP"):
try:
signum = getattr(signal, signame)
except AttributeError:
@@ -2075,11 +2076,11 @@ def skip_if_broken_multiprocessing_synchronize():
from .import_helper import import_module
# Skip tests if the _multiprocessing extension is missing.
- import_module('_multiprocessing')
+ import_module("_multiprocessing")
# Skip tests if there is no available semaphore implementation:
# multiprocessing.synchronize requires _multiprocessing.SemLock.
- synchronize = import_module('multiprocessing.synchronize')
+ synchronize = import_module("multiprocessing.synchronize")
if sys.platform == "linux":
try:
@@ -2109,7 +2110,7 @@ def check_disallow_instantiation(testcase, tp, *args, **kwds):
"""
mod = tp.__module__
name = tp.__name__
- if mod != 'builtins':
+ if mod != "builtins":
qualname = f"{mod}.{name}"
else:
qualname = f"{name}"
diff --git a/.venv3.10/Lib/test/support/bytecode_helper.py b/.venv3.10/Lib/test/support/bytecode_helper.py
index 471d4a68..8f13b379 100644
--- a/.venv3.10/Lib/test/support/bytecode_helper.py
+++ b/.venv3.10/Lib/test/support/bytecode_helper.py
@@ -22,9 +22,9 @@ def assertInBytecode(self, x, opname, argval=_UNSPECIFIED):
return instr
disassembly = self.get_disassembly_as_string(x)
if argval is _UNSPECIFIED:
- msg = '%s not found in bytecode:\n%s' % (opname, disassembly)
+ msg = "%s not found in bytecode:\n%s" % (opname, disassembly)
else:
- msg = '(%s,%r) not found in bytecode:\n%s'
+ msg = "(%s,%r) not found in bytecode:\n%s"
msg = msg % (opname, argval, disassembly)
self.fail(msg)
@@ -34,9 +34,9 @@ def assertNotInBytecode(self, x, opname, argval=_UNSPECIFIED):
if instr.opname == opname:
disassembly = self.get_disassembly_as_string(x)
if argval is _UNSPECIFIED:
- msg = '%s occurs in bytecode:\n%s' % (opname, disassembly)
+ msg = "%s occurs in bytecode:\n%s" % (opname, disassembly)
self.fail(msg)
elif instr.argval == argval:
- msg = '(%s,%r) occurs in bytecode:\n%s'
+ msg = "(%s,%r) occurs in bytecode:\n%s"
msg = msg % (opname, argval, disassembly)
self.fail(msg)
diff --git a/.venv3.10/Lib/test/support/hashlib_helper.py b/.venv3.10/Lib/test/support/hashlib_helper.py
index a4e6c922..9f7280b9 100644
--- a/.venv3.10/Lib/test/support/hashlib_helper.py
+++ b/.venv3.10/Lib/test/support/hashlib_helper.py
@@ -23,11 +23,11 @@ def requires_hashdigest(digestname, openssl=None, usedforsecurity=True):
"""
def decorator(func_or_class):
if isinstance(func_or_class, type):
- setUpClass = func_or_class.__dict__.get('setUpClass')
+ setUpClass = func_or_class.__dict__.get("setUpClass")
if setUpClass is None:
def setUpClass(cls):
super(func_or_class, cls).setUpClass()
- setUpClass.__qualname__ = func_or_class.__qualname__ + '.setUpClass'
+ setUpClass.__qualname__ = func_or_class.__qualname__ + ".setUpClass"
setUpClass.__module__ = func_or_class.__module__
else:
setUpClass = setUpClass.__func__
diff --git a/.venv3.10/Lib/test/support/import_helper.py b/.venv3.10/Lib/test/support/import_helper.py
index efa8ffad..d819511b 100644
--- a/.venv3.10/Lib/test/support/import_helper.py
+++ b/.venv3.10/Lib/test/support/import_helper.py
@@ -41,11 +41,11 @@ def forget(modname):
"""
unload(modname)
for dirname in sys.path:
- source = os.path.join(dirname, modname + '.py')
+ source = os.path.join(dirname, modname + ".py")
# It doesn't matter if they exist or not, unlink all possible
# combinations of PEP 3147/488 and legacy pyc files.
- unlink(source + 'c')
- for opt in ('', 1, 2):
+ unlink(source + "c")
+ for opt in ("", 1, 2):
unlink(importlib.util.cache_from_source(source, optimization=opt))
@@ -58,7 +58,7 @@ def make_legacy_pyc(source):
"""
pyc_file = importlib.util.cache_from_source(source)
up_one = os.path.dirname(os.path.abspath(source))
- legacy_pyc = os.path.join(up_one, source + 'c')
+ legacy_pyc = os.path.join(up_one, source + "c")
shutil.move(pyc_file, legacy_pyc)
return legacy_pyc
@@ -83,7 +83,7 @@ def import_module(name, deprecated=False, *, required_on=()):
def _save_and_remove_modules(names):
orig_modules = {}
- prefixes = tuple(name + '.' for name in names)
+ prefixes = tuple(name + "." for name in names)
for modname in list(sys.modules):
if modname in names or modname.startswith(prefixes):
orig_modules[modname] = sys.modules.pop(modname)
@@ -207,7 +207,7 @@ def modules_cleanup(oldmodules):
# codec cache. If we destroy the corresponding modules their
# globals will be set to None which will trip up the cached functions.
encodings = [(k, v) for k, v in sys.modules.items()
- if k.startswith('encodings.')]
+ if k.startswith("encodings.")]
sys.modules.clear()
sys.modules.update(encodings)
# XXX: This kind of problem can affect more than just encodings.
diff --git a/.venv3.10/Lib/test/support/interpreters.py b/.venv3.10/Lib/test/support/interpreters.py
index 2935708f..9bb882d7 100644
--- a/.venv3.10/Lib/test/support/interpreters.py
+++ b/.venv3.10/Lib/test/support/interpreters.py
@@ -11,11 +11,11 @@
__all__ = [
- 'Interpreter', 'get_current', 'get_main', 'create', 'list_all',
- 'SendChannel', 'RecvChannel',
- 'create_channel', 'list_all_channels', 'is_shareable',
- 'ChannelError', 'ChannelNotFoundError',
- 'ChannelEmptyError',
+ "Interpreter", "get_current", "get_main", "create", "list_all",
+ "SendChannel", "RecvChannel",
+ "create_channel", "list_all_channels", "is_shareable",
+ "ChannelError", "ChannelNotFoundError",
+ "ChannelEmptyError",
]
@@ -47,13 +47,13 @@ class Interpreter:
def __init__(self, id, *, isolated=None):
if not isinstance(id, (int, _interpreters.InterpreterID)):
- raise TypeError(f'id must be an int, got {id!r}')
+ raise TypeError(f"id must be an int, got {id!r}")
self._id = id
self._isolated = isolated
def __repr__(self):
data = dict(id=int(self._id), isolated=self._isolated)
- kwargs = (f'{k}={v!r}' for k, v in data.items())
+ kwargs = (f"{k}={v!r}" for k, v in data.items())
return f'{type(self).__name__}({", ".join(kwargs)})'
def __hash__(self):
@@ -118,11 +118,11 @@ class _ChannelEnd:
def __init__(self, id):
if not isinstance(id, (int, _interpreters.ChannelID)):
- raise TypeError(f'id must be an int, got {id!r}')
+ raise TypeError(f"id must be an int, got {id!r}")
self._id = id
def __repr__(self):
- return f'{type(self).__name__}(id={int(self._id)})'
+ return f"{type(self).__name__}(id={int(self._id)})"
def __hash__(self):
return hash(self._id)
diff --git a/.venv3.10/Lib/test/support/os_helper.py b/.venv3.10/Lib/test/support/os_helper.py
index 82a6de78..57afe301 100644
--- a/.venv3.10/Lib/test/support/os_helper.py
+++ b/.venv3.10/Lib/test/support/os_helper.py
@@ -11,11 +11,11 @@
# Filename used for testing
-if os.name == 'java':
+if os.name == "java":
# Jython disallows @ in module names
- TESTFN_ASCII = '$test'
+ TESTFN_ASCII = "$test"
else:
- TESTFN_ASCII = '@test'
+ TESTFN_ASCII = "@test"
# Disambiguate TESTFN for parallel testing, while letting it remain a valid
# module name.
@@ -23,18 +23,18 @@
# TESTFN_UNICODE is a non-ascii filename
TESTFN_UNICODE = TESTFN_ASCII + "-\xe0\xf2\u0258\u0141\u011f"
-if sys.platform == 'darwin':
+if sys.platform == "darwin":
# In Mac OS X's VFS API file names are, by definition, canonically
# decomposed Unicode, encoded using UTF-8. See QA1173:
# http://developer.apple.com/mac/library/qa/qa2001/qa1173.html
import unicodedata
- TESTFN_UNICODE = unicodedata.normalize('NFD', TESTFN_UNICODE)
+ TESTFN_UNICODE = unicodedata.normalize("NFD", TESTFN_UNICODE)
# TESTFN_UNENCODABLE is a filename (str type) that should *not* be able to be
# encoded by the filesystem encoding (in strict mode). It can be None if we
# cannot generate such filename.
TESTFN_UNENCODABLE = None
-if os.name == 'nt':
+if os.name == "nt":
# skip win32s (0) or Windows 9x/ME (1)
if sys.getwindowsversion().platform >= 2:
# Different kinds of characters from various languages to minimize the
@@ -45,19 +45,19 @@
except UnicodeEncodeError:
pass
else:
- print('WARNING: The filename %r CAN be encoded by the filesystem '
- 'encoding (%s). Unicode filename tests may not be effective'
+ print("WARNING: The filename %r CAN be encoded by the filesystem "
+ "encoding (%s). Unicode filename tests may not be effective"
% (TESTFN_UNENCODABLE, sys.getfilesystemencoding()))
TESTFN_UNENCODABLE = None
# Mac OS X denies unencodable filenames (invalid utf-8)
-elif sys.platform != 'darwin':
+elif sys.platform != "darwin":
try:
# ascii and utf-8 cannot encode the byte 0xff
- b'\xff'.decode(sys.getfilesystemencoding())
+ b"\xff".decode(sys.getfilesystemencoding())
except UnicodeDecodeError:
# 0xff will be encoded using the surrogate character u+DCFF
TESTFN_UNENCODABLE = TESTFN_ASCII \
- + b'-\xff'.decode(sys.getfilesystemencoding(), 'surrogateescape')
+ + b"-\xff".decode(sys.getfilesystemencoding(), "surrogateescape")
else:
# File system encoding (eg. ISO-8859-* encodings) can encode
# the byte 0xff. Skip some unicode filename tests.
@@ -65,39 +65,39 @@
# FS_NONASCII: non-ASCII character encodable by os.fsencode(),
# or an empty string if there is no such character.
-FS_NONASCII = ''
+FS_NONASCII = ""
for character in (
# First try printable and common characters to have a readable filename.
# For each character, the encoding list are just example of encodings able
# to encode the character (the list is not exhaustive).
# U+00E6 (Latin Small Letter Ae): cp1252, iso-8859-1
- '\u00E6',
+ "\u00E6",
# U+0130 (Latin Capital Letter I With Dot Above): cp1254, iso8859_3
- '\u0130',
+ "\u0130",
# U+0141 (Latin Capital Letter L With Stroke): cp1250, cp1257
- '\u0141',
+ "\u0141",
# U+03C6 (Greek Small Letter Phi): cp1253
- '\u03C6',
+ "\u03C6",
# U+041A (Cyrillic Capital Letter Ka): cp1251
- '\u041A',
+ "\u041A",
# U+05D0 (Hebrew Letter Alef): Encodable to cp424
- '\u05D0',
+ "\u05D0",
# U+060C (Arabic Comma): cp864, cp1006, iso8859_6, mac_arabic
- '\u060C',
+ "\u060C",
# U+062A (Arabic Letter Teh): cp720
- '\u062A',
+ "\u062A",
# U+0E01 (Thai Character Ko Kai): cp874
- '\u0E01',
+ "\u0E01",
# Then try more "special" characters. "special" because they may be
# interpreted or displayed differently depending on the exact locale
# encoding and the font.
# U+00A0 (No-Break Space)
- '\u00A0',
+ "\u00A0",
# U+20AC (Euro Sign)
- '\u20AC',
+ "\u20AC",
):
try:
# If Python is set up to use the legacy 'mbcs' in Windows,
@@ -126,17 +126,17 @@
# accepts it to create a file or a directory, or don't accept to enter to
# such directory (when the bytes name is used). So test b'\xe7' first:
# it is not decodable from cp932.
- b'\xe7w\xf0',
+ b"\xe7w\xf0",
# undecodable from ASCII, UTF-8
- b'\xff',
+ b"\xff",
# undecodable from iso8859-3, iso8859-6, iso8859-7, cp424, iso8859-8, cp856
# and cp857
- b'\xae\xd5'
+ b"\xae\xd5"
# undecodable from UTF-8 (UNIX and Mac OS X)
- b'\xed\xb2\x80', b'\xed\xb4\x80',
+ b"\xed\xb2\x80", b"\xed\xb4\x80",
# undecodable from shift_jis, cp869, cp874, cp932, cp1250, cp1251, cp1252,
# cp1253, cp1254, cp1255, cp1257, cp1258
- b'\x81\x98',
+ b"\x81\x98",
):
try:
name.decode(sys.getfilesystemencoding())
@@ -249,7 +249,7 @@ def _waitfor(func, pathname, waitall=False):
dirname = pathname
else:
dirname, name = os.path.split(pathname)
- dirname = dirname or '.'
+ dirname = dirname or "."
# Check for `pathname` to be removed from the filesystem.
# The exponential backoff of the timeout amounts to a total
# of ~1 second after which the deletion is probably an error
@@ -271,7 +271,7 @@ def _waitfor(func, pathname, waitall=False):
# Increase the timeout and try again
time.sleep(timeout)
timeout *= 2
- warnings.warn('tests may fail, delete still pending for ' + pathname,
+ warnings.warn("tests may fail, delete still pending for " + pathname,
RuntimeWarning, stacklevel=4)
def _unlink(filename):
@@ -387,8 +387,8 @@ def temp_dir(path=None, quiet=False):
except OSError as exc:
if not quiet:
raise
- warnings.warn(f'tests may fail, unable to create '
- f'temporary directory {path!r}: {exc}',
+ warnings.warn(f"tests may fail, unable to create "
+ f"temporary directory {path!r}: {exc}",
RuntimeWarning, stacklevel=3)
if dir_created:
pid = os.getpid()
@@ -420,8 +420,8 @@ def change_cwd(path, quiet=False):
except OSError as exc:
if not quiet:
raise
- warnings.warn(f'tests may fail, unable to change the current working '
- f'directory to {path!r}: {exc}',
+ warnings.warn(f"tests may fail, unable to change the current working "
+ f"directory to {path!r}: {exc}",
RuntimeWarning, stacklevel=3)
try:
yield os.getcwd()
@@ -430,7 +430,7 @@ def change_cwd(path, quiet=False):
@contextlib.contextmanager
-def temp_cwd(name='tempcwd', quiet=False):
+def temp_cwd(name="tempcwd", quiet=False):
"""
Context manager that temporarily creates and changes the CWD.
@@ -488,7 +488,7 @@ def __init__(self, path):
self.path = path
def __repr__(self):
- return f''
+ return f""
def __fspath__(self):
if (isinstance(self.path, BaseException) or
@@ -502,7 +502,7 @@ def __fspath__(self):
def fd_count():
"""Count the number of open file descriptors.
"""
- if sys.platform.startswith(('linux', 'freebsd')):
+ if sys.platform.startswith(("linux", "freebsd")):
try:
names = os.listdir("/proc/self/fd")
# Subtract one because listdir() internally opens a file
@@ -512,14 +512,14 @@ def fd_count():
pass
MAXFD = 256
- if hasattr(os, 'sysconf'):
+ if hasattr(os, "sysconf"):
try:
MAXFD = os.sysconf("SC_OPEN_MAX")
except OSError:
pass
old_modes = None
- if sys.platform == 'win32':
+ if sys.platform == "win32":
# bpo-25306, bpo-31009: Call CrtSetReportMode() to not kill the process
# on invalid file descriptor if Python is compiled in debug mode
try:
diff --git a/.venv3.10/Lib/test/support/script_helper.py b/.venv3.10/Lib/test/support/script_helper.py
index 6d699c84..d988ee57 100644
--- a/.venv3.10/Lib/test/support/script_helper.py
+++ b/.venv3.10/Lib/test/support/script_helper.py
@@ -39,14 +39,14 @@ def interpreter_requires_environment():
global __cached_interp_requires_environment
if __cached_interp_requires_environment is None:
# If PYTHONHOME is set, assume that we need it
- if 'PYTHONHOME' in os.environ:
+ if "PYTHONHOME" in os.environ:
__cached_interp_requires_environment = True
return True
# Try running an interpreter with -E to see if it works or not.
try:
- subprocess.check_call([sys.executable, '-E',
- '-c', 'import sys; sys.exit(0)'])
+ subprocess.check_call([sys.executable, "-E",
+ "-c", "import sys; sys.exit(0)"])
except subprocess.CalledProcessError:
__cached_interp_requires_environment = True
else:
@@ -64,11 +64,11 @@ def fail(self, cmd_line):
maxlen = 80 * 100
out, err = self.out, self.err
if len(out) > maxlen:
- out = b'(... truncated stdout ...)' + out[-maxlen:]
+ out = b"(... truncated stdout ...)" + out[-maxlen:]
if len(err) > maxlen:
- err = b'(... truncated stderr ...)' + err[-maxlen:]
- out = out.decode('ascii', 'replace').rstrip()
- err = err.decode('ascii', 'replace').rstrip()
+ err = b"(... truncated stderr ...)" + err[-maxlen:]
+ out = out.decode("ascii", "replace").rstrip()
+ err = err.decode("ascii", "replace").rstrip()
raise AssertionError("Process return code is %d\n"
"command line: %r\n"
"\n"
@@ -89,28 +89,28 @@ def fail(self, cmd_line):
# Executing the interpreter in a subprocess
def run_python_until_end(*args, **env_vars):
env_required = interpreter_requires_environment()
- cwd = env_vars.pop('__cwd', None)
- if '__isolated' in env_vars:
- isolated = env_vars.pop('__isolated')
+ cwd = env_vars.pop("__cwd", None)
+ if "__isolated" in env_vars:
+ isolated = env_vars.pop("__isolated")
else:
isolated = not env_vars and not env_required
- cmd_line = [sys.executable, '-X', 'faulthandler']
+ cmd_line = [sys.executable, "-X", "faulthandler"]
if isolated:
# isolated mode: ignore Python environment variables, ignore user
# site-packages, and don't add the current directory to sys.path
- cmd_line.append('-I')
+ cmd_line.append("-I")
elif not env_vars and not env_required:
# ignore Python environment variables
- cmd_line.append('-E')
+ cmd_line.append("-E")
# But a special flag that can be set to override -- in this case, the
# caller is responsible to pass the full environment.
- if env_vars.pop('__cleanenv', None):
+ if env_vars.pop("__cleanenv", None):
env = {}
- if sys.platform == 'win32':
+ if sys.platform == "win32":
# Windows requires at least the SYSTEMROOT environment variable to
# start Python.
- env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
+ env["SYSTEMROOT"] = os.environ["SYSTEMROOT"]
# Other interesting environment variables, not copied currently:
# COMSPEC, HOME, PATH, TEMP, TMPDIR, TMP.
@@ -121,8 +121,8 @@ def run_python_until_end(*args, **env_vars):
# set TERM='' unless the TERM environment variable is passed explicitly
# see issues #11390 and #18300
- if 'TERM' not in env_vars:
- env['TERM'] = ''
+ if "TERM" not in env_vars:
+ env["TERM"] = ""
env.update(env_vars)
cmd_line.extend(args)
@@ -179,7 +179,7 @@ def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
"""
cmd_line = [sys.executable]
if not interpreter_requires_environment():
- cmd_line.append('-E')
+ cmd_line.append("-E")
cmd_line.extend(args)
# Under Fedora (?), GNU readline can output junk on stderr when initialized,
# depending on the TERM setting. Setting TERM=vt100 is supposed to disable
@@ -187,8 +187,8 @@ def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
# - http://reinout.vanrees.org/weblog/2009/08/14/readline-invisible-character-hack.html
# - http://stackoverflow.com/questions/15760712/python-readline-module-prints-escape-character-during-import
# - http://lists.gnu.org/archive/html/bug-readline/2007-08/msg00004.html
- env = kw.setdefault('env', dict(os.environ))
- env['TERM'] = 'vt100'
+ env = kw.setdefault("env", dict(os.environ))
+ env["TERM"] = "vt100"
return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
stdout=stdout, stderr=stderr,
**kw)
@@ -209,22 +209,22 @@ def kill_python(p):
def make_script(script_dir, script_basename, source, omit_suffix=False):
script_filename = script_basename
if not omit_suffix:
- script_filename += os.extsep + 'py'
+ script_filename += os.extsep + "py"
script_name = os.path.join(script_dir, script_filename)
# The script should be encoded to UTF-8, the default string encoding
- with open(script_name, 'w', encoding='utf-8') as script_file:
+ with open(script_name, "w", encoding="utf-8") as script_file:
script_file.write(source)
importlib.invalidate_caches()
return script_name
def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):
- zip_filename = zip_basename+os.extsep+'zip'
+ zip_filename = zip_basename+os.extsep+"zip"
zip_name = os.path.join(zip_dir, zip_filename)
- with zipfile.ZipFile(zip_name, 'w') as zip_file:
+ with zipfile.ZipFile(zip_name, "w") as zip_file:
if name_in_zip is None:
parts = script_name.split(os.sep)
- if len(parts) >= 2 and parts[-2] == '__pycache__':
+ if len(parts) >= 2 and parts[-2] == "__pycache__":
legacy_pyc = make_legacy_pyc(source_from_cache(script_name))
name_in_zip = os.path.basename(legacy_pyc)
script_name = legacy_pyc
@@ -238,15 +238,15 @@ def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):
return zip_name, os.path.join(zip_name, name_in_zip)
-def make_pkg(pkg_dir, init_source=''):
+def make_pkg(pkg_dir, init_source=""):
os.mkdir(pkg_dir)
- make_script(pkg_dir, '__init__', init_source)
+ make_script(pkg_dir, "__init__", init_source)
def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
source, depth=1, compiled=False):
unlink = []
- init_name = make_script(zip_dir, '__init__', '')
+ init_name = make_script(zip_dir, "__init__", "")
unlink.append(init_name)
init_basename = os.path.basename(init_name)
script_name = make_script(zip_dir, script_basename, source)
@@ -257,9 +257,9 @@ def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
unlink.extend((init_name, script_name))
pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)]
script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name))
- zip_filename = zip_basename+os.extsep+'zip'
+ zip_filename = zip_basename+os.extsep+"zip"
zip_name = os.path.join(zip_dir, zip_filename)
- with zipfile.ZipFile(zip_name, 'w') as zip_file:
+ with zipfile.ZipFile(zip_name, "w") as zip_file:
for name in pkg_names:
init_name_in_zip = os.path.join(name, init_basename)
zip_file.write(init_name, init_name_in_zip)
diff --git a/.venv3.10/Lib/test/support/socket_helper.py b/.venv3.10/Lib/test/support/socket_helper.py
index 38c499bf..09daf84d 100644
--- a/.venv3.10/Lib/test/support/socket_helper.py
+++ b/.venv3.10/Lib/test/support/socket_helper.py
@@ -89,12 +89,12 @@ def bind_port(sock, host=HOST):
"""
if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM:
- if hasattr(socket, 'SO_REUSEADDR'):
+ if hasattr(socket, "SO_REUSEADDR"):
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
raise support.TestFailed("tests should never set the "
"SO_REUSEADDR socket option on "
"TCP/IP sockets!")
- if hasattr(socket, 'SO_REUSEPORT'):
+ if hasattr(socket, "SO_REUSEPORT"):
try:
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
raise support.TestFailed("tests should never set the "
@@ -105,7 +105,7 @@ def bind_port(sock, host=HOST):
# thus defining SO_REUSEPORT but this process is running
# under an older kernel that does not support SO_REUSEPORT.
pass
- if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'):
+ if hasattr(socket, "SO_EXCLUSIVEADDRUSE"):
sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)
sock.bind((host, 0))
@@ -119,7 +119,7 @@ def bind_unix_socket(sock, addr):
sock.bind(addr)
except PermissionError:
sock.close()
- raise unittest.SkipTest('cannot bind AF_UNIX sockets')
+ raise unittest.SkipTest("cannot bind AF_UNIX sockets")
def _is_ipv6_enabled():
"""Check whether IPv6 is enabled on this host."""
@@ -142,8 +142,8 @@ def _is_ipv6_enabled():
_bind_nix_socket_error = None
def skip_unless_bind_unix_socket(test):
"""Decorator for tests requiring a functional bind() for unix sockets."""
- if not hasattr(socket, 'AF_UNIX'):
- return unittest.skip('No UNIX Sockets')(test)
+ if not hasattr(socket, "AF_UNIX"):
+ return unittest.skip("No UNIX Sockets")(test)
global _bind_nix_socket_error
if _bind_nix_socket_error is None:
from .os_helper import TESTFN, unlink
@@ -157,7 +157,7 @@ def skip_unless_bind_unix_socket(test):
finally:
unlink(path)
if _bind_nix_socket_error:
- msg = 'Requires a functional unix bind(): %s' % _bind_nix_socket_error
+ msg = "Requires a functional unix bind(): %s" % _bind_nix_socket_error
return unittest.skip(msg)(test)
else:
return test
@@ -169,14 +169,14 @@ def get_socket_conn_refused_errs():
when a connection is refused.
"""
errors = [errno.ECONNREFUSED]
- if hasattr(errno, 'ENETUNREACH'):
+ if hasattr(errno, "ENETUNREACH"):
# On Solaris, ENETUNREACH is returned sometimes instead of ECONNREFUSED
errors.append(errno.ENETUNREACH)
- if hasattr(errno, 'EADDRNOTAVAIL'):
+ if hasattr(errno, "EADDRNOTAVAIL"):
# bpo-31910: socket.create_connection() fails randomly
# with EADDRNOTAVAIL on Travis CI
errors.append(errno.EADDRNOTAVAIL)
- if hasattr(errno, 'EHOSTUNREACH'):
+ if hasattr(errno, "EHOSTUNREACH"):
# bpo-37583: The destination host cannot be reached
errors.append(errno.EHOSTUNREACH)
if not IPV6_ENABLED:
@@ -196,22 +196,22 @@ def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()):
timeout = support.INTERNET_TIMEOUT
default_errnos = [
- ('ECONNREFUSED', 111),
- ('ECONNRESET', 104),
- ('EHOSTUNREACH', 113),
- ('ENETUNREACH', 101),
- ('ETIMEDOUT', 110),
+ ("ECONNREFUSED", 111),
+ ("ECONNRESET", 104),
+ ("EHOSTUNREACH", 113),
+ ("ENETUNREACH", 101),
+ ("ETIMEDOUT", 110),
# socket.create_connection() fails randomly with
# EADDRNOTAVAIL on Travis CI.
- ('EADDRNOTAVAIL', 99),
+ ("EADDRNOTAVAIL", 99),
]
default_gai_errnos = [
- ('EAI_AGAIN', -3),
- ('EAI_FAIL', -4),
- ('EAI_NONAME', -2),
- ('EAI_NODATA', -5),
+ ("EAI_AGAIN", -3),
+ ("EAI_FAIL", -4),
+ ("EAI_NONAME", -2),
+ ("EAI_NODATA", -5),
# Encountered when trying to resolve IPv6-only hostnames
- ('WSANO_DATA', 11004),
+ ("WSANO_DATA", 11004),
]
denied = support.ResourceDenied("Resource %r is not available" % resource_name)
@@ -224,7 +224,7 @@ def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()):
for (name, num) in default_gai_errnos]
def filter_error(err):
- n = getattr(err, 'errno', None)
+ n = getattr(err, "errno", None)
if (isinstance(err, TimeoutError) or
(isinstance(err, socket.gaierror) and n in gai_errnos) or
(isinstance(err, urllib.error.HTTPError) and
diff --git a/.venv3.10/Lib/test/support/testresult.py b/.venv3.10/Lib/test/support/testresult.py
index 6f2edda0..3df20d33 100644
--- a/.venv3.10/Lib/test/support/testresult.py
+++ b/.venv3.10/Lib/test/support/testresult.py
@@ -1,6 +1,6 @@
-'''Test runner and result class for the regression test suite.
+"""Test runner and result class for the regression test suite.
-'''
+"""
import functools
import io
@@ -20,8 +20,8 @@ def __init__(self, stream, descriptions, verbosity):
from xml.etree import ElementTree as ET
from datetime import datetime
self.__ET = ET
- self.__suite = ET.Element('testsuite')
- self.__suite.set('start', datetime.utcnow().isoformat(' '))
+ self.__suite = ET.Element("testsuite")
+ self.__suite.set("start", datetime.utcnow().isoformat(" "))
self.__e = None
self.__start_time = None
@@ -40,7 +40,7 @@ def __getId(cls, test):
def startTest(self, test):
super().startTest(test)
if self.USE_XML:
- self.__e = e = self.__ET.SubElement(self.__suite, 'testcase')
+ self.__e = e = self.__ET.SubElement(self.__suite, "testcase")
self.__start_time = time.perf_counter()
def _add_result(self, test, capture=False, **args):
@@ -52,25 +52,25 @@ def _add_result(self, test, capture=False, **args):
return
ET = self.__ET
- e.set('name', args.pop('name', self.__getId(test)))
- e.set('status', args.pop('status', 'run'))
- e.set('result', args.pop('result', 'completed'))
+ e.set("name", args.pop("name", self.__getId(test)))
+ e.set("status", args.pop("status", "run"))
+ e.set("result", args.pop("result", "completed"))
if self.__start_time:
- e.set('time', f'{time.perf_counter() - self.__start_time:0.6f}')
+ e.set("time", f"{time.perf_counter() - self.__start_time:0.6f}")
if capture:
if self._stdout_buffer is not None:
stdout = self._stdout_buffer.getvalue().rstrip()
- ET.SubElement(e, 'system-out').text = stdout
+ ET.SubElement(e, "system-out").text = stdout
if self._stderr_buffer is not None:
stderr = self._stderr_buffer.getvalue().rstrip()
- ET.SubElement(e, 'system-err').text = stderr
+ ET.SubElement(e, "system-err").text = stderr
for k, v in args.items():
if not k or not v:
continue
e2 = ET.SubElement(e, k)
- if hasattr(v, 'items'):
+ if hasattr(v, "items"):
for k2, v2 in v.items():
if k2:
e2.set(k2, str(v2))
@@ -82,10 +82,10 @@ def _add_result(self, test, capture=False, **args):
@classmethod
def __makeErrorDict(cls, err_type, err_value, err_tb):
if isinstance(err_type, type):
- if err_type.__module__ == 'builtins':
+ if err_type.__module__ == "builtins":
typename = err_type.__name__
else:
- typename = f'{err_type.__module__}.{err_type.__name__}'
+ typename = f"{err_type.__module__}.{err_type.__name__}"
else:
typename = repr(err_type)
@@ -93,9 +93,9 @@ def __makeErrorDict(cls, err_type, err_value, err_tb):
tb = traceback.format_exception(err_type, err_value, err_tb)
return {
- 'type': typename,
- 'message': ''.join(msg),
- '': ''.join(tb),
+ "type": typename,
+ "message": "".join(msg),
+ "": "".join(tb),
}
def addError(self, test, err):
@@ -119,16 +119,16 @@ def addSuccess(self, test):
super().addSuccess(test)
def addUnexpectedSuccess(self, test):
- self._add_result(test, outcome='UNEXPECTED_SUCCESS')
+ self._add_result(test, outcome="UNEXPECTED_SUCCESS")
super().addUnexpectedSuccess(test)
def get_xml_element(self):
if not self.USE_XML:
raise ValueError("USE_XML is false")
e = self.__suite
- e.set('tests', str(self.testsRun))
- e.set('errors', str(len(self.errors)))
- e.set('failures', str(len(self.failures)))
+ e.set("tests", str(self.testsRun))
+ e.set("errors", str(len(self.errors)))
+ e.set("failures", str(len(self.failures)))
return e
class QuietRegressionTestRunner:
@@ -151,7 +151,7 @@ def get_test_runner_class(verbosity, buffer=False):
def get_test_runner(stream, verbosity, capture_output=False):
return get_test_runner_class(verbosity, capture_output)(stream)
-if __name__ == '__main__':
+if __name__ == "__main__":
import xml.etree.ElementTree as ET
RegressionTestResult.USE_XML = True
@@ -163,23 +163,23 @@ def test_pass_slow(self):
time.sleep(1.0)
def test_fail(self):
- print('stdout', file=sys.stdout)
- print('stderr', file=sys.stderr)
- self.fail('failure message')
+ print("stdout", file=sys.stdout)
+ print("stderr", file=sys.stderr)
+ self.fail("failure message")
def test_error(self):
- print('stdout', file=sys.stdout)
- print('stderr', file=sys.stderr)
- raise RuntimeError('error message')
+ print("stdout", file=sys.stdout)
+ print("stderr", file=sys.stderr)
+ raise RuntimeError("error message")
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestTests))
stream = io.StringIO()
- runner_cls = get_test_runner_class(sum(a == '-v' for a in sys.argv))
+ runner_cls = get_test_runner_class(sum(a == "-v" for a in sys.argv))
runner = runner_cls(sys.stdout)
result = runner.run(suite)
- print('Output:', stream.getvalue())
- print('XML: ', end='')
+ print("Output:", stream.getvalue())
+ print("XML: ", end="")
for s in ET.tostringlist(result.get_xml_element()):
- print(s.decode(), end='')
+ print(s.decode(), end="")
print()
diff --git a/.venv3.10/Lib/test/support/threading_helper.py b/.venv3.10/Lib/test/support/threading_helper.py
index 92a64e83..787679e2 100644
--- a/.venv3.10/Lib/test/support/threading_helper.py
+++ b/.venv3.10/Lib/test/support/threading_helper.py
@@ -143,13 +143,13 @@ def start_threads(threads, unlock=None):
if not started:
break
if support.verbose:
- print('Unable to join %d threads during a period of '
- '%d minutes' % (len(started), timeout))
+ print("Unable to join %d threads during a period of "
+ "%d minutes" % (len(started), timeout))
finally:
started = [t for t in started if t.is_alive()]
if started:
faulthandler.dump_traceback(sys.stdout)
- raise AssertionError('Unable to join %d threads' % len(started))
+ raise AssertionError("Unable to join %d threads" % len(started))
class catch_threading_exception:
diff --git a/.venv3.10/Lib/test/support/warnings_helper.py b/.venv3.10/Lib/test/support/warnings_helper.py
index 93a91e6d..6e9a10a4 100644
--- a/.venv3.10/Lib/test/support/warnings_helper.py
+++ b/.venv3.10/Lib/test/support/warnings_helper.py
@@ -5,13 +5,13 @@
import warnings
-def check_syntax_warning(testcase, statement, errtext='',
+def check_syntax_warning(testcase, statement, errtext="",
*, lineno=1, offset=None):
# Test also that a warning is emitted only once.
from test.support import check_syntax_error
with warnings.catch_warnings(record=True) as warns:
- warnings.simplefilter('always', SyntaxWarning)
- compile(statement, '', 'exec')
+ warnings.simplefilter("always", SyntaxWarning)
+ compile(statement, "", "exec")
testcase.assertEqual(len(warns), 1, warns)
warn, = warns
@@ -19,7 +19,7 @@ def check_syntax_warning(testcase, statement, errtext='',
warn.category)
if errtext:
testcase.assertRegex(str(warn.message), errtext)
- testcase.assertEqual(warn.filename, '')
+ testcase.assertEqual(warn.filename, "")
testcase.assertIsNotNone(warn.lineno)
if lineno is not None:
testcase.assertEqual(warn.lineno, lineno)
@@ -28,7 +28,7 @@ def check_syntax_warning(testcase, statement, errtext='',
# since the latter contains more information and provides better
# error report.
with warnings.catch_warnings(record=True) as warns:
- warnings.simplefilter('error', SyntaxWarning)
+ warnings.simplefilter("error", SyntaxWarning)
check_syntax_error(testcase, statement, errtext,
lineno=lineno, offset=offset)
# No warnings are leaked when a SyntaxError is raised.
@@ -45,7 +45,7 @@ def decorator(test):
@functools.wraps(test)
def wrapper(self, *args, **kwargs):
with warnings.catch_warnings():
- warnings.simplefilter('ignore', category=category)
+ warnings.simplefilter("ignore", category=category)
return test(self, *args, **kwargs)
return wrapper
return decorator
@@ -89,7 +89,7 @@ def check_warnings(*filters, **kwargs):
Without argument, it defaults to:
check_warnings(("", Warning), quiet=True)
"""
- quiet = kwargs.get('quiet')
+ quiet = kwargs.get("quiet")
if not filters:
filters = (("", Warning),)
# Preserve backward compatibility
@@ -99,7 +99,7 @@ def check_warnings(*filters, **kwargs):
@contextlib.contextmanager
-def check_no_warnings(testcase, message='', category=Warning, force_gc=False):
+def check_no_warnings(testcase, message="", category=Warning, force_gc=False):
"""Context manager to check that no warnings are emitted.
This context manager enables a given warning within its scope
@@ -114,7 +114,7 @@ def check_no_warnings(testcase, message='', category=Warning, force_gc=False):
"""
from test.support import gc_collect
with warnings.catch_warnings(record=True) as warns:
- warnings.filterwarnings('always',
+ warnings.filterwarnings("always",
message=message,
category=category)
yield
@@ -149,14 +149,14 @@ def _filterwarnings(filters, quiet=False):
# Clear the warning registry of the calling module
# in order to re-raise the warnings.
frame = sys._getframe(2)
- registry = frame.f_globals.get('__warningregistry__')
+ registry = frame.f_globals.get("__warningregistry__")
if registry:
registry.clear()
with warnings.catch_warnings(record=True) as w:
# Set filter "always" to record all warnings. Because
# test_warnings swap the module, we need to look up in
# the sys.modules dictionary.
- sys.modules['warnings'].simplefilter("always")
+ sys.modules["warnings"].simplefilter("always")
yield WarningsRecorder(w)
# Filter the recorded warnings
reraise = list(w)
diff --git a/.venv3.10/Lib/textwrap.py b/.venv3.10/Lib/textwrap.py
index 841de9ba..32f33928 100644
--- a/.venv3.10/Lib/textwrap.py
+++ b/.venv3.10/Lib/textwrap.py
@@ -7,12 +7,12 @@
import re
-__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']
+__all__ = ["TextWrapper", "wrap", "fill", "dedent", "indent", "shorten"]
# Hardcode the recognized whitespace characters to the US-ASCII
# whitespace characters. The main reason for doing this is that
# some Unicode spaces (like \u00a0) are non-breaking whitespaces.
-_whitespace = '\t\n\x0b\x0c\r '
+_whitespace = "\t\n\x0b\x0c\r "
class TextWrapper:
"""
@@ -64,7 +64,7 @@ class TextWrapper:
"""
unicode_whitespace_trans = {}
- uspace = ord(' ')
+ uspace = ord(" ")
for x in _whitespace:
unicode_whitespace_trans[ord(x)] = uspace
@@ -75,10 +75,10 @@ class TextWrapper:
# Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!
# (after stripping out empty strings).
word_punct = r'[\w!"\'&.,?]'
- letter = r'[^\d\W]'
- whitespace = r'[%s]' % re.escape(_whitespace)
- nowhitespace = '[^' + whitespace[1:]
- wordsep_re = re.compile(r'''
+ letter = r"[^\d\W]"
+ whitespace = r"[%s]" % re.escape(_whitespace)
+ nowhitespace = "[^" + whitespace[1:]
+ wordsep_re = re.compile(r"""
( # any whitespace
%(ws)s+
| # em-dash between words
@@ -93,8 +93,8 @@ class TextWrapper:
| # em-dash
(?<=%(wp)s) (?=-{2,}\w)
)
- )''' % {'wp': word_punct, 'lt': letter,
- 'ws': whitespace, 'nws': nowhitespace},
+ )""" % {"wp": word_punct, "lt": letter,
+ "ws": whitespace, "nws": nowhitespace},
re.VERBOSE)
del word_punct, letter, nowhitespace
@@ -102,7 +102,7 @@ class TextWrapper:
# "Hello there -- you goof-ball, use the -b option!"
# splits into
# Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
- wordsep_simple_re = re.compile(r'(%s+)' % whitespace)
+ wordsep_simple_re = re.compile(r"(%s+)" % whitespace)
del whitespace
# XXX this is not locale- or charset-aware -- string.lowercase
@@ -125,7 +125,7 @@ def __init__(self,
tabsize=8,
*,
max_lines=None,
- placeholder=' [...]'):
+ placeholder=" [...]"):
self.width = width
self.initial_indent = initial_indent
self.subsequent_indent = subsequent_indent
@@ -220,8 +220,8 @@ def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
if self.break_on_hyphens and len(chunk) > space_left:
# break after last hyphen, but only if there are
# non-hyphens before it
- hyphen = chunk.rfind('-', 0, space_left)
- if hyphen > 0 and any(c != '-' for c in chunk[:hyphen]):
+ hyphen = chunk.rfind("-", 0, space_left)
+ if hyphen > 0 and any(c != "-" for c in chunk[:hyphen]):
end = hyphen + 1
cur_line.append(chunk[:end])
reversed_chunks[-1] = chunk[end:]
@@ -284,7 +284,7 @@ def _wrap_chunks(self, chunks):
# First chunk on line is whitespace -- drop it, unless this
# is the very beginning of the text (ie. no lines started yet).
- if self.drop_whitespace and chunks[-1].strip() == '' and lines:
+ if self.drop_whitespace and chunks[-1].strip() == "" and lines:
del chunks[-1]
while chunks:
@@ -306,7 +306,7 @@ def _wrap_chunks(self, chunks):
cur_len = sum(map(len, cur_line))
# If the last chunk on this line is all whitespace, drop it.
- if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':
+ if self.drop_whitespace and cur_line and cur_line[-1].strip() == "":
cur_len -= len(cur_line[-1])
del cur_line[-1]
@@ -319,13 +319,13 @@ def _wrap_chunks(self, chunks):
not chunks[0].strip()) and cur_len <= width):
# Convert current line back to a string and store it in
# list of all lines (return value).
- lines.append(indent + ''.join(cur_line))
+ lines.append(indent + "".join(cur_line))
else:
while cur_line:
if (cur_line[-1].strip() and
cur_len + len(self.placeholder) <= width):
cur_line.append(self.placeholder)
- lines.append(indent + ''.join(cur_line))
+ lines.append(indent + "".join(cur_line))
break
cur_len -= len(cur_line[-1])
del cur_line[-1]
@@ -411,13 +411,13 @@ def shorten(text, width, **kwargs):
'Hello [...]'
"""
w = TextWrapper(width=width, max_lines=1, **kwargs)
- return w.fill(' '.join(text.strip().split()))
+ return w.fill(" ".join(text.strip().split()))
# -- Loosely related functionality -------------------------------------
-_whitespace_only_re = re.compile('^[ \t]+$', re.MULTILINE)
-_leading_whitespace_re = re.compile('(^[ \t]*)(?:[^ \t\n])', re.MULTILINE)
+_whitespace_only_re = re.compile("^[ \t]+$", re.MULTILINE)
+_leading_whitespace_re = re.compile("(^[ \t]*)(?:[^ \t\n])", re.MULTILINE)
def dedent(text):
"""Remove any common leading whitespace from every line in `text`.
@@ -435,7 +435,7 @@ def dedent(text):
# Look for the longest leading string of spaces and tabs common to
# all lines.
margin = None
- text = _whitespace_only_re.sub('', text)
+ text = _whitespace_only_re.sub("", text)
indents = _leading_whitespace_re.findall(text)
for indent in indents:
if margin is None:
@@ -466,7 +466,7 @@ def dedent(text):
"line = %r, margin = %r" % (line, margin)
if margin:
- text = re.sub(r'(?m)^' + margin, '', text)
+ text = re.sub(r"(?m)^" + margin, "", text)
return text
@@ -485,7 +485,7 @@ def predicate(line):
def prefixed_lines():
for line in text.splitlines(True):
yield (prefix + line if predicate(line) else line)
- return ''.join(prefixed_lines())
+ return "".join(prefixed_lines())
if __name__ == "__main__":
diff --git a/.venv3.10/Lib/threading.py b/.venv3.10/Lib/threading.py
index 62f49c05..c86b2cd8 100644
--- a/.venv3.10/Lib/threading.py
+++ b/.venv3.10/Lib/threading.py
@@ -7,7 +7,7 @@
from time import monotonic as _time
from _weakrefset import WeakSet
-from itertools import islice as _islice, count as _count
+from itertools import count as _count
try:
from _collections import deque as _deque
except ImportError:
@@ -23,12 +23,12 @@
# with the multiprocessing module, which doesn't provide the old
# Java inspired names.
-__all__ = ['get_ident', 'active_count', 'Condition', 'current_thread',
- 'enumerate', 'main_thread', 'TIMEOUT_MAX',
- 'Event', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
- 'Barrier', 'BrokenBarrierError', 'Timer', 'ThreadError',
- 'setprofile', 'settrace', 'local', 'stack_size',
- 'excepthook', 'ExceptHookArgs', 'gettrace', 'getprofile']
+__all__ = ["get_ident", "active_count", "Condition", "current_thread",
+ "enumerate", "main_thread", "TIMEOUT_MAX",
+ "Event", "Lock", "RLock", "Semaphore", "BoundedSemaphore", "Thread",
+ "Barrier", "BrokenBarrierError", "Timer", "ThreadError",
+ "setprofile", "settrace", "local", "stack_size",
+ "excepthook", "ExceptHookArgs", "gettrace", "getprofile"]
# Rename some stuff so "from threading import *" is safe
_start_new_thread = _thread.start_new_thread
@@ -38,7 +38,7 @@
try:
get_native_id = _thread.get_native_id
_HAVE_THREAD_NATIVE_ID = True
- __all__.append('get_native_id')
+ __all__.append("get_native_id")
except AttributeError:
_HAVE_THREAD_NATIVE_ID = False
ThreadError = _thread.error
@@ -402,7 +402,7 @@ def notifyAll(self):
"""
import warnings
- warnings.warn('notifyAll() is deprecated, use notify_all() instead',
+ warnings.warn("notifyAll() is deprecated, use notify_all() instead",
DeprecationWarning, stacklevel=2)
self.notify_all()
@@ -480,7 +480,7 @@ def release(self, n=1):
"""
if n < 1:
- raise ValueError('n must be one or more')
+ raise ValueError("n must be one or more")
with self._cond:
self._value += n
for i in range(n):
@@ -522,7 +522,7 @@ def release(self, n=1):
"""
if n < 1:
- raise ValueError('n must be one or more')
+ raise ValueError("n must be one or more")
with self._cond:
if self._value + n > self._initial_value:
raise ValueError("Semaphore released too many times")
@@ -561,7 +561,7 @@ def isSet(self):
"""
import warnings
- warnings.warn('isSet() is deprecated, use is_set() instead',
+ warnings.warn("isSet() is deprecated, use is_set() instead",
DeprecationWarning, stacklevel=2)
return self.is_set()
@@ -1210,7 +1210,7 @@ def isDaemon(self):
"""
import warnings
- warnings.warn('isDaemon() is deprecated, get the daemon attribute instead',
+ warnings.warn("isDaemon() is deprecated, get the daemon attribute instead",
DeprecationWarning, stacklevel=2)
return self.daemon
@@ -1221,7 +1221,7 @@ def setDaemon(self, daemonic):
"""
import warnings
- warnings.warn('setDaemon() is deprecated, set the daemon attribute instead',
+ warnings.warn("setDaemon() is deprecated, set the daemon attribute instead",
DeprecationWarning, stacklevel=2)
self.daemon = daemonic
@@ -1232,7 +1232,7 @@ def getName(self):
"""
import warnings
- warnings.warn('getName() is deprecated, get the name attribute instead',
+ warnings.warn("getName() is deprecated, get the name attribute instead",
DeprecationWarning, stacklevel=2)
return self.name
@@ -1243,7 +1243,7 @@ def setName(self, name):
"""
import warnings
- warnings.warn('setName() is deprecated, set the name attribute instead',
+ warnings.warn("setName() is deprecated, set the name attribute instead",
DeprecationWarning, stacklevel=2)
self.name = name
@@ -1257,8 +1257,8 @@ def setName(self, name):
from collections import namedtuple
_ExceptHookArgs = namedtuple(
- 'ExceptHookArgs',
- 'exc_type exc_value exc_traceback thread')
+ "ExceptHookArgs",
+ "exc_type exc_value exc_traceback thread")
def ExceptHookArgs(args):
return _ExceptHookArgs(*args)
@@ -1446,7 +1446,7 @@ def currentThread():
"""
import warnings
- warnings.warn('currentThread() is deprecated, use current_thread() instead',
+ warnings.warn("currentThread() is deprecated, use current_thread() instead",
DeprecationWarning, stacklevel=2)
return current_thread()
@@ -1467,7 +1467,7 @@ def activeCount():
"""
import warnings
- warnings.warn('activeCount() is deprecated, use active_count() instead',
+ warnings.warn("activeCount() is deprecated, use active_count() instead",
DeprecationWarning, stacklevel=2)
return active_count()
diff --git a/.venv3.10/Lib/timeit.py b/.venv3.10/Lib/timeit.py
index 9dfd4549..f436fc25 100644
--- a/.venv3.10/Lib/timeit.py
+++ b/.venv3.10/Lib/timeit.py
@@ -105,17 +105,17 @@ def __init__(self, stmt="pass", setup="pass", timer=default_timer,
self.timer = timer
local_ns = {}
global_ns = _globals() if globals is None else globals
- init = ''
+ init = ""
if isinstance(setup, str):
# Check that the code can be compiled outside a function
compile(setup, dummy_src_name, "exec")
- stmtprefix = setup + '\n'
+ stmtprefix = setup + "\n"
setup = reindent(setup, 4)
elif callable(setup):
- local_ns['_setup'] = setup
- init += ', _setup=_setup'
- stmtprefix = ''
- setup = '_setup()'
+ local_ns["_setup"] = setup
+ init += ", _setup=_setup"
+ stmtprefix = ""
+ setup = "_setup()"
else:
raise ValueError("setup is neither a string nor callable")
if isinstance(stmt, str):
@@ -123,9 +123,9 @@ def __init__(self, stmt="pass", setup="pass", timer=default_timer,
compile(stmtprefix + stmt, dummy_src_name, "exec")
stmt = reindent(stmt, 8)
elif callable(stmt):
- local_ns['_stmt'] = stmt
- init += ', _stmt=_stmt'
- stmt = '_stmt()'
+ local_ns["_stmt"] = stmt
+ init += ", _stmt=_stmt"
+ stmt = "_stmt()"
else:
raise ValueError("stmt is neither a string nor callable")
src = template.format(stmt=stmt, setup=setup, init=init)
@@ -151,7 +151,8 @@ def print_exc(self, file=None):
The optional file argument directs where the traceback is
sent; it defaults to sys.stderr.
"""
- import linecache, traceback
+ import linecache
+ import traceback
if self.src is not None:
linecache.cache[dummy_src_name] = (len(self.src),
None,
@@ -300,7 +301,7 @@ def main(args=None, *, _wrap_timer=None):
precision += 1
verbose += 1
if o in ("-h", "--help"):
- print(__doc__, end=' ')
+ print(__doc__, end=" ")
return 0
setup = "\n".join(setup) or "pass"
@@ -320,7 +321,7 @@ def main(args=None, *, _wrap_timer=None):
def callback(number, time_taken):
msg = "{num} loop{s} -> {secs:.{prec}g} secs"
plural = (number != 1)
- print(msg.format(num=number, s='s' if plural else '',
+ print(msg.format(num=number, s="s" if plural else "",
secs=time_taken, prec=precision))
try:
number, _ = t.autorange(callback)
@@ -358,7 +359,7 @@ def format_time(dt):
best = min(timings)
print("%d loop%s, best of %d: %s per loop"
- % (number, 's' if number != 1 else '',
+ % (number, "s" if number != 1 else "",
repeat, format_time(best)))
best = min(timings)
@@ -369,7 +370,7 @@ def format_time(dt):
"The worst time (%s) was more than four times "
"slower than the best time (%s)."
% (format_time(worst), format_time(best)),
- UserWarning, '', 0)
+ UserWarning, "", 0)
return None
if __name__ == "__main__":
diff --git a/.venv3.10/Lib/tkinter/__init__.py b/.venv3.10/Lib/tkinter/__init__.py
index 7b8dc7bd..f8793690 100644
--- a/.venv3.10/Lib/tkinter/__init__.py
+++ b/.venv3.10/Lib/tkinter/__init__.py
@@ -49,13 +49,13 @@
EXCEPTION = _tkinter.EXCEPTION
-_magic_re = re.compile(r'([\\{}])')
-_space_re = re.compile(r'([\s])', re.ASCII)
+_magic_re = re.compile(r"([\\{}])")
+_space_re = re.compile(r"([\s])", re.ASCII)
def _join(value):
"""Internal function."""
- return ' '.join(map(_stringify, value))
+ return " ".join(map(_stringify, value))
def _stringify(value):
@@ -64,22 +64,22 @@ def _stringify(value):
if len(value) == 1:
value = _stringify(value[0])
if _magic_re.search(value):
- value = '{%s}' % value
+ value = "{%s}" % value
else:
- value = '{%s}' % _join(value)
+ value = "{%s}" % _join(value)
else:
value = str(value)
if not value:
- value = '{}'
+ value = "{}"
elif _magic_re.search(value):
# add '\' before special characters and spaces
- value = _magic_re.sub(r'\\\1', value)
- value = value.replace('\n', r'\n')
- value = _space_re.sub(r'\\\1', value)
+ value = _magic_re.sub(r"\\\1", value)
+ value = value.replace("\n", r"\n")
+ value = _space_re.sub(r"\\\1", value)
if value[0] == '"':
- value = '\\' + value
+ value = "\\" + value
elif value[0] == '"' or _space_re.search(value):
- value = '{%s}' % value
+ value = "{%s}" % value
return value
@@ -130,13 +130,13 @@ def _splitdict(tk, v, cut_minus=True, conv=None):
"""
t = tk.splitlist(v)
if len(t) % 2:
- raise RuntimeError('Tcl list representing a dict is expected '
- 'to contain an even number of elements')
+ raise RuntimeError("Tcl list representing a dict is expected "
+ "to contain an even number of elements")
it = iter(t)
dict = {}
for key, value in zip(it, it):
key = str(key)
- if cut_minus and key[0] == '-':
+ if cut_minus and key[0] == "-":
key = key[1:]
if conv:
value = conv(value)
@@ -145,45 +145,45 @@ def _splitdict(tk, v, cut_minus=True, conv=None):
class EventType(str, enum.Enum):
- KeyPress = '2'
+ KeyPress = "2"
Key = KeyPress
- KeyRelease = '3'
- ButtonPress = '4'
+ KeyRelease = "3"
+ ButtonPress = "4"
Button = ButtonPress
- ButtonRelease = '5'
- Motion = '6'
- Enter = '7'
- Leave = '8'
- FocusIn = '9'
- FocusOut = '10'
- Keymap = '11' # undocumented
- Expose = '12'
- GraphicsExpose = '13' # undocumented
- NoExpose = '14' # undocumented
- Visibility = '15'
- Create = '16'
- Destroy = '17'
- Unmap = '18'
- Map = '19'
- MapRequest = '20'
- Reparent = '21'
- Configure = '22'
- ConfigureRequest = '23'
- Gravity = '24'
- ResizeRequest = '25'
- Circulate = '26'
- CirculateRequest = '27'
- Property = '28'
- SelectionClear = '29' # undocumented
- SelectionRequest = '30' # undocumented
- Selection = '31' # undocumented
- Colormap = '32'
- ClientMessage = '33' # undocumented
- Mapping = '34' # undocumented
- VirtualEvent = '35' # undocumented
- Activate = '36'
- Deactivate = '37'
- MouseWheel = '38'
+ ButtonRelease = "5"
+ Motion = "6"
+ Enter = "7"
+ Leave = "8"
+ FocusIn = "9"
+ FocusOut = "10"
+ Keymap = "11" # undocumented
+ Expose = "12"
+ GraphicsExpose = "13" # undocumented
+ NoExpose = "14" # undocumented
+ Visibility = "15"
+ Create = "16"
+ Destroy = "17"
+ Unmap = "18"
+ Map = "19"
+ MapRequest = "20"
+ Reparent = "21"
+ Configure = "22"
+ ConfigureRequest = "23"
+ Gravity = "24"
+ ResizeRequest = "25"
+ Circulate = "26"
+ CirculateRequest = "27"
+ Property = "28"
+ SelectionClear = "29" # undocumented
+ SelectionRequest = "30" # undocumented
+ Selection = "31" # undocumented
+ Colormap = "32"
+ ClientMessage = "33" # undocumented
+ Mapping = "34" # undocumented
+ VirtualEvent = "35" # undocumented
+ Activate = "36"
+ Deactivate = "37"
+ MouseWheel = "38"
__str__ = str.__str__
@@ -232,20 +232,20 @@ class Event:
"""
def __repr__(self):
- attrs = {k: v for k, v in self.__dict__.items() if v != '??'}
+ attrs = {k: v for k, v in self.__dict__.items() if v != "??"}
if not self.char:
- del attrs['char']
- elif self.char != '??':
- attrs['char'] = repr(self.char)
- if not getattr(self, 'send_event', True):
- del attrs['send_event']
+ del attrs["char"]
+ elif self.char != "??":
+ attrs["char"] = repr(self.char)
+ if not getattr(self, "send_event", True):
+ del attrs["send_event"]
if self.state == 0:
- del attrs['state']
+ del attrs["state"]
elif isinstance(self.state, int):
state = self.state
- mods = ('Shift', 'Lock', 'Control',
- 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5',
- 'Button1', 'Button2', 'Button3', 'Button4', 'Button5')
+ mods = ("Shift", "Lock", "Control",
+ "Mod1", "Mod2", "Mod3", "Mod4", "Mod5",
+ "Button1", "Button2", "Button3", "Button4", "Button5")
s = []
for i, n in enumerate(mods):
if state & (1 << i):
@@ -253,20 +253,20 @@ def __repr__(self):
state = state & ~((1<< len(mods)) - 1)
if state or not s:
s.append(hex(state))
- attrs['state'] = '|'.join(s)
+ attrs["state"] = "|".join(s)
if self.delta == 0:
- del attrs['delta']
+ del attrs["delta"]
# widget usually is known
# serial and time are not very interesting
# keysym_num duplicates keysym
# x_root and y_root mostly duplicate x and y
- keys = ('send_event',
- 'state', 'keysym', 'keycode', 'char',
- 'num', 'delta', 'focus',
- 'x', 'y', 'width', 'height')
- return '<%s event%s>' % (
- getattr(self.type, 'name', self.type),
- ''.join(' %s=%s' % (k, attrs[k]) for k in keys if k in attrs)
+ keys = ("send_event",
+ "state", "keysym", "keycode", "char",
+ "num", "delta", "focus",
+ "x", "y", "width", "height")
+ return "<%s event%s>" % (
+ getattr(self.type, "name", self.type),
+ "".join(" %s=%s" % (k, attrs[k]) for k in keys if k in attrs)
)
@@ -318,7 +318,7 @@ def _get_temp_root():
def _destroy_temp_root(master):
- if getattr(master, '_temporary', False):
+ if getattr(master, "_temporary", False):
try:
master.destroy()
except TclError:
@@ -368,13 +368,13 @@ def __init__(self, master=None, value=None, name=None):
raise TypeError("name must be a string")
global _varnum
if master is None:
- master = _get_default_root('create variable')
+ master = _get_default_root("create variable")
self._root = master._root()
self._tk = master.tk
if name:
self._name = name
else:
- self._name = 'PY_VAR' + repr(_varnum)
+ self._name = "PY_VAR" + repr(_varnum)
_varnum += 1
if value is not None:
self.initialize(value)
@@ -435,7 +435,7 @@ def trace_add(self, mode, callback):
Return the name of the callback.
"""
cbname = self._register(callback)
- self._tk.call('trace', 'add', 'variable',
+ self._tk.call("trace", "add", "variable",
self._name, mode, (cbname,))
return cbname
@@ -446,7 +446,7 @@ def trace_remove(self, mode, cbname):
such strings. Must be same as were specified in trace_add().
cbname is the name of the callback returned from trace_add().
"""
- self._tk.call('trace', 'remove', 'variable',
+ self._tk.call("trace", "remove", "variable",
self._name, mode, cbname)
for m, ca in self.trace_info():
if self._tk.splitlist(ca)[0] == cbname:
@@ -462,7 +462,7 @@ def trace_info(self):
"""Return all trace callback information."""
splitlist = self._tk.splitlist
return [(splitlist(k), v) for k, v in map(splitlist,
- splitlist(self._tk.call('trace', 'info', 'variable', self._name)))]
+ splitlist(self._tk.call("trace", "info", "variable", self._name)))]
def trace_variable(self, mode, callback):
"""Define a trace callback for the variable.
@@ -625,7 +625,7 @@ def get(self):
def mainloop(n=0):
"""Run the main loop of Tcl."""
- _get_default_root('run the main loop').tk.mainloop(n)
+ _get_default_root("run the main loop").tk.mainloop(n)
getint = int
@@ -636,7 +636,7 @@ def mainloop(n=0):
def getboolean(s):
"""Convert Tcl object to True or False."""
try:
- return _get_default_root('use getboolean()').tk.getboolean(s)
+ return _get_default_root("use getboolean()").tk.getboolean(s)
except TclError:
raise ValueError("invalid literal for getboolean()")
@@ -684,11 +684,11 @@ def tk_strictMotif(self, boolean=None):
change if mouse passes over slider).
Returns the set value."""
return self.tk.getboolean(self.tk.call(
- 'set', 'tk_strictMotif', boolean))
+ "set", "tk_strictMotif", boolean))
def tk_bisque(self):
"""Change the color scheme to light brown as used in Tk 3.6 and before."""
- self.tk.call('tk_bisque')
+ self.tk.call("tk_bisque")
def tk_setPalette(self, *args, **kw):
"""Set a new color scheme for all widget elements.
@@ -701,15 +701,15 @@ def tk_setPalette(self, *args, **kw):
activeForeground, highlightBackground, selectBackground,
background, highlightColor, selectForeground,
disabledForeground, insertBackground, troughColor."""
- self.tk.call(('tk_setPalette',)
+ self.tk.call(("tk_setPalette",)
+ _flatten(args) + _flatten(list(kw.items())))
- def wait_variable(self, name='PY_VAR'):
+ def wait_variable(self, name="PY_VAR"):
"""Wait until the variable is modified.
A parameter of type IntVar, StringVar, DoubleVar or
BooleanVar must be given."""
- self.tk.call('tkwait', 'variable', name)
+ self.tk.call("tkwait", "variable", name)
waitvar = wait_variable # XXX b/w compat
def wait_window(self, window=None):
@@ -718,7 +718,7 @@ def wait_window(self, window=None):
If no parameter is given self is used."""
if window is None:
window = self
- self.tk.call('tkwait', 'window', window._w)
+ self.tk.call("tkwait", "window", window._w)
def wait_visibility(self, window=None):
"""Wait until the visibility of a WIDGET changes
@@ -727,13 +727,13 @@ def wait_visibility(self, window=None):
If no parameter is given self is used."""
if window is None:
window = self
- self.tk.call('tkwait', 'visibility', window._w)
+ self.tk.call("tkwait", "visibility", window._w)
- def setvar(self, name='PY_VAR', value='1'):
+ def setvar(self, name="PY_VAR", value="1"):
"""Set Tcl variable NAME to VALUE."""
self.tk.setvar(name, value)
- def getvar(self, name='PY_VAR'):
+ def getvar(self, name="PY_VAR"):
"""Return value of Tcl variable NAME."""
return self.tk.getvar(name)
@@ -762,14 +762,14 @@ def focus_set(self):
If the application currently does not have the focus
this widget will get the focus if the application gets
the focus through the window manager."""
- self.tk.call('focus', self._w)
+ self.tk.call("focus", self._w)
focus = focus_set # XXX b/w compat?
def focus_force(self):
"""Direct input focus to this widget even if the
application does not have the focus. Use with
caution!"""
- self.tk.call('focus', '-force', self._w)
+ self.tk.call("focus", "-force", self._w)
def focus_get(self):
"""Return the widget which has currently the focus in the
@@ -778,8 +778,8 @@ def focus_get(self):
Use focus_displayof to allow working with several
displays. Return None if application does not have
the focus."""
- name = self.tk.call('focus')
- if name == 'none' or not name: return None
+ name = self.tk.call("focus")
+ if name == "none" or not name: return None
return self._nametowidget(name)
def focus_displayof(self):
@@ -787,21 +787,21 @@ def focus_displayof(self):
display where this widget is located.
Return None if the application does not have the focus."""
- name = self.tk.call('focus', '-displayof', self._w)
- if name == 'none' or not name: return None
+ name = self.tk.call("focus", "-displayof", self._w)
+ if name == "none" or not name: return None
return self._nametowidget(name)
def focus_lastfor(self):
"""Return the widget which would have the focus if top level
for this widget gets the focus from the window manager."""
- name = self.tk.call('focus', '-lastfor', self._w)
- if name == 'none' or not name: return None
+ name = self.tk.call("focus", "-lastfor", self._w)
+ if name == "none" or not name: return None
return self._nametowidget(name)
def tk_focusFollowsMouse(self):
"""The widget under mouse will get automatically focus. Can not
be disabled easily."""
- self.tk.call('tk_focusFollowsMouse')
+ self.tk.call("tk_focusFollowsMouse")
def tk_focusNext(self):
"""Return the next widget in the focus order which follows
@@ -812,13 +812,13 @@ def tk_focusNext(self):
next sibling which is higher in the stacking order. A
widget is omitted if it has the takefocus resource set
to 0."""
- name = self.tk.call('tk_focusNext', self._w)
+ name = self.tk.call("tk_focusNext", self._w)
if not name: return None
return self._nametowidget(name)
def tk_focusPrev(self):
"""Return previous widget in the focus order. See tk_focusNext for details."""
- name = self.tk.call('tk_focusPrev', self._w)
+ name = self.tk.call("tk_focusPrev", self._w)
if not name: return None
return self._nametowidget(name)
@@ -831,7 +831,7 @@ def after(self, ms, func=None, *args):
identifier to cancel scheduling with after_cancel."""
if func is None:
# I'd rather use time.sleep(ms*0.001)
- self.tk.call('after', ms)
+ self.tk.call("after", ms)
return None
else:
def callit():
@@ -848,7 +848,7 @@ def callit():
# Required for callable classes (bpo-44404)
callit.__name__ = type(func).__name__
name = self._register(callit)
- return self.tk.call('after', ms, name)
+ return self.tk.call("after", ms, name)
def after_idle(self, func, *args):
"""Call FUNC once if the Tcl main loop has no event to
@@ -856,7 +856,7 @@ def after_idle(self, func, *args):
Return an identifier to cancel the scheduling with
after_cancel."""
- return self.after('idle', func, *args)
+ return self.after("idle", func, *args)
def after_cancel(self, id):
"""Cancel scheduling of function identified with ID.
@@ -865,19 +865,19 @@ def after_cancel(self, id):
given as first parameter.
"""
if not id:
- raise ValueError('id must be a valid identifier returned from '
- 'after or after_idle')
+ raise ValueError("id must be a valid identifier returned from "
+ "after or after_idle")
try:
- data = self.tk.call('after', 'info', id)
+ data = self.tk.call("after", "info", id)
script = self.tk.splitlist(data)[0]
self.deletecommand(script)
except TclError:
pass
- self.tk.call('after', 'cancel', id)
+ self.tk.call("after", "cancel", id)
def bell(self, displayof=0):
"""Ring a display's bell."""
- self.tk.call(('bell',) + self._displayof(displayof))
+ self.tk.call(("bell",) + self._displayof(displayof))
# Clipboard handling:
def clipboard_get(self, **kw):
@@ -895,21 +895,21 @@ def clipboard_get(self, **kw):
selection_get(CLIPBOARD)
"""
- if 'type' not in kw and self._windowingsystem == 'x11':
+ if "type" not in kw and self._windowingsystem == "x11":
try:
- kw['type'] = 'UTF8_STRING'
- return self.tk.call(('clipboard', 'get') + self._options(kw))
+ kw["type"] = "UTF8_STRING"
+ return self.tk.call(("clipboard", "get") + self._options(kw))
except TclError:
- del kw['type']
- return self.tk.call(('clipboard', 'get') + self._options(kw))
+ del kw["type"]
+ return self.tk.call(("clipboard", "get") + self._options(kw))
def clipboard_clear(self, **kw):
"""Clear the data in the Tk clipboard.
A widget specified for the optional displayof keyword
argument specifies the target display."""
- if 'displayof' not in kw: kw['displayof'] = self._w
- self.tk.call(('clipboard', 'clear') + self._options(kw))
+ if "displayof" not in kw: kw["displayof"] = self._w
+ self.tk.call(("clipboard", "clear") + self._options(kw))
def clipboard_append(self, string, **kw):
"""Append STRING to the Tk clipboard.
@@ -917,28 +917,28 @@ def clipboard_append(self, string, **kw):
A widget specified at the optional displayof keyword
argument specifies the target display. The clipboard
can be retrieved with selection_get."""
- if 'displayof' not in kw: kw['displayof'] = self._w
- self.tk.call(('clipboard', 'append') + self._options(kw)
- + ('--', string))
+ if "displayof" not in kw: kw["displayof"] = self._w
+ self.tk.call(("clipboard", "append") + self._options(kw)
+ + ("--", string))
# XXX grab current w/o window argument
def grab_current(self):
"""Return widget which has currently the grab in this application
or None."""
- name = self.tk.call('grab', 'current', self._w)
+ name = self.tk.call("grab", "current", self._w)
if not name: return None
return self._nametowidget(name)
def grab_release(self):
"""Release grab for this widget if currently set."""
- self.tk.call('grab', 'release', self._w)
+ self.tk.call("grab", "release", self._w)
def grab_set(self):
"""Set grab for this widget.
A grab directs all events to this and descendant
widgets in the application."""
- self.tk.call('grab', 'set', self._w)
+ self.tk.call("grab", "set", self._w)
def grab_set_global(self):
"""Set global grab for this widget.
@@ -946,13 +946,13 @@ def grab_set_global(self):
A global grab directs all events to this and
descendant widgets on the display. Use with caution -
other applications do not get events anymore."""
- self.tk.call('grab', 'set', '-global', self._w)
+ self.tk.call("grab", "set", "-global", self._w)
def grab_status(self):
"""Return None, "local" or "global" if this widget has
no, a local or a global grab."""
- status = self.tk.call('grab', 'status', self._w)
- if status == 'none': status = None
+ status = self.tk.call("grab", "status", self._w)
+ if status == "none": status = None
return status
def option_add(self, pattern, value, priority = None):
@@ -961,32 +961,32 @@ def option_add(self, pattern, value, priority = None):
An optional third parameter gives the numeric priority
(defaults to 80)."""
- self.tk.call('option', 'add', pattern, value, priority)
+ self.tk.call("option", "add", pattern, value, priority)
def option_clear(self):
"""Clear the option database.
It will be reloaded if option_add is called."""
- self.tk.call('option', 'clear')
+ self.tk.call("option", "clear")
def option_get(self, name, className):
"""Return the value for an option NAME for this widget
with CLASSNAME.
Values with higher priority override lower values."""
- return self.tk.call('option', 'get', self._w, name, className)
+ return self.tk.call("option", "get", self._w, name, className)
def option_readfile(self, fileName, priority = None):
"""Read file FILENAME into the option database.
An optional second parameter gives the numeric
priority."""
- self.tk.call('option', 'readfile', fileName, priority)
+ self.tk.call("option", "readfile", fileName, priority)
def selection_clear(self, **kw):
"""Clear the current X selection."""
- if 'displayof' not in kw: kw['displayof'] = self._w
- self.tk.call(('selection', 'clear') + self._options(kw))
+ if "displayof" not in kw: kw["displayof"] = self._w
+ self.tk.call(("selection", "clear") + self._options(kw))
def selection_get(self, **kw):
"""Return the contents of the current X selection.
@@ -997,14 +997,14 @@ def selection_get(self, **kw):
to use. A keyword parameter type specifies the form of data to be
fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
before STRING."""
- if 'displayof' not in kw: kw['displayof'] = self._w
- if 'type' not in kw and self._windowingsystem == 'x11':
+ if "displayof" not in kw: kw["displayof"] = self._w
+ if "type" not in kw and self._windowingsystem == "x11":
try:
- kw['type'] = 'UTF8_STRING'
- return self.tk.call(('selection', 'get') + self._options(kw))
+ kw["type"] = "UTF8_STRING"
+ return self.tk.call(("selection", "get") + self._options(kw))
except TclError:
- del kw['type']
- return self.tk.call(('selection', 'get') + self._options(kw))
+ del kw["type"]
+ return self.tk.call(("selection", "get") + self._options(kw))
def selection_handle(self, command, **kw):
"""Specify a function COMMAND to call if the X
@@ -1019,7 +1019,7 @@ def selection_handle(self, command, **kw):
selection - name of the selection (default PRIMARY),
type - type of the selection (e.g. STRING, FILE_NAME)."""
name = self._register(command)
- self.tk.call(('selection', 'handle') + self._options(kw)
+ self.tk.call(("selection", "handle") + self._options(kw)
+ (self._w, name))
def selection_own(self, **kw):
@@ -1027,7 +1027,7 @@ def selection_own(self, **kw):
A keyword parameter selection specifies the name of
the selection (default PRIMARY)."""
- self.tk.call(('selection', 'own') +
+ self.tk.call(("selection", "own") +
self._options(kw) + (self._w,))
def selection_own_get(self, **kw):
@@ -1037,46 +1037,46 @@ def selection_own_get(self, **kw):
be provided:
selection - name of the selection (default PRIMARY),
type - type of the selection (e.g. STRING, FILE_NAME)."""
- if 'displayof' not in kw: kw['displayof'] = self._w
- name = self.tk.call(('selection', 'own') + self._options(kw))
+ if "displayof" not in kw: kw["displayof"] = self._w
+ name = self.tk.call(("selection", "own") + self._options(kw))
if not name: return None
return self._nametowidget(name)
def send(self, interp, cmd, *args):
"""Send Tcl command CMD to different interpreter INTERP to be executed."""
- return self.tk.call(('send', interp, cmd) + args)
+ return self.tk.call(("send", interp, cmd) + args)
def lower(self, belowThis=None):
"""Lower this widget in the stacking order."""
- self.tk.call('lower', self._w, belowThis)
+ self.tk.call("lower", self._w, belowThis)
def tkraise(self, aboveThis=None):
"""Raise this widget in the stacking order."""
- self.tk.call('raise', self._w, aboveThis)
+ self.tk.call("raise", self._w, aboveThis)
lift = tkraise
def winfo_atom(self, name, displayof=0):
"""Return integer which represents atom NAME."""
- args = ('winfo', 'atom') + self._displayof(displayof) + (name,)
+ args = ("winfo", "atom") + self._displayof(displayof) + (name,)
return self.tk.getint(self.tk.call(args))
def winfo_atomname(self, id, displayof=0):
"""Return name of atom with identifier ID."""
- args = ('winfo', 'atomname') \
+ args = ("winfo", "atomname") \
+ self._displayof(displayof) + (id,)
return self.tk.call(args)
def winfo_cells(self):
"""Return number of cells in the colormap for this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'cells', self._w))
+ self.tk.call("winfo", "cells", self._w))
def winfo_children(self):
"""Return a list of all widgets which are children of this widget."""
result = []
for child in self.tk.splitlist(
- self.tk.call('winfo', 'children', self._w)):
+ self.tk.call("winfo", "children", self._w)):
try:
# Tcl sometimes returns extra windows, e.g. for
# menus; those need to be skipped
@@ -1087,16 +1087,16 @@ def winfo_children(self):
def winfo_class(self):
"""Return window class name of this widget."""
- return self.tk.call('winfo', 'class', self._w)
+ return self.tk.call("winfo", "class", self._w)
def winfo_colormapfull(self):
"""Return True if at the last color request the colormap was full."""
return self.tk.getboolean(
- self.tk.call('winfo', 'colormapfull', self._w))
+ self.tk.call("winfo", "colormapfull", self._w))
def winfo_containing(self, rootX, rootY, displayof=0):
"""Return the widget which is at the root coordinates ROOTX, ROOTY."""
- args = ('winfo', 'containing') \
+ args = ("winfo", "containing") \
+ self._displayof(displayof) + (rootX, rootY)
name = self.tk.call(args)
if not name: return None
@@ -1104,177 +1104,177 @@ def winfo_containing(self, rootX, rootY, displayof=0):
def winfo_depth(self):
"""Return the number of bits per pixel."""
- return self.tk.getint(self.tk.call('winfo', 'depth', self._w))
+ return self.tk.getint(self.tk.call("winfo", "depth", self._w))
def winfo_exists(self):
"""Return true if this widget exists."""
return self.tk.getint(
- self.tk.call('winfo', 'exists', self._w))
+ self.tk.call("winfo", "exists", self._w))
def winfo_fpixels(self, number):
"""Return the number of pixels for the given distance NUMBER
(e.g. "3c") as float."""
return self.tk.getdouble(self.tk.call(
- 'winfo', 'fpixels', self._w, number))
+ "winfo", "fpixels", self._w, number))
def winfo_geometry(self):
"""Return geometry string for this widget in the form "widthxheight+X+Y"."""
- return self.tk.call('winfo', 'geometry', self._w)
+ return self.tk.call("winfo", "geometry", self._w)
def winfo_height(self):
"""Return height of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'height', self._w))
+ self.tk.call("winfo", "height", self._w))
def winfo_id(self):
"""Return identifier ID for this widget."""
- return int(self.tk.call('winfo', 'id', self._w), 0)
+ return int(self.tk.call("winfo", "id", self._w), 0)
def winfo_interps(self, displayof=0):
"""Return the name of all Tcl interpreters for this display."""
- args = ('winfo', 'interps') + self._displayof(displayof)
+ args = ("winfo", "interps") + self._displayof(displayof)
return self.tk.splitlist(self.tk.call(args))
def winfo_ismapped(self):
"""Return true if this widget is mapped."""
return self.tk.getint(
- self.tk.call('winfo', 'ismapped', self._w))
+ self.tk.call("winfo", "ismapped", self._w))
def winfo_manager(self):
"""Return the window manager name for this widget."""
- return self.tk.call('winfo', 'manager', self._w)
+ return self.tk.call("winfo", "manager", self._w)
def winfo_name(self):
"""Return the name of this widget."""
- return self.tk.call('winfo', 'name', self._w)
+ return self.tk.call("winfo", "name", self._w)
def winfo_parent(self):
"""Return the name of the parent of this widget."""
- return self.tk.call('winfo', 'parent', self._w)
+ return self.tk.call("winfo", "parent", self._w)
def winfo_pathname(self, id, displayof=0):
"""Return the pathname of the widget given by ID."""
- args = ('winfo', 'pathname') \
+ args = ("winfo", "pathname") \
+ self._displayof(displayof) + (id,)
return self.tk.call(args)
def winfo_pixels(self, number):
"""Rounded integer value of winfo_fpixels."""
return self.tk.getint(
- self.tk.call('winfo', 'pixels', self._w, number))
+ self.tk.call("winfo", "pixels", self._w, number))
def winfo_pointerx(self):
"""Return the x coordinate of the pointer on the root window."""
return self.tk.getint(
- self.tk.call('winfo', 'pointerx', self._w))
+ self.tk.call("winfo", "pointerx", self._w))
def winfo_pointerxy(self):
"""Return a tuple of x and y coordinates of the pointer on the root window."""
return self._getints(
- self.tk.call('winfo', 'pointerxy', self._w))
+ self.tk.call("winfo", "pointerxy", self._w))
def winfo_pointery(self):
"""Return the y coordinate of the pointer on the root window."""
return self.tk.getint(
- self.tk.call('winfo', 'pointery', self._w))
+ self.tk.call("winfo", "pointery", self._w))
def winfo_reqheight(self):
"""Return requested height of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'reqheight', self._w))
+ self.tk.call("winfo", "reqheight", self._w))
def winfo_reqwidth(self):
"""Return requested width of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'reqwidth', self._w))
+ self.tk.call("winfo", "reqwidth", self._w))
def winfo_rgb(self, color):
"""Return a tuple of integer RGB values in range(65536) for color in this widget."""
return self._getints(
- self.tk.call('winfo', 'rgb', self._w, color))
+ self.tk.call("winfo", "rgb", self._w, color))
def winfo_rootx(self):
"""Return x coordinate of upper left corner of this widget on the
root window."""
return self.tk.getint(
- self.tk.call('winfo', 'rootx', self._w))
+ self.tk.call("winfo", "rootx", self._w))
def winfo_rooty(self):
"""Return y coordinate of upper left corner of this widget on the
root window."""
return self.tk.getint(
- self.tk.call('winfo', 'rooty', self._w))
+ self.tk.call("winfo", "rooty", self._w))
def winfo_screen(self):
"""Return the screen name of this widget."""
- return self.tk.call('winfo', 'screen', self._w)
+ return self.tk.call("winfo", "screen", self._w)
def winfo_screencells(self):
"""Return the number of the cells in the colormap of the screen
of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'screencells', self._w))
+ self.tk.call("winfo", "screencells", self._w))
def winfo_screendepth(self):
"""Return the number of bits per pixel of the root window of the
screen of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'screendepth', self._w))
+ self.tk.call("winfo", "screendepth", self._w))
def winfo_screenheight(self):
"""Return the number of pixels of the height of the screen of this widget
in pixel."""
return self.tk.getint(
- self.tk.call('winfo', 'screenheight', self._w))
+ self.tk.call("winfo", "screenheight", self._w))
def winfo_screenmmheight(self):
"""Return the number of pixels of the height of the screen of
this widget in mm."""
return self.tk.getint(
- self.tk.call('winfo', 'screenmmheight', self._w))
+ self.tk.call("winfo", "screenmmheight", self._w))
def winfo_screenmmwidth(self):
"""Return the number of pixels of the width of the screen of
this widget in mm."""
return self.tk.getint(
- self.tk.call('winfo', 'screenmmwidth', self._w))
+ self.tk.call("winfo", "screenmmwidth", self._w))
def winfo_screenvisual(self):
"""Return one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the default
colormodel of this screen."""
- return self.tk.call('winfo', 'screenvisual', self._w)
+ return self.tk.call("winfo", "screenvisual", self._w)
def winfo_screenwidth(self):
"""Return the number of pixels of the width of the screen of
this widget in pixel."""
return self.tk.getint(
- self.tk.call('winfo', 'screenwidth', self._w))
+ self.tk.call("winfo", "screenwidth", self._w))
def winfo_server(self):
"""Return information of the X-Server of the screen of this widget in
the form "XmajorRminor vendor vendorVersion"."""
- return self.tk.call('winfo', 'server', self._w)
+ return self.tk.call("winfo", "server", self._w)
def winfo_toplevel(self):
"""Return the toplevel widget of this widget."""
return self._nametowidget(self.tk.call(
- 'winfo', 'toplevel', self._w))
+ "winfo", "toplevel", self._w))
def winfo_viewable(self):
"""Return true if the widget and all its higher ancestors are mapped."""
return self.tk.getint(
- self.tk.call('winfo', 'viewable', self._w))
+ self.tk.call("winfo", "viewable", self._w))
def winfo_visual(self):
"""Return one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the
colormodel of this widget."""
- return self.tk.call('winfo', 'visual', self._w)
+ return self.tk.call("winfo", "visual", self._w)
def winfo_visualid(self):
"""Return the X identifier for the visual for this widget."""
- return self.tk.call('winfo', 'visualid', self._w)
+ return self.tk.call("winfo", "visualid", self._w)
def winfo_visualsavailable(self, includeids=False):
"""Return a list of all visuals available for the screen
@@ -1282,8 +1282,8 @@ def winfo_visualsavailable(self, includeids=False):
Each item in the list consists of a visual name (see winfo_visual), a
depth and if includeids is true is given also the X identifier."""
- data = self.tk.call('winfo', 'visualsavailable', self._w,
- 'includeids' if includeids else None)
+ data = self.tk.call("winfo", "visualsavailable", self._w,
+ "includeids" if includeids else None)
data = [self.tk.splitlist(x) for x in self.tk.splitlist(data)]
return [self.__winfo_parseitem(x) for x in data]
@@ -1300,53 +1300,53 @@ def winfo_vrootheight(self):
widget in pixels. If there is no virtual root window return the
height of the screen."""
return self.tk.getint(
- self.tk.call('winfo', 'vrootheight', self._w))
+ self.tk.call("winfo", "vrootheight", self._w))
def winfo_vrootwidth(self):
"""Return the width of the virtual root window associated with this
widget in pixel. If there is no virtual root window return the
width of the screen."""
return self.tk.getint(
- self.tk.call('winfo', 'vrootwidth', self._w))
+ self.tk.call("winfo", "vrootwidth", self._w))
def winfo_vrootx(self):
"""Return the x offset of the virtual root relative to the root
window of the screen of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'vrootx', self._w))
+ self.tk.call("winfo", "vrootx", self._w))
def winfo_vrooty(self):
"""Return the y offset of the virtual root relative to the root
window of the screen of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'vrooty', self._w))
+ self.tk.call("winfo", "vrooty", self._w))
def winfo_width(self):
"""Return the width of this widget."""
return self.tk.getint(
- self.tk.call('winfo', 'width', self._w))
+ self.tk.call("winfo", "width", self._w))
def winfo_x(self):
"""Return the x coordinate of the upper left corner of this widget
in the parent."""
return self.tk.getint(
- self.tk.call('winfo', 'x', self._w))
+ self.tk.call("winfo", "x", self._w))
def winfo_y(self):
"""Return the y coordinate of the upper left corner of this widget
in the parent."""
return self.tk.getint(
- self.tk.call('winfo', 'y', self._w))
+ self.tk.call("winfo", "y", self._w))
def update(self):
"""Enter event loop until all pending events have been processed by Tcl."""
- self.tk.call('update')
+ self.tk.call("update")
def update_idletasks(self):
"""Enter event loop until all idle callbacks have been called. This
will update the display of windows but not process events caused by
the user."""
- self.tk.call('update', 'idletasks')
+ self.tk.call("update", "idletasks")
def bindtags(self, tagList=None):
"""Set or get the list of bindtags for this widget.
@@ -1357,9 +1357,9 @@ def bindtags(self, tagList=None):
processed (see bind)."""
if tagList is None:
return self.tk.splitlist(
- self.tk.call('bindtags', self._w))
+ self.tk.call("bindtags", self._w))
else:
- self.tk.call('bindtags', self._w, tagList)
+ self.tk.call("bindtags", self._w, tagList)
def _bind(self, what, sequence, func, add, needcleanup=1):
"""Internal function."""
@@ -1370,7 +1370,7 @@ def _bind(self, what, sequence, func, add, needcleanup=1):
needcleanup)
cmd = ('%sif {"[%s %s]" == "break"} break\n'
%
- (add and '+' or '',
+ (add and "+" or "",
funcid, self._subst_format_str))
self.tk.call(what + (sequence, cmd))
return funcid
@@ -1418,12 +1418,12 @@ def bind(self, sequence=None, func=None, add=None):
If FUNC or SEQUENCE is omitted the bound function or list
of bound events are returned."""
- return self._bind(('bind', self._w), sequence, func, add)
+ return self._bind(("bind", self._w), sequence, func, add)
def unbind(self, sequence, funcid=None):
"""Unbind for this widget for event SEQUENCE the
function identified with FUNCID."""
- self.tk.call('bind', self._w, sequence, '')
+ self.tk.call("bind", self._w, sequence, "")
if funcid:
self.deletecommand(funcid)
@@ -1432,11 +1432,11 @@ def bind_all(self, sequence=None, func=None, add=None):
An additional boolean parameter ADD specifies whether FUNC will
be called additionally to the other bound function or whether
it will replace the previous function. See bind for the return value."""
- return self._bind(('bind', 'all'), sequence, func, add, 0)
+ return self._bind(("bind", "all"), sequence, func, add, 0)
def unbind_all(self, sequence):
"""Unbind for all widgets for event SEQUENCE all functions."""
- self.tk.call('bind', 'all' , sequence, '')
+ self.tk.call("bind", "all" , sequence, "")
def bind_class(self, className, sequence=None, func=None, add=None):
"""Bind to widgets with bindtag CLASSNAME at event
@@ -1446,12 +1446,12 @@ def bind_class(self, className, sequence=None, func=None, add=None):
whether it will replace the previous function. See bind for
the return value."""
- return self._bind(('bind', className), sequence, func, add, 0)
+ return self._bind(("bind", className), sequence, func, add, 0)
def unbind_class(self, className, sequence):
"""Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
all functions."""
- self.tk.call('bind', className , sequence, '')
+ self.tk.call("bind", className , sequence, "")
def mainloop(self, n=0):
"""Call the mainloop of Tk."""
@@ -1479,9 +1479,9 @@ def _getboolean(self, string):
def _displayof(self, displayof):
"""Internal function."""
if displayof:
- return ('-displayof', displayof)
+ return ("-displayof", displayof)
if displayof is None:
- return ('-displayof', self._w)
+ return ("-displayof", self._w)
return ()
@property
@@ -1491,7 +1491,7 @@ def _windowingsystem(self):
return self._root()._windowingsystem_cached
except AttributeError:
ws = self._root()._windowingsystem_cached = \
- self.tk.call('tk', 'windowingsystem')
+ self.tk.call("tk", "windowingsystem")
return ws
def _options(self, cnf, kw = None):
@@ -1503,7 +1503,7 @@ def _options(self, cnf, kw = None):
res = ()
for k, v in cnf.items():
if v is not None:
- if k[-1] == '_': k = k[:-1]
+ if k[-1] == "_": k = k[:-1]
if callable(v):
v = self._register(v)
elif isinstance(v, (tuple, list)):
@@ -1516,14 +1516,14 @@ def _options(self, cnf, kw = None):
else:
break
else:
- v = ' '.join(nv)
- res = res + ('-'+k, v)
+ v = " ".join(nv)
+ res = res + ("-"+k, v)
return res
def nametowidget(self, name):
"""Return the Tkinter instance of a widget identified by
its Tcl name NAME."""
- name = str(name).split('.')
+ name = str(name).split(".")
w = self
if not name[0]:
@@ -1568,9 +1568,9 @@ def _root(self):
w = self
while w.master is not None: w = w.master
return w
- _subst_format = ('%#', '%b', '%f', '%h', '%k',
- '%s', '%t', '%w', '%x', '%y',
- '%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D')
+ _subst_format = ("%#", "%b", "%f", "%h", "%k",
+ "%s", "%t", "%w", "%x", "%y",
+ "%A", "%E", "%K", "%N", "%W", "%T", "%X", "%Y", "%D")
_subst_format_str = " ".join(_subst_format)
def _substitute(self, *args):
@@ -1661,7 +1661,7 @@ def _configure(self, cmd, cnf, kw):
if cnf is None:
return self._getconfigure(_flatten((self._w, cmd)))
if isinstance(cnf, str):
- return self._getconfigure1(_flatten((self._w, cmd, '-'+cnf)))
+ return self._getconfigure1(_flatten((self._w, cmd, "-"+cnf)))
self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
# These used to be defined in Widget:
@@ -1672,13 +1672,13 @@ def configure(self, cnf=None, **kw):
arguments. To get an overview about
the allowed keyword arguments call the method keys.
"""
- return self._configure('configure', cnf, kw)
+ return self._configure("configure", cnf, kw)
config = configure
def cget(self, key):
"""Return the resource value for a KEY given as string."""
- return self.tk.call(self._w, 'cget', '-' + key)
+ return self.tk.call(self._w, "cget", "-" + key)
__getitem__ = cget
@@ -1689,18 +1689,18 @@ def keys(self):
"""Return a list of all resource names of this widget."""
splitlist = self.tk.splitlist
return [splitlist(x)[0][1:] for x in
- splitlist(self.tk.call(self._w, 'configure'))]
+ splitlist(self.tk.call(self._w, "configure"))]
def __str__(self):
"""Return the window path name of this widget."""
return self._w
def __repr__(self):
- return '<%s.%s object %s>' % (
+ return "<%s.%s object %s>" % (
self.__class__.__module__, self.__class__.__qualname__, self._w)
# Pack methods that apply to the master
- _noarg_ = ['_noarg_']
+ _noarg_ = ["_noarg_"]
def pack_propagate(self, flag=_noarg_):
"""Set or get the status for propagation of geometry information.
@@ -1711,9 +1711,9 @@ def pack_propagate(self, flag=_noarg_):
"""
if flag is Misc._noarg_:
return self._getboolean(self.tk.call(
- 'pack', 'propagate', self._w))
+ "pack", "propagate", self._w))
else:
- self.tk.call('pack', 'propagate', self._w, flag)
+ self.tk.call("pack", "propagate", self._w, flag)
propagate = pack_propagate
@@ -1722,7 +1722,7 @@ def pack_slaves(self):
in its packing order."""
return [self._nametowidget(x) for x in
self.tk.splitlist(
- self.tk.call('pack', 'slaves', self._w))]
+ self.tk.call("pack", "slaves", self._w))]
slaves = pack_slaves
@@ -1733,7 +1733,7 @@ def place_slaves(self):
return [self._nametowidget(x) for x in
self.tk.splitlist(
self.tk.call(
- 'place', 'slaves', self._w))]
+ "place", "slaves", self._w))]
# Grid methods that apply to the master
@@ -1742,7 +1742,7 @@ def grid_anchor(self, anchor=None): # new in Tk 8.5
master when no row/column has any weight.
The default anchor is nw."""
- self.tk.call('grid', 'anchor', self._w, anchor)
+ self.tk.call("grid", "anchor", self._w, anchor)
anchor = grid_anchor
@@ -1758,7 +1758,7 @@ def grid_bbox(self, column=None, row=None, col2=None, row2=None):
The returned integers specify the offset of the upper left
corner in the master widget and the width and height.
"""
- args = ('grid', 'bbox', self._w)
+ args = ("grid", "bbox", self._w)
if column is not None and row is not None:
args = args + (column, row)
if col2 is not None and row2 is not None:
@@ -1773,7 +1773,7 @@ def _gridconvvalue(self, value):
svalue = str(value)
if not svalue:
return None
- elif '.' in svalue:
+ elif "." in svalue:
return self.tk.getdouble(svalue)
else:
return self.tk.getint(svalue)
@@ -1784,20 +1784,20 @@ def _gridconvvalue(self, value):
def _grid_configure(self, command, index, cnf, kw):
"""Internal function."""
if isinstance(cnf, str) and not kw:
- if cnf[-1:] == '_':
+ if cnf[-1:] == "_":
cnf = cnf[:-1]
- if cnf[:1] != '-':
- cnf = '-'+cnf
+ if cnf[:1] != "-":
+ cnf = "-"+cnf
options = (cnf,)
else:
options = self._options(cnf, kw)
if not options:
return _splitdict(
self.tk,
- self.tk.call('grid', command, self._w, index),
+ self.tk.call("grid", command, self._w, index),
conv=self._gridconvvalue)
res = self.tk.call(
- ('grid', command, self._w, index)
+ ("grid", command, self._w, index)
+ options)
if len(options) == 1:
return self._gridconvvalue(res)
@@ -1808,7 +1808,7 @@ def grid_columnconfigure(self, index, cnf={}, **kw):
Valid resources are minsize (minimum size of the column),
weight (how much does additional space propagate to this column)
and pad (how much space to let additionally)."""
- return self._grid_configure('columnconfigure', index, cnf, kw)
+ return self._grid_configure("columnconfigure", index, cnf, kw)
columnconfigure = grid_columnconfigure
@@ -1818,7 +1818,7 @@ def grid_location(self, x, y):
widget is located."""
return self._getints(
self.tk.call(
- 'grid', 'location', self._w, x, y)) or None
+ "grid", "location", self._w, x, y)) or None
def grid_propagate(self, flag=_noarg_):
"""Set or get the status for propagation of geometry information.
@@ -1829,9 +1829,9 @@ def grid_propagate(self, flag=_noarg_):
"""
if flag is Misc._noarg_:
return self._getboolean(self.tk.call(
- 'grid', 'propagate', self._w))
+ "grid", "propagate", self._w))
else:
- self.tk.call('grid', 'propagate', self._w, flag)
+ self.tk.call("grid", "propagate", self._w, flag)
def grid_rowconfigure(self, index, cnf={}, **kw):
"""Configure row INDEX of a grid.
@@ -1839,14 +1839,14 @@ def grid_rowconfigure(self, index, cnf={}, **kw):
Valid resources are minsize (minimum size of the row),
weight (how much does additional space propagate to this row)
and pad (how much space to let additionally)."""
- return self._grid_configure('rowconfigure', index, cnf, kw)
+ return self._grid_configure("rowconfigure", index, cnf, kw)
rowconfigure = grid_rowconfigure
def grid_size(self):
"""Return a tuple of the number of column and rows in the grid."""
return self._getints(
- self.tk.call('grid', 'size', self._w)) or None
+ self.tk.call("grid", "size", self._w)) or None
size = grid_size
@@ -1855,12 +1855,12 @@ def grid_slaves(self, row=None, column=None):
in its packing order."""
args = ()
if row is not None:
- args = args + ('-row', row)
+ args = args + ("-row", row)
if column is not None:
- args = args + ('-column', column)
+ args = args + ("-column", column)
return [self._nametowidget(x) for x in
self.tk.splitlist(self.tk.call(
- ('grid', 'slaves', self._w) + args))]
+ ("grid", "slaves", self._w) + args))]
# Support for the "event" command, new in Tk 4.2.
# By Case Roole.
@@ -1869,38 +1869,38 @@ def event_add(self, virtual, *sequences):
"""Bind a virtual event VIRTUAL (of the form <>)
to an event SEQUENCE such that the virtual event is triggered
whenever SEQUENCE occurs."""
- args = ('event', 'add', virtual) + sequences
+ args = ("event", "add", virtual) + sequences
self.tk.call(args)
def event_delete(self, virtual, *sequences):
"""Unbind a virtual event VIRTUAL from SEQUENCE."""
- args = ('event', 'delete', virtual) + sequences
+ args = ("event", "delete", virtual) + sequences
self.tk.call(args)
def event_generate(self, sequence, **kw):
"""Generate an event SEQUENCE. Additional
keyword arguments specify parameter of the event
(e.g. x, y, rootx, rooty)."""
- args = ('event', 'generate', self._w, sequence)
+ args = ("event", "generate", self._w, sequence)
for k, v in kw.items():
- args = args + ('-%s' % k, str(v))
+ args = args + ("-%s" % k, str(v))
self.tk.call(args)
def event_info(self, virtual=None):
"""Return a list of all virtual events or the information
about the SEQUENCE bound to the virtual event VIRTUAL."""
return self.tk.splitlist(
- self.tk.call('event', 'info', virtual))
+ self.tk.call("event", "info", virtual))
# Image related commands
def image_names(self):
"""Return a list of all existing image names."""
- return self.tk.splitlist(self.tk.call('image', 'names'))
+ return self.tk.splitlist(self.tk.call("image", "names"))
def image_types(self):
"""Return a list of all available image types (e.g. photo bitmap)."""
- return self.tk.splitlist(self.tk.call('image', 'types'))
+ return self.tk.splitlist(self.tk.call("image", "types"))
class CallWrapper:
@@ -1931,19 +1931,19 @@ class XView:
def xview(self, *args):
"""Query and change the horizontal position of the view."""
- res = self.tk.call(self._w, 'xview', *args)
+ res = self.tk.call(self._w, "xview", *args)
if not args:
return self._getdoubles(res)
def xview_moveto(self, fraction):
"""Adjusts the view in the window so that FRACTION of the
total width of the canvas is off-screen to the left."""
- self.tk.call(self._w, 'xview', 'moveto', fraction)
+ self.tk.call(self._w, "xview", "moveto", fraction)
def xview_scroll(self, number, what):
"""Shift the x-view according to NUMBER which is measured in "units"
or "pages" (WHAT)."""
- self.tk.call(self._w, 'xview', 'scroll', number, what)
+ self.tk.call(self._w, "xview", "scroll", number, what)
class YView:
@@ -1952,19 +1952,19 @@ class YView:
def yview(self, *args):
"""Query and change the vertical position of the view."""
- res = self.tk.call(self._w, 'yview', *args)
+ res = self.tk.call(self._w, "yview", *args)
if not args:
return self._getdoubles(res)
def yview_moveto(self, fraction):
"""Adjusts the view in the window so that FRACTION of the
total height of the canvas is off-screen to the top."""
- self.tk.call(self._w, 'yview', 'moveto', fraction)
+ self.tk.call(self._w, "yview", "moveto", fraction)
def yview_scroll(self, number, what):
"""Shift the y-view according to NUMBER which is measured in
"units" or "pages" (WHAT)."""
- self.tk.call(self._w, 'yview', 'scroll', number, what)
+ self.tk.call(self._w, "yview", "scroll", number, what)
class Wm:
@@ -1977,7 +1977,7 @@ def wm_aspect(self,
of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple
of the actual values if no argument is given."""
return self._getints(
- self.tk.call('wm', 'aspect', self._w,
+ self.tk.call("wm", "aspect", self._w,
minNumer, minDenom,
maxNumer, maxDenom))
@@ -2001,7 +2001,7 @@ def wm_attributes(self, *args):
On Unix, there are currently no special attribute values.
"""
- args = ('wm', 'attributes', self._w) + args
+ args = ("wm", "attributes", self._w) + args
return self.tk.call(args)
attributes = wm_attributes
@@ -2009,7 +2009,7 @@ def wm_attributes(self, *args):
def wm_client(self, name=None):
"""Store NAME in WM_CLIENT_MACHINE property of this widget. Return
current value."""
- return self.tk.call('wm', 'client', self._w, name)
+ return self.tk.call("wm", "client", self._w, name)
client = wm_client
@@ -2019,7 +2019,7 @@ def wm_colormapwindows(self, *wlist):
parents. Return current list of widgets if WLIST is empty."""
if len(wlist) > 1:
wlist = (wlist,) # Tk needs a list of windows here
- args = ('wm', 'colormapwindows', self._w) + wlist
+ args = ("wm", "colormapwindows", self._w) + wlist
if wlist:
self.tk.call(args)
else:
@@ -2032,14 +2032,14 @@ def wm_command(self, value=None):
"""Store VALUE in WM_COMMAND property. It is the command
which shall be used to invoke the application. Return current
command if VALUE is None."""
- return self.tk.call('wm', 'command', self._w, value)
+ return self.tk.call("wm", "command", self._w, value)
command = wm_command
def wm_deiconify(self):
"""Deiconify this widget. If it was never mapped it will not be mapped.
On Windows it will raise this widget and give it the focus."""
- return self.tk.call('wm', 'deiconify', self._w)
+ return self.tk.call("wm", "deiconify", self._w)
deiconify = wm_deiconify
@@ -2047,7 +2047,7 @@ def wm_focusmodel(self, model=None):
"""Set focus model to MODEL. "active" means that this widget will claim
the focus itself, "passive" means that the window manager shall give
the focus. Return current focus model if MODEL is None."""
- return self.tk.call('wm', 'focusmodel', self._w, model)
+ return self.tk.call("wm", "focusmodel", self._w, model)
focusmodel = wm_focusmodel
@@ -2057,20 +2057,20 @@ def wm_forget(self, window): # new in Tk 8.5
windows once they are no longer managed by wm, however, the menu
option configuration will be remembered and the menus will return
once the widget is managed again."""
- self.tk.call('wm', 'forget', window)
+ self.tk.call("wm", "forget", window)
forget = wm_forget
def wm_frame(self):
"""Return identifier for decorative frame of this widget if present."""
- return self.tk.call('wm', 'frame', self._w)
+ return self.tk.call("wm", "frame", self._w)
frame = wm_frame
def wm_geometry(self, newGeometry=None):
"""Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
current value if None is given."""
- return self.tk.call('wm', 'geometry', self._w, newGeometry)
+ return self.tk.call("wm", "geometry", self._w, newGeometry)
geometry = wm_geometry
@@ -2082,7 +2082,7 @@ def wm_grid(self,
height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
number of grid units requested in Tk_GeometryRequest."""
return self._getints(self.tk.call(
- 'wm', 'grid', self._w,
+ "wm", "grid", self._w,
baseWidth, baseHeight, widthInc, heightInc))
grid = wm_grid
@@ -2090,7 +2090,7 @@ def wm_grid(self,
def wm_group(self, pathName=None):
"""Set the group leader widgets for related widgets to PATHNAME. Return
the group leader of this widget if None is given."""
- return self.tk.call('wm', 'group', self._w, pathName)
+ return self.tk.call("wm", "group", self._w, pathName)
group = wm_group
@@ -2104,29 +2104,29 @@ def wm_iconbitmap(self, bitmap=None, default=None):
(example: root.iconbitmap(default='myicon.ico') ). See Tk
documentation for more information."""
if default:
- return self.tk.call('wm', 'iconbitmap', self._w, '-default', default)
+ return self.tk.call("wm", "iconbitmap", self._w, "-default", default)
else:
- return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
+ return self.tk.call("wm", "iconbitmap", self._w, bitmap)
iconbitmap = wm_iconbitmap
def wm_iconify(self):
"""Display widget as icon."""
- return self.tk.call('wm', 'iconify', self._w)
+ return self.tk.call("wm", "iconify", self._w)
iconify = wm_iconify
def wm_iconmask(self, bitmap=None):
"""Set mask for the icon bitmap of this widget. Return the
mask if None is given."""
- return self.tk.call('wm', 'iconmask', self._w, bitmap)
+ return self.tk.call("wm", "iconmask", self._w, bitmap)
iconmask = wm_iconmask
def wm_iconname(self, newName=None):
"""Set the name of the icon for this widget. Return the name if
None is given."""
- return self.tk.call('wm', 'iconname', self._w, newName)
+ return self.tk.call("wm", "iconname", self._w, newName)
iconname = wm_iconname
@@ -2151,9 +2151,9 @@ def wm_iconphoto(self, default=False, *args): # new in Tk 8.5
On Macintosh, this currently does nothing."""
if default:
- self.tk.call('wm', 'iconphoto', self._w, "-default", *args)
+ self.tk.call("wm", "iconphoto", self._w, "-default", *args)
else:
- self.tk.call('wm', 'iconphoto', self._w, *args)
+ self.tk.call("wm", "iconphoto", self._w, *args)
iconphoto = wm_iconphoto
@@ -2161,14 +2161,14 @@ def wm_iconposition(self, x=None, y=None):
"""Set the position of the icon of this widget to X and Y. Return
a tuple of the current values of X and X if None is given."""
return self._getints(self.tk.call(
- 'wm', 'iconposition', self._w, x, y))
+ "wm", "iconposition", self._w, x, y))
iconposition = wm_iconposition
def wm_iconwindow(self, pathName=None):
"""Set widget PATHNAME to be displayed instead of icon. Return the current
value if None is given."""
- return self.tk.call('wm', 'iconwindow', self._w, pathName)
+ return self.tk.call("wm", "iconwindow", self._w, pathName)
iconwindow = wm_iconwindow
@@ -2176,7 +2176,7 @@ def wm_manage(self, widget): # new in Tk 8.5
"""The widget specified will become a stand alone top-level window.
The window will be decorated with the window managers title bar,
etc."""
- self.tk.call('wm', 'manage', widget)
+ self.tk.call("wm", "manage", widget)
manage = wm_manage
@@ -2185,7 +2185,7 @@ def wm_maxsize(self, width=None, height=None):
the values are given in grid units. Return the current values if None
is given."""
return self._getints(self.tk.call(
- 'wm', 'maxsize', self._w, width, height))
+ "wm", "maxsize", self._w, width, height))
maxsize = wm_maxsize
@@ -2194,7 +2194,7 @@ def wm_minsize(self, width=None, height=None):
the values are given in grid units. Return the current values if None
is given."""
return self._getints(self.tk.call(
- 'wm', 'minsize', self._w, width, height))
+ "wm", "minsize", self._w, width, height))
minsize = wm_minsize
@@ -2203,7 +2203,7 @@ def wm_overrideredirect(self, boolean=None):
if BOOLEAN is given with 1. Return the current value if None
is given."""
return self._getboolean(self.tk.call(
- 'wm', 'overrideredirect', self._w, boolean))
+ "wm", "overrideredirect", self._w, boolean))
overrideredirect = wm_overrideredirect
@@ -2211,7 +2211,7 @@ def wm_positionfrom(self, who=None):
"""Instruct the window manager that the position of this widget shall
be defined by the user if WHO is "user", and by its own policy if WHO is
"program"."""
- return self.tk.call('wm', 'positionfrom', self._w, who)
+ return self.tk.call("wm", "positionfrom", self._w, who)
positionfrom = wm_positionfrom
@@ -2224,14 +2224,14 @@ def wm_protocol(self, name=None, func=None):
else:
command = func
return self.tk.call(
- 'wm', 'protocol', self._w, name, command)
+ "wm", "protocol", self._w, name, command)
protocol = wm_protocol
def wm_resizable(self, width=None, height=None):
"""Instruct the window manager whether this width can be resized
in WIDTH or HEIGHT. Both values are boolean values."""
- return self.tk.call('wm', 'resizable', self._w, width, height)
+ return self.tk.call("wm", "resizable", self._w, width, height)
resizable = wm_resizable
@@ -2239,34 +2239,34 @@ def wm_sizefrom(self, who=None):
"""Instruct the window manager that the size of this widget shall
be defined by the user if WHO is "user", and by its own policy if WHO is
"program"."""
- return self.tk.call('wm', 'sizefrom', self._w, who)
+ return self.tk.call("wm", "sizefrom", self._w, who)
sizefrom = wm_sizefrom
def wm_state(self, newstate=None):
"""Query or set the state of this widget as one of normal, icon,
iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only)."""
- return self.tk.call('wm', 'state', self._w, newstate)
+ return self.tk.call("wm", "state", self._w, newstate)
state = wm_state
def wm_title(self, string=None):
"""Set the title of this widget."""
- return self.tk.call('wm', 'title', self._w, string)
+ return self.tk.call("wm", "title", self._w, string)
title = wm_title
def wm_transient(self, master=None):
"""Instruct the window manager that this widget is transient
with regard to widget MASTER."""
- return self.tk.call('wm', 'transient', self._w, master)
+ return self.tk.call("wm", "transient", self._w, master)
transient = wm_transient
def wm_withdraw(self):
"""Withdraw this widget from the screen such that it is unmapped
and forgotten by the window manager. Re-draw it with wm_deiconify."""
- return self.tk.call('wm', 'withdraw', self._w)
+ return self.tk.call("wm", "withdraw", self._w)
withdraw = wm_withdraw
@@ -2274,9 +2274,9 @@ def wm_withdraw(self):
class Tk(Misc, Wm):
"""Toplevel widget of Tk which represents mostly the main window
of an application. It has an associated Tcl interpreter."""
- _w = '.'
+ _w = "."
- def __init__(self, screenName=None, baseName=None, className='Tk',
+ def __init__(self, screenName=None, baseName=None, className="Tk",
useTk=True, sync=False, use=None):
"""Return a new top level widget on screen SCREENNAME. A new Tcl interpreter will
be created. BASENAME will be used for the identification of the profile file (see
@@ -2293,7 +2293,7 @@ def __init__(self, screenName=None, baseName=None, className='Tk',
import os
baseName = os.path.basename(sys.argv[0])
baseName, ext = os.path.splitext(baseName)
- if ext not in ('.py', '.pyc'):
+ if ext not in (".py", ".pyc"):
baseName = baseName + ext
interactive = False
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
@@ -2312,12 +2312,12 @@ def _loadtk(self):
self._tkloaded = True
global _default_root
# Version sanity checks
- tk_version = self.tk.getvar('tk_version')
+ tk_version = self.tk.getvar("tk_version")
if tk_version != _tkinter.TK_VERSION:
raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
% (_tkinter.TK_VERSION, tk_version))
# Under unknown circumstances, tcl_version gets coerced to float
- tcl_version = str(self.tk.getvar('tcl_version'))
+ tcl_version = str(self.tk.getvar("tcl_version"))
if tcl_version != _tkinter.TCL_VERSION:
raise RuntimeError("tcl.h version (%s) doesn't match libtcl.a version (%s)" \
% (_tkinter.TCL_VERSION, tcl_version))
@@ -2326,10 +2326,10 @@ def _loadtk(self):
# would register differently-named commands.
if self._tclCommands is None:
self._tclCommands = []
- self.tk.createcommand('tkerror', _tkerror)
- self.tk.createcommand('exit', _exit)
- self._tclCommands.append('tkerror')
- self._tclCommands.append('exit')
+ self.tk.createcommand("tkerror", _tkerror)
+ self.tk.createcommand("exit", _exit)
+ self._tclCommands.append("tkerror")
+ self._tclCommands.append("exit")
if _support_default_root and _default_root is None:
_default_root = self
self.protocol("WM_DELETE_WINDOW", self.destroy)
@@ -2338,7 +2338,7 @@ def destroy(self):
"""Destroy this and all descendants widgets. This will
end the application of this Tcl interpreter."""
for c in list(self.children.values()): c.destroy()
- self.tk.call('destroy', self._w)
+ self.tk.call("destroy", self._w)
Misc.destroy(self)
global _default_root
if _support_default_root and _default_root is self:
@@ -2349,20 +2349,20 @@ def readprofile(self, baseName, className):
the Tcl Interpreter and calls exec on the contents of .BASENAME.py and
.CLASSNAME.py if such a file exists in the home directory."""
import os
- if 'HOME' in os.environ: home = os.environ['HOME']
+ if "HOME" in os.environ: home = os.environ["HOME"]
else: home = os.curdir
- class_tcl = os.path.join(home, '.%s.tcl' % className)
- class_py = os.path.join(home, '.%s.py' % className)
- base_tcl = os.path.join(home, '.%s.tcl' % baseName)
- base_py = os.path.join(home, '.%s.py' % baseName)
- dir = {'self': self}
- exec('from tkinter import *', dir)
+ class_tcl = os.path.join(home, ".%s.tcl" % className)
+ class_py = os.path.join(home, ".%s.py" % className)
+ base_tcl = os.path.join(home, ".%s.tcl" % baseName)
+ base_py = os.path.join(home, ".%s.py" % baseName)
+ dir = {"self": self}
+ exec("from tkinter import *", dir)
if os.path.isfile(class_tcl):
- self.tk.call('source', class_tcl)
+ self.tk.call("source", class_tcl)
if os.path.isfile(class_py):
exec(open(class_py).read(), dir)
if os.path.isfile(base_tcl):
- self.tk.call('source', base_tcl)
+ self.tk.call("source", base_tcl)
if os.path.isfile(base_py):
exec(open(base_py).read(), dir)
@@ -2397,7 +2397,7 @@ def __getattr__(self, attr):
# copied into the Pack, Place or Grid class.
-def Tcl(screenName=None, baseName=None, className='Tk', useTk=False):
+def Tcl(screenName=None, baseName=None, className="Tk", useTk=False):
return Tk(screenName, baseName, className, useTk)
@@ -2423,23 +2423,23 @@ def pack_configure(self, cnf={}, **kw):
side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.
"""
self.tk.call(
- ('pack', 'configure', self._w)
+ ("pack", "configure", self._w)
+ self._options(cnf, kw))
pack = configure = config = pack_configure
def pack_forget(self):
"""Unmap this widget and do not use it for the packing order."""
- self.tk.call('pack', 'forget', self._w)
+ self.tk.call("pack", "forget", self._w)
forget = pack_forget
def pack_info(self):
"""Return information about the packing options
for this widget."""
- d = _splitdict(self.tk, self.tk.call('pack', 'info', self._w))
- if 'in' in d:
- d['in'] = self.nametowidget(d['in'])
+ d = _splitdict(self.tk, self.tk.call("pack", "info", self._w))
+ if "in" in d:
+ d["in"] = self.nametowidget(d["in"])
return d
info = pack_info
@@ -2475,23 +2475,23 @@ def place_configure(self, cnf={}, **kw):
master widget into account
"""
self.tk.call(
- ('place', 'configure', self._w)
+ ("place", "configure", self._w)
+ self._options(cnf, kw))
place = configure = config = place_configure
def place_forget(self):
"""Unmap this widget."""
- self.tk.call('place', 'forget', self._w)
+ self.tk.call("place", "forget", self._w)
forget = place_forget
def place_info(self):
"""Return information about the placing options
for this widget."""
- d = _splitdict(self.tk, self.tk.call('place', 'info', self._w))
- if 'in' in d:
- d['in'] = self.nametowidget(d['in'])
+ d = _splitdict(self.tk, self.tk.call("place", "info", self._w))
+ if "in" in d:
+ d["in"] = self.nametowidget(d["in"])
return d
info = place_info
@@ -2520,7 +2520,7 @@ def grid_configure(self, cnf={}, **kw):
widget stick to the cell boundary
"""
self.tk.call(
- ('grid', 'configure', self._w)
+ ("grid", "configure", self._w)
+ self._options(cnf, kw))
grid = configure = config = grid_configure
@@ -2529,20 +2529,20 @@ def grid_configure(self, cnf={}, **kw):
def grid_forget(self):
"""Unmap this widget."""
- self.tk.call('grid', 'forget', self._w)
+ self.tk.call("grid", "forget", self._w)
forget = grid_forget
def grid_remove(self):
"""Unmap this widget but remember the grid options."""
- self.tk.call('grid', 'remove', self._w)
+ self.tk.call("grid", "remove", self._w)
def grid_info(self):
"""Return information about the options
for positioning this widget in a grid."""
- d = _splitdict(self.tk, self.tk.call('grid', 'info', self._w))
- if 'in' in d:
- d['in'] = self.nametowidget(d['in'])
+ d = _splitdict(self.tk, self.tk.call("grid", "info", self._w))
+ if "in" in d:
+ d["in"] = self.nametowidget(d["in"])
return d
info = grid_info
@@ -2563,9 +2563,9 @@ def _setup(self, master, cnf):
self.master = master
self.tk = master.tk
name = None
- if 'name' in cnf:
- name = cnf['name']
- del cnf['name']
+ if "name" in cnf:
+ name = cnf["name"]
+ del cnf["name"]
if not name:
name = self.__class__.__name__.lower()
if master._last_child_ids is None:
@@ -2573,14 +2573,14 @@ def _setup(self, master, cnf):
count = master._last_child_ids.get(name, 0) + 1
master._last_child_ids[name] = count
if count == 1:
- name = '!%s' % (name,)
+ name = "!%s" % (name,)
else:
- name = '!%s%d' % (name, count)
+ name = "!%s%d" % (name, count)
self._name = name
- if master._w=='.':
- self._w = '.' + name
+ if master._w==".":
+ self._w = "." + name
else:
- self._w = master._w + '.' + name
+ self._w = master._w + "." + name
self.children = {}
if self._name in self.master.children:
self.master.children[self._name].destroy()
@@ -2606,7 +2606,7 @@ def __init__(self, master, widgetName, cnf={}, kw={}, extra=()):
def destroy(self):
"""Destroy this and all descendants widgets."""
for c in list(self.children.values()): c.destroy()
- self.tk.call('destroy', self._w)
+ self.tk.call("destroy", self._w)
if self._name in self.master.children:
del self.master.children[self._name]
Misc.destroy(self)
@@ -2637,17 +2637,17 @@ def __init__(self, master=None, cnf={}, **kw):
if kw:
cnf = _cnfmerge((cnf, kw))
extra = ()
- for wmkey in ['screen', 'class_', 'class', 'visual',
- 'colormap']:
+ for wmkey in ["screen", "class_", "class", "visual",
+ "colormap"]:
if wmkey in cnf:
val = cnf[wmkey]
# TBD: a hack needed because some keys
# are not valid as keyword arguments
- if wmkey[-1] == '_': opt = '-'+wmkey[:-1]
- else: opt = '-'+wmkey
+ if wmkey[-1] == "_": opt = "-"+wmkey[:-1]
+ else: opt = "-"+wmkey
extra = extra + (opt, val)
del cnf[wmkey]
- BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
+ BaseWidget.__init__(self, master, "toplevel", cnf, {}, extra)
root = self._root()
self.iconname(root.iconname())
self.title(root.title())
@@ -2676,7 +2676,7 @@ def __init__(self, master=None, cnf={}, **kw):
command, compound, default, height,
overrelief, state, width
"""
- Widget.__init__(self, master, 'button', cnf, kw)
+ Widget.__init__(self, master, "button", cnf, kw)
def flash(self):
"""Flash the button.
@@ -2688,7 +2688,7 @@ def flash(self):
invoked. This command is ignored if the button's state is
disabled.
"""
- self.tk.call(self._w, 'flash')
+ self.tk.call(self._w, "flash")
def invoke(self):
"""Invoke the command associated with the button.
@@ -2698,7 +2698,7 @@ def invoke(self):
the button. This command is ignored if the button's state
is disabled.
"""
- return self.tk.call(self._w, 'invoke')
+ return self.tk.call(self._w, "invoke")
class Canvas(Widget, XView, YView):
@@ -2714,55 +2714,55 @@ def __init__(self, master=None, cnf={}, **kw):
scrollregion, selectbackground, selectborderwidth, selectforeground,
state, takefocus, width, xscrollcommand, xscrollincrement,
yscrollcommand, yscrollincrement."""
- Widget.__init__(self, master, 'canvas', cnf, kw)
+ Widget.__init__(self, master, "canvas", cnf, kw)
def addtag(self, *args):
"""Internal function."""
- self.tk.call((self._w, 'addtag') + args)
+ self.tk.call((self._w, "addtag") + args)
def addtag_above(self, newtag, tagOrId):
"""Add tag NEWTAG to all items above TAGORID."""
- self.addtag(newtag, 'above', tagOrId)
+ self.addtag(newtag, "above", tagOrId)
def addtag_all(self, newtag):
"""Add tag NEWTAG to all items."""
- self.addtag(newtag, 'all')
+ self.addtag(newtag, "all")
def addtag_below(self, newtag, tagOrId):
"""Add tag NEWTAG to all items below TAGORID."""
- self.addtag(newtag, 'below', tagOrId)
+ self.addtag(newtag, "below", tagOrId)
def addtag_closest(self, newtag, x, y, halo=None, start=None):
"""Add tag NEWTAG to item which is closest to pixel at X, Y.
If several match take the top-most.
All items closer than HALO are considered overlapping (all are
closest). If START is specified the next below this tag is taken."""
- self.addtag(newtag, 'closest', x, y, halo, start)
+ self.addtag(newtag, "closest", x, y, halo, start)
def addtag_enclosed(self, newtag, x1, y1, x2, y2):
"""Add tag NEWTAG to all items in the rectangle defined
by X1,Y1,X2,Y2."""
- self.addtag(newtag, 'enclosed', x1, y1, x2, y2)
+ self.addtag(newtag, "enclosed", x1, y1, x2, y2)
def addtag_overlapping(self, newtag, x1, y1, x2, y2):
"""Add tag NEWTAG to all items which overlap the rectangle
defined by X1,Y1,X2,Y2."""
- self.addtag(newtag, 'overlapping', x1, y1, x2, y2)
+ self.addtag(newtag, "overlapping", x1, y1, x2, y2)
def addtag_withtag(self, newtag, tagOrId):
"""Add tag NEWTAG to all items with TAGORID."""
- self.addtag(newtag, 'withtag', tagOrId)
+ self.addtag(newtag, "withtag", tagOrId)
def bbox(self, *args):
"""Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
which encloses all items with tags specified as arguments."""
return self._getints(
- self.tk.call((self._w, 'bbox') + args)) or None
+ self.tk.call((self._w, "bbox") + args)) or None
def tag_unbind(self, tagOrId, sequence, funcid=None):
"""Unbind for all items with TAGORID for event SEQUENCE the
function identified with FUNCID."""
- self.tk.call(self._w, 'bind', tagOrId, sequence, '')
+ self.tk.call(self._w, "bind", tagOrId, sequence, "")
if funcid:
self.deletecommand(funcid)
@@ -2772,27 +2772,27 @@ def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the previous function. See bind for the return value."""
- return self._bind((self._w, 'bind', tagOrId),
+ return self._bind((self._w, "bind", tagOrId),
sequence, func, add)
def canvasx(self, screenx, gridspacing=None):
"""Return the canvas x coordinate of pixel position SCREENX rounded
to nearest multiple of GRIDSPACING units."""
return self.tk.getdouble(self.tk.call(
- self._w, 'canvasx', screenx, gridspacing))
+ self._w, "canvasx", screenx, gridspacing))
def canvasy(self, screeny, gridspacing=None):
"""Return the canvas y coordinate of pixel position SCREENY rounded
to nearest multiple of GRIDSPACING units."""
return self.tk.getdouble(self.tk.call(
- self._w, 'canvasy', screeny, gridspacing))
+ self._w, "canvasy", screeny, gridspacing))
def coords(self, *args):
"""Return a list of coordinates for the item given in ARGS."""
# XXX Should use _flatten on args
return [self.tk.getdouble(x) for x in
self.tk.splitlist(
- self.tk.call((self._w, 'coords') + args))]
+ self.tk.call((self._w, "coords") + args))]
def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
"""Internal function."""
@@ -2803,124 +2803,124 @@ def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
else:
cnf = {}
return self.tk.getint(self.tk.call(
- self._w, 'create', itemType,
+ self._w, "create", itemType,
*(args + self._options(cnf, kw))))
def create_arc(self, *args, **kw):
"""Create arc shaped region with coordinates x1,y1,x2,y2."""
- return self._create('arc', args, kw)
+ return self._create("arc", args, kw)
def create_bitmap(self, *args, **kw):
"""Create bitmap with coordinates x1,y1."""
- return self._create('bitmap', args, kw)
+ return self._create("bitmap", args, kw)
def create_image(self, *args, **kw):
"""Create image item with coordinates x1,y1."""
- return self._create('image', args, kw)
+ return self._create("image", args, kw)
def create_line(self, *args, **kw):
"""Create line with coordinates x1,y1,...,xn,yn."""
- return self._create('line', args, kw)
+ return self._create("line", args, kw)
def create_oval(self, *args, **kw):
"""Create oval with coordinates x1,y1,x2,y2."""
- return self._create('oval', args, kw)
+ return self._create("oval", args, kw)
def create_polygon(self, *args, **kw):
"""Create polygon with coordinates x1,y1,...,xn,yn."""
- return self._create('polygon', args, kw)
+ return self._create("polygon", args, kw)
def create_rectangle(self, *args, **kw):
"""Create rectangle with coordinates x1,y1,x2,y2."""
- return self._create('rectangle', args, kw)
+ return self._create("rectangle", args, kw)
def create_text(self, *args, **kw):
"""Create text with coordinates x1,y1."""
- return self._create('text', args, kw)
+ return self._create("text", args, kw)
def create_window(self, *args, **kw):
"""Create window with coordinates x1,y1,x2,y2."""
- return self._create('window', args, kw)
+ return self._create("window", args, kw)
def dchars(self, *args):
"""Delete characters of text items identified by tag or id in ARGS (possibly
several times) from FIRST to LAST character (including)."""
- self.tk.call((self._w, 'dchars') + args)
+ self.tk.call((self._w, "dchars") + args)
def delete(self, *args):
"""Delete items identified by all tag or ids contained in ARGS."""
- self.tk.call((self._w, 'delete') + args)
+ self.tk.call((self._w, "delete") + args)
def dtag(self, *args):
"""Delete tag or id given as last arguments in ARGS from items
identified by first argument in ARGS."""
- self.tk.call((self._w, 'dtag') + args)
+ self.tk.call((self._w, "dtag") + args)
def find(self, *args):
"""Internal function."""
return self._getints(
- self.tk.call((self._w, 'find') + args)) or ()
+ self.tk.call((self._w, "find") + args)) or ()
def find_above(self, tagOrId):
"""Return items above TAGORID."""
- return self.find('above', tagOrId)
+ return self.find("above", tagOrId)
def find_all(self):
"""Return all items."""
- return self.find('all')
+ return self.find("all")
def find_below(self, tagOrId):
"""Return all items below TAGORID."""
- return self.find('below', tagOrId)
+ return self.find("below", tagOrId)
def find_closest(self, x, y, halo=None, start=None):
"""Return item which is closest to pixel at X, Y.
If several match take the top-most.
All items closer than HALO are considered overlapping (all are
closest). If START is specified the next below this tag is taken."""
- return self.find('closest', x, y, halo, start)
+ return self.find("closest", x, y, halo, start)
def find_enclosed(self, x1, y1, x2, y2):
"""Return all items in rectangle defined
by X1,Y1,X2,Y2."""
- return self.find('enclosed', x1, y1, x2, y2)
+ return self.find("enclosed", x1, y1, x2, y2)
def find_overlapping(self, x1, y1, x2, y2):
"""Return all items which overlap the rectangle
defined by X1,Y1,X2,Y2."""
- return self.find('overlapping', x1, y1, x2, y2)
+ return self.find("overlapping", x1, y1, x2, y2)
def find_withtag(self, tagOrId):
"""Return all items with TAGORID."""
- return self.find('withtag', tagOrId)
+ return self.find("withtag", tagOrId)
def focus(self, *args):
"""Set focus to the first item specified in ARGS."""
- return self.tk.call((self._w, 'focus') + args)
+ return self.tk.call((self._w, "focus") + args)
def gettags(self, *args):
"""Return tags associated with the first item specified in ARGS."""
return self.tk.splitlist(
- self.tk.call((self._w, 'gettags') + args))
+ self.tk.call((self._w, "gettags") + args))
def icursor(self, *args):
"""Set cursor at position POS in the item identified by TAGORID.
In ARGS TAGORID must be first."""
- self.tk.call((self._w, 'icursor') + args)
+ self.tk.call((self._w, "icursor") + args)
def index(self, *args):
"""Return position of cursor as integer in item specified in ARGS."""
- return self.tk.getint(self.tk.call((self._w, 'index') + args))
+ return self.tk.getint(self.tk.call((self._w, "index") + args))
def insert(self, *args):
"""Insert TEXT in item TAGORID at position POS. ARGS must
be TAGORID POS TEXT."""
- self.tk.call((self._w, 'insert') + args)
+ self.tk.call((self._w, "insert") + args)
def itemcget(self, tagOrId, option):
"""Return the resource value for an OPTION for item TAGORID."""
return self.tk.call(
- (self._w, 'itemcget') + (tagOrId, '-'+option))
+ (self._w, "itemcget") + (tagOrId, "-"+option))
def itemconfigure(self, tagOrId, cnf=None, **kw):
"""Configure resources of an item TAGORID.
@@ -2929,7 +2929,7 @@ def itemconfigure(self, tagOrId, cnf=None, **kw):
arguments. To get an overview about
the allowed keyword arguments call the method without arguments.
"""
- return self._configure(('itemconfigure', tagOrId), cnf, kw)
+ return self._configure(("itemconfigure", tagOrId), cnf, kw)
itemconfig = itemconfigure
@@ -2940,75 +2940,75 @@ def itemconfigure(self, tagOrId, cnf=None, **kw):
def tag_lower(self, *args):
"""Lower an item TAGORID given in ARGS
(optional below another item)."""
- self.tk.call((self._w, 'lower') + args)
+ self.tk.call((self._w, "lower") + args)
lower = tag_lower
def move(self, *args):
"""Move an item TAGORID given in ARGS."""
- self.tk.call((self._w, 'move') + args)
+ self.tk.call((self._w, "move") + args)
- def moveto(self, tagOrId, x='', y=''):
+ def moveto(self, tagOrId, x="", y=""):
"""Move the items given by TAGORID in the canvas coordinate
space so that the first coordinate pair of the bottommost
item with tag TAGORID is located at position (X,Y).
X and Y may be the empty string, in which case the
corresponding coordinate will be unchanged. All items matching
TAGORID remain in the same positions relative to each other."""
- self.tk.call(self._w, 'moveto', tagOrId, x, y)
+ self.tk.call(self._w, "moveto", tagOrId, x, y)
def postscript(self, cnf={}, **kw):
"""Print the contents of the canvas to a postscript
file. Valid options: colormap, colormode, file, fontmap,
height, pageanchor, pageheight, pagewidth, pagex, pagey,
rotate, width, x, y."""
- return self.tk.call((self._w, 'postscript') +
+ return self.tk.call((self._w, "postscript") +
self._options(cnf, kw))
def tag_raise(self, *args):
"""Raise an item TAGORID given in ARGS
(optional above another item)."""
- self.tk.call((self._w, 'raise') + args)
+ self.tk.call((self._w, "raise") + args)
lift = tkraise = tag_raise
def scale(self, *args):
"""Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE."""
- self.tk.call((self._w, 'scale') + args)
+ self.tk.call((self._w, "scale") + args)
def scan_mark(self, x, y):
"""Remember the current X, Y coordinates."""
- self.tk.call(self._w, 'scan', 'mark', x, y)
+ self.tk.call(self._w, "scan", "mark", x, y)
def scan_dragto(self, x, y, gain=10):
"""Adjust the view of the canvas to GAIN times the
difference between X and Y and the coordinates given in
scan_mark."""
- self.tk.call(self._w, 'scan', 'dragto', x, y, gain)
+ self.tk.call(self._w, "scan", "dragto", x, y, gain)
def select_adjust(self, tagOrId, index):
"""Adjust the end of the selection near the cursor of an item TAGORID to index."""
- self.tk.call(self._w, 'select', 'adjust', tagOrId, index)
+ self.tk.call(self._w, "select", "adjust", tagOrId, index)
def select_clear(self):
"""Clear the selection if it is in this widget."""
- self.tk.call(self._w, 'select', 'clear')
+ self.tk.call(self._w, "select", "clear")
def select_from(self, tagOrId, index):
"""Set the fixed end of a selection in item TAGORID to INDEX."""
- self.tk.call(self._w, 'select', 'from', tagOrId, index)
+ self.tk.call(self._w, "select", "from", tagOrId, index)
def select_item(self):
"""Return the item which has the selection."""
- return self.tk.call(self._w, 'select', 'item') or None
+ return self.tk.call(self._w, "select", "item") or None
def select_to(self, tagOrId, index):
"""Set the variable end of a selection in item TAGORID to INDEX."""
- self.tk.call(self._w, 'select', 'to', tagOrId, index)
+ self.tk.call(self._w, "select", "to", tagOrId, index)
def type(self, tagOrId):
"""Return the type of the item TAGORID."""
- return self.tk.call(self._w, 'type', tagOrId) or None
+ return self.tk.call(self._w, "type", tagOrId) or None
_checkbutton_count = 0
@@ -3026,35 +3026,35 @@ def __init__(self, master=None, cnf={}, **kw):
indicatoron, justify, offvalue, onvalue, padx, pady, relief,
selectcolor, selectimage, state, takefocus, text, textvariable,
underline, variable, width, wraplength."""
- Widget.__init__(self, master, 'checkbutton', cnf, kw)
+ Widget.__init__(self, master, "checkbutton", cnf, kw)
def _setup(self, master, cnf):
- if not cnf.get('name'):
+ if not cnf.get("name"):
global _checkbutton_count
name = self.__class__.__name__.lower()
_checkbutton_count += 1
- cnf['name'] = f'!{name}{_checkbutton_count}'
+ cnf["name"] = f"!{name}{_checkbutton_count}"
super()._setup(master, cnf)
def deselect(self):
"""Put the button in off-state."""
- self.tk.call(self._w, 'deselect')
+ self.tk.call(self._w, "deselect")
def flash(self):
"""Flash the button."""
- self.tk.call(self._w, 'flash')
+ self.tk.call(self._w, "flash")
def invoke(self):
"""Toggle the button and invoke a command if given as resource."""
- return self.tk.call(self._w, 'invoke')
+ return self.tk.call(self._w, "invoke")
def select(self):
"""Put the button in on-state."""
- self.tk.call(self._w, 'select')
+ self.tk.call(self._w, "select")
def toggle(self):
"""Toggle the button."""
- self.tk.call(self._w, 'toggle')
+ self.tk.call(self._w, "toggle")
class Entry(Widget, XView):
@@ -3071,54 +3071,54 @@ def __init__(self, master=None, cnf={}, **kw):
selectborderwidth, selectforeground, show, state, takefocus,
textvariable, validate, validatecommand, vcmd, width,
xscrollcommand."""
- Widget.__init__(self, master, 'entry', cnf, kw)
+ Widget.__init__(self, master, "entry", cnf, kw)
def delete(self, first, last=None):
"""Delete text from FIRST to LAST (not included)."""
- self.tk.call(self._w, 'delete', first, last)
+ self.tk.call(self._w, "delete", first, last)
def get(self):
"""Return the text."""
- return self.tk.call(self._w, 'get')
+ return self.tk.call(self._w, "get")
def icursor(self, index):
"""Insert cursor at INDEX."""
- self.tk.call(self._w, 'icursor', index)
+ self.tk.call(self._w, "icursor", index)
def index(self, index):
"""Return position of cursor."""
return self.tk.getint(self.tk.call(
- self._w, 'index', index))
+ self._w, "index", index))
def insert(self, index, string):
"""Insert STRING at INDEX."""
- self.tk.call(self._w, 'insert', index, string)
+ self.tk.call(self._w, "insert", index, string)
def scan_mark(self, x):
"""Remember the current X, Y coordinates."""
- self.tk.call(self._w, 'scan', 'mark', x)
+ self.tk.call(self._w, "scan", "mark", x)
def scan_dragto(self, x):
"""Adjust the view of the canvas to 10 times the
difference between X and Y and the coordinates given in
scan_mark."""
- self.tk.call(self._w, 'scan', 'dragto', x)
+ self.tk.call(self._w, "scan", "dragto", x)
def selection_adjust(self, index):
"""Adjust the end of the selection near the cursor to INDEX."""
- self.tk.call(self._w, 'selection', 'adjust', index)
+ self.tk.call(self._w, "selection", "adjust", index)
select_adjust = selection_adjust
def selection_clear(self):
"""Clear the selection if it is in this widget."""
- self.tk.call(self._w, 'selection', 'clear')
+ self.tk.call(self._w, "selection", "clear")
select_clear = selection_clear
def selection_from(self, index):
"""Set the fixed end of a selection to INDEX."""
- self.tk.call(self._w, 'selection', 'from', index)
+ self.tk.call(self._w, "selection", "from", index)
select_from = selection_from
@@ -3126,19 +3126,19 @@ def selection_present(self):
"""Return True if there are characters selected in the entry, False
otherwise."""
return self.tk.getboolean(
- self.tk.call(self._w, 'selection', 'present'))
+ self.tk.call(self._w, "selection", "present"))
select_present = selection_present
def selection_range(self, start, end):
"""Set the selection from START to END (not included)."""
- self.tk.call(self._w, 'selection', 'range', start, end)
+ self.tk.call(self._w, "selection", "range", start, end)
select_range = selection_range
def selection_to(self, index):
"""Set the variable end of a selection to INDEX."""
- self.tk.call(self._w, 'selection', 'to', index)
+ self.tk.call(self._w, "selection", "to", index)
select_to = selection_to
@@ -3154,13 +3154,13 @@ def __init__(self, master=None, cnf={}, **kw):
highlightcolor, highlightthickness, relief, takefocus, visual, width."""
cnf = _cnfmerge((cnf, kw))
extra = ()
- if 'class_' in cnf:
- extra = ('-class', cnf['class_'])
- del cnf['class_']
- elif 'class' in cnf:
- extra = ('-class', cnf['class'])
- del cnf['class']
- Widget.__init__(self, master, 'frame', cnf, {}, extra)
+ if "class_" in cnf:
+ extra = ("-class", cnf["class_"])
+ del cnf["class_"]
+ elif "class" in cnf:
+ extra = ("-class", cnf["class"])
+ del cnf["class"]
+ Widget.__init__(self, master, "frame", cnf, {}, extra)
class Label(Widget):
@@ -3184,7 +3184,7 @@ def __init__(self, master=None, cnf={}, **kw):
height, state, width
"""
- Widget.__init__(self, master, 'label', cnf, kw)
+ Widget.__init__(self, master, "label", cnf, kw)
class Listbox(Widget, XView, YView):
@@ -3198,97 +3198,97 @@ def __init__(self, master=None, cnf={}, **kw):
highlightcolor, highlightthickness, relief, selectbackground,
selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
width, xscrollcommand, yscrollcommand, listvariable."""
- Widget.__init__(self, master, 'listbox', cnf, kw)
+ Widget.__init__(self, master, "listbox", cnf, kw)
def activate(self, index):
"""Activate item identified by INDEX."""
- self.tk.call(self._w, 'activate', index)
+ self.tk.call(self._w, "activate", index)
def bbox(self, index):
"""Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
which encloses the item identified by the given index."""
- return self._getints(self.tk.call(self._w, 'bbox', index)) or None
+ return self._getints(self.tk.call(self._w, "bbox", index)) or None
def curselection(self):
"""Return the indices of currently selected item."""
- return self._getints(self.tk.call(self._w, 'curselection')) or ()
+ return self._getints(self.tk.call(self._w, "curselection")) or ()
def delete(self, first, last=None):
"""Delete items from FIRST to LAST (included)."""
- self.tk.call(self._w, 'delete', first, last)
+ self.tk.call(self._w, "delete", first, last)
def get(self, first, last=None):
"""Get list of items from FIRST to LAST (included)."""
if last is not None:
return self.tk.splitlist(self.tk.call(
- self._w, 'get', first, last))
+ self._w, "get", first, last))
else:
- return self.tk.call(self._w, 'get', first)
+ return self.tk.call(self._w, "get", first)
def index(self, index):
"""Return index of item identified with INDEX."""
- i = self.tk.call(self._w, 'index', index)
- if i == 'none': return None
+ i = self.tk.call(self._w, "index", index)
+ if i == "none": return None
return self.tk.getint(i)
def insert(self, index, *elements):
"""Insert ELEMENTS at INDEX."""
- self.tk.call((self._w, 'insert', index) + elements)
+ self.tk.call((self._w, "insert", index) + elements)
def nearest(self, y):
"""Get index of item which is nearest to y coordinate Y."""
return self.tk.getint(self.tk.call(
- self._w, 'nearest', y))
+ self._w, "nearest", y))
def scan_mark(self, x, y):
"""Remember the current X, Y coordinates."""
- self.tk.call(self._w, 'scan', 'mark', x, y)
+ self.tk.call(self._w, "scan", "mark", x, y)
def scan_dragto(self, x, y):
"""Adjust the view of the listbox to 10 times the
difference between X and Y and the coordinates given in
scan_mark."""
- self.tk.call(self._w, 'scan', 'dragto', x, y)
+ self.tk.call(self._w, "scan", "dragto", x, y)
def see(self, index):
"""Scroll such that INDEX is visible."""
- self.tk.call(self._w, 'see', index)
+ self.tk.call(self._w, "see", index)
def selection_anchor(self, index):
"""Set the fixed end oft the selection to INDEX."""
- self.tk.call(self._w, 'selection', 'anchor', index)
+ self.tk.call(self._w, "selection", "anchor", index)
select_anchor = selection_anchor
def selection_clear(self, first, last=None):
"""Clear the selection from FIRST to LAST (included)."""
self.tk.call(self._w,
- 'selection', 'clear', first, last)
+ "selection", "clear", first, last)
select_clear = selection_clear
def selection_includes(self, index):
"""Return True if INDEX is part of the selection."""
return self.tk.getboolean(self.tk.call(
- self._w, 'selection', 'includes', index))
+ self._w, "selection", "includes", index))
select_includes = selection_includes
def selection_set(self, first, last=None):
"""Set the selection from FIRST to LAST (included) without
changing the currently selected elements."""
- self.tk.call(self._w, 'selection', 'set', first, last)
+ self.tk.call(self._w, "selection", "set", first, last)
select_set = selection_set
def size(self):
"""Return the number of elements in the listbox."""
- return self.tk.getint(self.tk.call(self._w, 'size'))
+ return self.tk.getint(self.tk.call(self._w, "size"))
def itemcget(self, index, option):
"""Return the resource value for an ITEM and an OPTION."""
return self.tk.call(
- (self._w, 'itemcget') + (index, '-'+option))
+ (self._w, "itemcget") + (index, "-"+option))
def itemconfigure(self, index, cnf=None, **kw):
"""Configure resources of an ITEM.
@@ -3298,7 +3298,7 @@ def itemconfigure(self, index, cnf=None, **kw):
call the method without arguments.
Valid resource names: background, bg, foreground, fg,
selectbackground, selectforeground."""
- return self._configure(('itemconfigure', index), cnf, kw)
+ return self._configure(("itemconfigure", index), cnf, kw)
itemconfig = itemconfigure
@@ -3313,65 +3313,65 @@ def __init__(self, master=None, cnf={}, **kw):
activeforeground, background, bd, bg, borderwidth, cursor,
disabledforeground, fg, font, foreground, postcommand, relief,
selectcolor, takefocus, tearoff, tearoffcommand, title, type."""
- Widget.__init__(self, master, 'menu', cnf, kw)
+ Widget.__init__(self, master, "menu", cnf, kw)
def tk_popup(self, x, y, entry=""):
"""Post the menu at position X,Y with entry ENTRY."""
- self.tk.call('tk_popup', self._w, x, y, entry)
+ self.tk.call("tk_popup", self._w, x, y, entry)
def activate(self, index):
"""Activate entry at INDEX."""
- self.tk.call(self._w, 'activate', index)
+ self.tk.call(self._w, "activate", index)
def add(self, itemType, cnf={}, **kw):
"""Internal function."""
- self.tk.call((self._w, 'add', itemType) +
+ self.tk.call((self._w, "add", itemType) +
self._options(cnf, kw))
def add_cascade(self, cnf={}, **kw):
"""Add hierarchical menu item."""
- self.add('cascade', cnf or kw)
+ self.add("cascade", cnf or kw)
def add_checkbutton(self, cnf={}, **kw):
"""Add checkbutton menu item."""
- self.add('checkbutton', cnf or kw)
+ self.add("checkbutton", cnf or kw)
def add_command(self, cnf={}, **kw):
"""Add command menu item."""
- self.add('command', cnf or kw)
+ self.add("command", cnf or kw)
def add_radiobutton(self, cnf={}, **kw):
"""Add radio menu item."""
- self.add('radiobutton', cnf or kw)
+ self.add("radiobutton", cnf or kw)
def add_separator(self, cnf={}, **kw):
"""Add separator."""
- self.add('separator', cnf or kw)
+ self.add("separator", cnf or kw)
def insert(self, index, itemType, cnf={}, **kw):
"""Internal function."""
- self.tk.call((self._w, 'insert', index, itemType) +
+ self.tk.call((self._w, "insert", index, itemType) +
self._options(cnf, kw))
def insert_cascade(self, index, cnf={}, **kw):
"""Add hierarchical menu item at INDEX."""
- self.insert(index, 'cascade', cnf or kw)
+ self.insert(index, "cascade", cnf or kw)
def insert_checkbutton(self, index, cnf={}, **kw):
"""Add checkbutton menu item at INDEX."""
- self.insert(index, 'checkbutton', cnf or kw)
+ self.insert(index, "checkbutton", cnf or kw)
def insert_command(self, index, cnf={}, **kw):
"""Add command menu item at INDEX."""
- self.insert(index, 'command', cnf or kw)
+ self.insert(index, "command", cnf or kw)
def insert_radiobutton(self, index, cnf={}, **kw):
"""Add radio menu item at INDEX."""
- self.insert(index, 'radiobutton', cnf or kw)
+ self.insert(index, "radiobutton", cnf or kw)
def insert_separator(self, index, cnf={}, **kw):
"""Add separator at INDEX."""
- self.insert(index, 'separator', cnf or kw)
+ self.insert(index, "separator", cnf or kw)
def delete(self, index1, index2=None):
"""Delete menu items between INDEX1 and INDEX2 (included)."""
@@ -3383,68 +3383,68 @@ def delete(self, index1, index2=None):
num_index1, num_index2 = 0, -1
for i in range(num_index1, num_index2 + 1):
- if 'command' in self.entryconfig(i):
- c = str(self.entrycget(i, 'command'))
+ if "command" in self.entryconfig(i):
+ c = str(self.entrycget(i, "command"))
if c:
self.deletecommand(c)
- self.tk.call(self._w, 'delete', index1, index2)
+ self.tk.call(self._w, "delete", index1, index2)
def entrycget(self, index, option):
"""Return the resource value of a menu item for OPTION at INDEX."""
- return self.tk.call(self._w, 'entrycget', index, '-' + option)
+ return self.tk.call(self._w, "entrycget", index, "-" + option)
def entryconfigure(self, index, cnf=None, **kw):
"""Configure a menu item at INDEX."""
- return self._configure(('entryconfigure', index), cnf, kw)
+ return self._configure(("entryconfigure", index), cnf, kw)
entryconfig = entryconfigure
def index(self, index):
"""Return the index of a menu item identified by INDEX."""
- i = self.tk.call(self._w, 'index', index)
- if i == 'none': return None
+ i = self.tk.call(self._w, "index", index)
+ if i == "none": return None
return self.tk.getint(i)
def invoke(self, index):
"""Invoke a menu item identified by INDEX and execute
the associated command."""
- return self.tk.call(self._w, 'invoke', index)
+ return self.tk.call(self._w, "invoke", index)
def post(self, x, y):
"""Display a menu at position X,Y."""
- self.tk.call(self._w, 'post', x, y)
+ self.tk.call(self._w, "post", x, y)
def type(self, index):
"""Return the type of the menu item at INDEX."""
- return self.tk.call(self._w, 'type', index)
+ return self.tk.call(self._w, "type", index)
def unpost(self):
"""Unmap a menu."""
- self.tk.call(self._w, 'unpost')
+ self.tk.call(self._w, "unpost")
def xposition(self, index): # new in Tk 8.5
"""Return the x-position of the leftmost pixel of the menu item
at INDEX."""
- return self.tk.getint(self.tk.call(self._w, 'xposition', index))
+ return self.tk.getint(self.tk.call(self._w, "xposition", index))
def yposition(self, index):
"""Return the y-position of the topmost pixel of the menu item at INDEX."""
return self.tk.getint(self.tk.call(
- self._w, 'yposition', index))
+ self._w, "yposition", index))
class Menubutton(Widget):
"""Menubutton widget, obsolete since Tk8.0."""
def __init__(self, master=None, cnf={}, **kw):
- Widget.__init__(self, master, 'menubutton', cnf, kw)
+ Widget.__init__(self, master, "menubutton", cnf, kw)
class Message(Widget):
"""Message widget to display multiline text. Obsolete since Label does it too."""
def __init__(self, master=None, cnf={}, **kw):
- Widget.__init__(self, master, 'message', cnf, kw)
+ Widget.__init__(self, master, "message", cnf, kw)
class Radiobutton(Widget):
@@ -3460,24 +3460,24 @@ def __init__(self, master=None, cnf={}, **kw):
indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
state, takefocus, text, textvariable, underline, value, variable,
width, wraplength."""
- Widget.__init__(self, master, 'radiobutton', cnf, kw)
+ Widget.__init__(self, master, "radiobutton", cnf, kw)
def deselect(self):
"""Put the button in off-state."""
- self.tk.call(self._w, 'deselect')
+ self.tk.call(self._w, "deselect")
def flash(self):
"""Flash the button."""
- self.tk.call(self._w, 'flash')
+ self.tk.call(self._w, "flash")
def invoke(self):
"""Toggle the button and invoke a command if given as resource."""
- return self.tk.call(self._w, 'invoke')
+ return self.tk.call(self._w, "invoke")
def select(self):
"""Put the button in on-state."""
- self.tk.call(self._w, 'select')
+ self.tk.call(self._w, "select")
class Scale(Widget):
@@ -3492,11 +3492,11 @@ def __init__(self, master=None, cnf={}, **kw):
length, orient, relief, repeatdelay, repeatinterval, resolution,
showvalue, sliderlength, sliderrelief, state, takefocus,
tickinterval, to, troughcolor, variable, width."""
- Widget.__init__(self, master, 'scale', cnf, kw)
+ Widget.__init__(self, master, "scale", cnf, kw)
def get(self):
"""Get the current value as integer or float."""
- value = self.tk.call(self._w, 'get')
+ value = self.tk.call(self._w, "get")
try:
return self.tk.getint(value)
except (ValueError, TypeError, TclError):
@@ -3504,19 +3504,19 @@ def get(self):
def set(self, value):
"""Set the value to VALUE."""
- self.tk.call(self._w, 'set', value)
+ self.tk.call(self._w, "set", value)
def coords(self, value=None):
"""Return a tuple (X,Y) of the point along the centerline of the
trough that corresponds to VALUE or the current value if None is
given."""
- return self._getints(self.tk.call(self._w, 'coords', value))
+ return self._getints(self.tk.call(self._w, "coords", value))
def identify(self, x, y):
"""Return where the point X,Y lies. Valid return values are "slider",
"though1" and "though2"."""
- return self.tk.call(self._w, 'identify', x, y)
+ return self.tk.call(self._w, "identify", x, y)
class Scrollbar(Widget):
@@ -3531,7 +3531,7 @@ def __init__(self, master=None, cnf={}, **kw):
highlightcolor, highlightthickness, jump, orient,
relief, repeatdelay, repeatinterval, takefocus,
troughcolor, width."""
- Widget.__init__(self, master, 'scrollbar', cnf, kw)
+ Widget.__init__(self, master, "scrollbar", cnf, kw)
def activate(self, index=None):
"""Marks the element indicated by index as active.
@@ -3540,33 +3540,33 @@ def activate(self, index=None):
element of the scrollbar will be active. If index is not specified,
the method returns the name of the element that is currently active,
or None if no element is active."""
- return self.tk.call(self._w, 'activate', index) or None
+ return self.tk.call(self._w, "activate", index) or None
def delta(self, deltax, deltay):
"""Return the fractional change of the scrollbar setting if it
would be moved by DELTAX or DELTAY pixels."""
return self.tk.getdouble(
- self.tk.call(self._w, 'delta', deltax, deltay))
+ self.tk.call(self._w, "delta", deltax, deltay))
def fraction(self, x, y):
"""Return the fractional value which corresponds to a slider
position of X,Y."""
- return self.tk.getdouble(self.tk.call(self._w, 'fraction', x, y))
+ return self.tk.getdouble(self.tk.call(self._w, "fraction", x, y))
def identify(self, x, y):
"""Return the element under position X,Y as one of
"arrow1","slider","arrow2" or ""."""
- return self.tk.call(self._w, 'identify', x, y)
+ return self.tk.call(self._w, "identify", x, y)
def get(self):
"""Return the current fractional values (upper and lower end)
of the slider position."""
- return self._getdoubles(self.tk.call(self._w, 'get'))
+ return self._getdoubles(self.tk.call(self._w, "get"))
def set(self, first, last):
"""Set the fractional values of the slider position (upper and
lower ends as value between 0 and 1)."""
- self.tk.call(self._w, 'set', first, last)
+ self.tk.call(self._w, "set", first, last)
class Text(Widget, XView, YView):
@@ -3595,19 +3595,19 @@ def __init__(self, master=None, cnf={}, **kw):
state, tabs, undo, width, wrap,
"""
- Widget.__init__(self, master, 'text', cnf, kw)
+ Widget.__init__(self, master, "text", cnf, kw)
def bbox(self, index):
"""Return a tuple of (x,y,width,height) which gives the bounding
box of the visible part of the character at the given index."""
return self._getints(
- self.tk.call(self._w, 'bbox', index)) or None
+ self.tk.call(self._w, "bbox", index)) or None
def compare(self, index1, op, index2):
"""Return whether between index INDEX1 and index INDEX2 the
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=."""
return self.tk.getboolean(self.tk.call(
- self._w, 'compare', index1, op, index2))
+ self._w, "compare", index1, op, index2))
def count(self, index1, index2, *args): # new in Tk 8.5
"""Counts the number of relevant things between the two indices.
@@ -3621,9 +3621,9 @@ def count(self, index1, index2, *args): # new in Tk 8.5
"lines", "xpixels" and "ypixels". There is an additional possible
option "update", which if given then all subsequent options ensure
that any possible out of date information is recalculated."""
- args = ['-%s' % arg for arg in args]
+ args = ["-%s" % arg for arg in args]
args += [index1, index2]
- res = self.tk.call(self._w, 'count', *args) or None
+ res = self.tk.call(self._w, "count", *args) or None
if res is not None and len(args) <= 3:
return (res, )
else:
@@ -3633,18 +3633,18 @@ def debug(self, boolean=None):
"""Turn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN."""
if boolean is None:
- return self.tk.getboolean(self.tk.call(self._w, 'debug'))
- self.tk.call(self._w, 'debug', boolean)
+ return self.tk.getboolean(self.tk.call(self._w, "debug"))
+ self.tk.call(self._w, "debug", boolean)
def delete(self, index1, index2=None):
"""Delete the characters between INDEX1 and INDEX2 (not included)."""
- self.tk.call(self._w, 'delete', index1, index2)
+ self.tk.call(self._w, "delete", index1, index2)
def dlineinfo(self, index):
"""Return tuple (x,y,width,height,baseline) giving the bounding box
and baseline position of the visible part of the line containing
the character at INDEX."""
- return self._getints(self.tk.call(self._w, 'dlineinfo', index))
+ return self._getints(self.tk.call(self._w, "dlineinfo", index))
def dump(self, index1, index2=None, command=None, **kw):
"""Return the contents of the widget between index1 and index2.
@@ -3699,7 +3699,7 @@ def edit(self, *args):
and edit_undo
"""
- return self.tk.call(self._w, 'edit', *args)
+ return self.tk.call(self._w, "edit", *args)
def edit_modified(self, arg=None):
"""Get or Set the modified flag
@@ -3747,7 +3747,7 @@ def edit_undo(self):
def get(self, index1, index2=None):
"""Return the text from INDEX1 to INDEX2 (not included)."""
- return self.tk.call(self._w, 'get', index1, index2)
+ return self.tk.call(self._w, "get", index1, index2)
# (Image commands are new in 8.0)
def image_cget(self, index, option):
@@ -3760,7 +3760,7 @@ def image_cget(self, index, option):
def image_configure(self, index, cnf=None, **kw):
"""Configure an embedded image at INDEX."""
- return self._configure(('image', 'configure', index), cnf, kw)
+ return self._configure(("image", "configure", index), cnf, kw)
def image_create(self, index, cnf={}, **kw):
"""Create an embedded image at INDEX."""
@@ -3774,52 +3774,52 @@ def image_names(self):
def index(self, index):
"""Return the index in the form line.char for INDEX."""
- return str(self.tk.call(self._w, 'index', index))
+ return str(self.tk.call(self._w, "index", index))
def insert(self, index, chars, *args):
"""Insert CHARS before the characters at INDEX. An additional
tag can be given in ARGS. Additional CHARS and tags can follow in ARGS."""
- self.tk.call((self._w, 'insert', index, chars) + args)
+ self.tk.call((self._w, "insert", index, chars) + args)
def mark_gravity(self, markName, direction=None):
"""Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
Return the current value if None is given for DIRECTION."""
return self.tk.call(
- (self._w, 'mark', 'gravity', markName, direction))
+ (self._w, "mark", "gravity", markName, direction))
def mark_names(self):
"""Return all mark names."""
return self.tk.splitlist(self.tk.call(
- self._w, 'mark', 'names'))
+ self._w, "mark", "names"))
def mark_set(self, markName, index):
"""Set mark MARKNAME before the character at INDEX."""
- self.tk.call(self._w, 'mark', 'set', markName, index)
+ self.tk.call(self._w, "mark", "set", markName, index)
def mark_unset(self, *markNames):
"""Delete all marks in MARKNAMES."""
- self.tk.call((self._w, 'mark', 'unset') + markNames)
+ self.tk.call((self._w, "mark", "unset") + markNames)
def mark_next(self, index):
"""Return the name of the next mark after INDEX."""
- return self.tk.call(self._w, 'mark', 'next', index) or None
+ return self.tk.call(self._w, "mark", "next", index) or None
def mark_previous(self, index):
"""Return the name of the previous mark before INDEX."""
- return self.tk.call(self._w, 'mark', 'previous', index) or None
+ return self.tk.call(self._w, "mark", "previous", index) or None
def peer_create(self, newPathName, cnf={}, **kw): # new in Tk 8.5
"""Creates a peer text widget with the given newPathName, and any
optional standard configuration options. By default the peer will
have the same start and end line as the parent widget, but
these can be overridden with the standard configuration options."""
- self.tk.call(self._w, 'peer', 'create', newPathName,
+ self.tk.call(self._w, "peer", "create", newPathName,
*self._options(cnf, kw))
def peer_names(self): # new in Tk 8.5
"""Returns a list of peers of this widget (this does not include
the widget itself)."""
- return self.tk.splitlist(self.tk.call(self._w, 'peer', 'names'))
+ return self.tk.splitlist(self.tk.call(self._w, "peer", "names"))
def replace(self, index1, index2, chars, *args): # new in Tk 8.5
"""Replaces the range of characters between index1 and index2 with
@@ -3827,17 +3827,17 @@ def replace(self, index1, index2, chars, *args): # new in Tk 8.5
See the method insert for some more information about args, and the
method delete for information about the indices."""
- self.tk.call(self._w, 'replace', index1, index2, chars, *args)
+ self.tk.call(self._w, "replace", index1, index2, chars, *args)
def scan_mark(self, x, y):
"""Remember the current X, Y coordinates."""
- self.tk.call(self._w, 'scan', 'mark', x, y)
+ self.tk.call(self._w, "scan", "mark", x, y)
def scan_dragto(self, x, y):
"""Adjust the view of the text to 10 times the
difference between X and Y and the coordinates given in
scan_mark."""
- self.tk.call(self._w, 'scan', 'dragto', x, y)
+ self.tk.call(self._w, "scan", "dragto", x, y)
def search(self, pattern, index, stopindex=None,
forwards=None, backwards=None, exact=None,
@@ -3845,15 +3845,15 @@ def search(self, pattern, index, stopindex=None,
"""Search PATTERN beginning from INDEX until STOPINDEX.
Return the index of the first character of a match or an
empty string."""
- args = [self._w, 'search']
- if forwards: args.append('-forwards')
- if backwards: args.append('-backwards')
- if exact: args.append('-exact')
- if regexp: args.append('-regexp')
- if nocase: args.append('-nocase')
- if elide: args.append('-elide')
- if count: args.append('-count'); args.append(count)
- if pattern and pattern[0] == '-': args.append('--')
+ args = [self._w, "search"]
+ if forwards: args.append("-forwards")
+ if backwards: args.append("-backwards")
+ if exact: args.append("-exact")
+ if regexp: args.append("-regexp")
+ if nocase: args.append("-nocase")
+ if elide: args.append("-elide")
+ if count: args.append("-count"); args.append(count)
+ if pattern and pattern[0] == "-": args.append("--")
args.append(pattern)
args.append(index)
if stopindex: args.append(stopindex)
@@ -3861,18 +3861,18 @@ def search(self, pattern, index, stopindex=None,
def see(self, index):
"""Scroll such that the character at INDEX is visible."""
- self.tk.call(self._w, 'see', index)
+ self.tk.call(self._w, "see", index)
def tag_add(self, tagName, index1, *args):
"""Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
Additional pairs of indices may follow in ARGS."""
self.tk.call(
- (self._w, 'tag', 'add', tagName, index1) + args)
+ (self._w, "tag", "add", tagName, index1) + args)
def tag_unbind(self, tagName, sequence, funcid=None):
"""Unbind for all characters with TAGNAME for event SEQUENCE the
function identified with FUNCID."""
- self.tk.call(self._w, 'tag', 'bind', tagName, sequence, '')
+ self.tk.call(self._w, "tag", "bind", tagName, sequence, "")
if funcid:
self.deletecommand(funcid)
@@ -3882,95 +3882,95 @@ def tag_bind(self, tagName, sequence, func, add=None):
An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the previous function. See bind for the return value."""
- return self._bind((self._w, 'tag', 'bind', tagName),
+ return self._bind((self._w, "tag", "bind", tagName),
sequence, func, add)
def tag_cget(self, tagName, option):
"""Return the value of OPTION for tag TAGNAME."""
- if option[:1] != '-':
- option = '-' + option
- if option[-1:] == '_':
+ if option[:1] != "-":
+ option = "-" + option
+ if option[-1:] == "_":
option = option[:-1]
- return self.tk.call(self._w, 'tag', 'cget', tagName, option)
+ return self.tk.call(self._w, "tag", "cget", tagName, option)
def tag_configure(self, tagName, cnf=None, **kw):
"""Configure a tag TAGNAME."""
- return self._configure(('tag', 'configure', tagName), cnf, kw)
+ return self._configure(("tag", "configure", tagName), cnf, kw)
tag_config = tag_configure
def tag_delete(self, *tagNames):
"""Delete all tags in TAGNAMES."""
- self.tk.call((self._w, 'tag', 'delete') + tagNames)
+ self.tk.call((self._w, "tag", "delete") + tagNames)
def tag_lower(self, tagName, belowThis=None):
"""Change the priority of tag TAGNAME such that it is lower
than the priority of BELOWTHIS."""
- self.tk.call(self._w, 'tag', 'lower', tagName, belowThis)
+ self.tk.call(self._w, "tag", "lower", tagName, belowThis)
def tag_names(self, index=None):
"""Return a list of all tag names."""
return self.tk.splitlist(
- self.tk.call(self._w, 'tag', 'names', index))
+ self.tk.call(self._w, "tag", "names", index))
def tag_nextrange(self, tagName, index1, index2=None):
"""Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1."""
return self.tk.splitlist(self.tk.call(
- self._w, 'tag', 'nextrange', tagName, index1, index2))
+ self._w, "tag", "nextrange", tagName, index1, index2))
def tag_prevrange(self, tagName, index1, index2=None):
"""Return a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched backwards from INDEX1."""
return self.tk.splitlist(self.tk.call(
- self._w, 'tag', 'prevrange', tagName, index1, index2))
+ self._w, "tag", "prevrange", tagName, index1, index2))
def tag_raise(self, tagName, aboveThis=None):
"""Change the priority of tag TAGNAME such that it is higher
than the priority of ABOVETHIS."""
self.tk.call(
- self._w, 'tag', 'raise', tagName, aboveThis)
+ self._w, "tag", "raise", tagName, aboveThis)
def tag_ranges(self, tagName):
"""Return a list of ranges of text which have tag TAGNAME."""
return self.tk.splitlist(self.tk.call(
- self._w, 'tag', 'ranges', tagName))
+ self._w, "tag", "ranges", tagName))
def tag_remove(self, tagName, index1, index2=None):
"""Remove tag TAGNAME from all characters between INDEX1 and INDEX2."""
self.tk.call(
- self._w, 'tag', 'remove', tagName, index1, index2)
+ self._w, "tag", "remove", tagName, index1, index2)
def window_cget(self, index, option):
"""Return the value of OPTION of an embedded window at INDEX."""
- if option[:1] != '-':
- option = '-' + option
- if option[-1:] == '_':
+ if option[:1] != "-":
+ option = "-" + option
+ if option[-1:] == "_":
option = option[:-1]
- return self.tk.call(self._w, 'window', 'cget', index, option)
+ return self.tk.call(self._w, "window", "cget", index, option)
def window_configure(self, index, cnf=None, **kw):
"""Configure an embedded window at INDEX."""
- return self._configure(('window', 'configure', index), cnf, kw)
+ return self._configure(("window", "configure", index), cnf, kw)
window_config = window_configure
def window_create(self, index, cnf={}, **kw):
"""Create a window at INDEX."""
self.tk.call(
- (self._w, 'window', 'create', index)
+ (self._w, "window", "create", index)
+ self._options(cnf, kw))
def window_names(self):
"""Return all names of embedded windows in this widget."""
return self.tk.splitlist(
- self.tk.call(self._w, 'window', 'names'))
+ self.tk.call(self._w, "window", "names"))
def yview_pickplace(self, *what):
"""Obsolete function, use see."""
- self.tk.call((self._w, 'yview', '-pickplace') + what)
+ self.tk.call((self._w, "yview", "-pickplace") + what)
class _setit:
@@ -3999,15 +3999,15 @@ def __init__(self, master, variable, value, *values, **kwargs):
"indicatoron": 1, "relief": RAISED, "anchor": "c",
"highlightthickness": 2}
Widget.__init__(self, master, "menubutton", kw)
- self.widgetName = 'tk_optionMenu'
+ self.widgetName = "tk_optionMenu"
menu = self.__menu = Menu(self, name="menu", tearoff=0)
self.menuname = menu._w
# 'command' is the only supported keyword
- callback = kwargs.get('command')
- if 'command' in kwargs:
- del kwargs['command']
+ callback = kwargs.get("command")
+ if "command" in kwargs:
+ del kwargs["command"]
if kwargs:
- raise TclError('unknown option -'+next(iter(kwargs)))
+ raise TclError("unknown option -"+next(iter(kwargs)))
menu.add_command(label=value,
command=_setit(variable, value, callback))
for v in values:
@@ -4016,7 +4016,7 @@ def __init__(self, master, variable, value, *values, **kwargs):
self["menu"] = menu
def __getitem__(self, name):
- if name == 'menu':
+ if name == "menu":
return self.__menu
return Widget.__getitem__(self, name)
@@ -4033,8 +4033,8 @@ class Image:
def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
self.name = None
if master is None:
- master = _get_default_root('create image')
- self.tk = getattr(master, 'tk', master)
+ master = _get_default_root("create image")
+ self.tk = getattr(master, "tk", master)
if not name:
Image._last_id += 1
name = "pyimage%r" % (Image._last_id,) # tk itself would use image
@@ -4044,8 +4044,8 @@ def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
for k, v in cnf.items():
if callable(v):
v = self._register(v)
- options = options + ('-'+k, v)
- self.tk.call(('image', 'create', imgtype, name,) + options)
+ options = options + ("-"+k, v)
+ self.tk.call(("image", "create", imgtype, name,) + options)
self.name = name
def __str__(self): return self.name
@@ -4053,43 +4053,43 @@ def __str__(self): return self.name
def __del__(self):
if self.name:
try:
- self.tk.call('image', 'delete', self.name)
+ self.tk.call("image", "delete", self.name)
except TclError:
# May happen if the root was destroyed
pass
def __setitem__(self, key, value):
- self.tk.call(self.name, 'configure', '-'+key, value)
+ self.tk.call(self.name, "configure", "-"+key, value)
def __getitem__(self, key):
- return self.tk.call(self.name, 'configure', '-'+key)
+ return self.tk.call(self.name, "configure", "-"+key)
def configure(self, **kw):
"""Configure the image."""
res = ()
for k, v in _cnfmerge(kw).items():
if v is not None:
- if k[-1] == '_': k = k[:-1]
+ if k[-1] == "_": k = k[:-1]
if callable(v):
v = self._register(v)
- res = res + ('-'+k, v)
- self.tk.call((self.name, 'config') + res)
+ res = res + ("-"+k, v)
+ self.tk.call((self.name, "config") + res)
config = configure
def height(self):
"""Return the height of the image."""
return self.tk.getint(
- self.tk.call('image', 'height', self.name))
+ self.tk.call("image", "height", self.name))
def type(self):
"""Return the type of the image, e.g. "photo" or "bitmap"."""
- return self.tk.call('image', 'type', self.name)
+ return self.tk.call("image", "type", self.name)
def width(self):
"""Return the width of the image."""
return self.tk.getint(
- self.tk.call('image', 'width', self.name))
+ self.tk.call("image", "width", self.name))
class PhotoImage(Image):
@@ -4100,80 +4100,80 @@ def __init__(self, name=None, cnf={}, master=None, **kw):
Valid resource names: data, format, file, gamma, height, palette,
width."""
- Image.__init__(self, 'photo', name, cnf, master, **kw)
+ Image.__init__(self, "photo", name, cnf, master, **kw)
def blank(self):
"""Display a transparent image."""
- self.tk.call(self.name, 'blank')
+ self.tk.call(self.name, "blank")
def cget(self, option):
"""Return the value of OPTION."""
- return self.tk.call(self.name, 'cget', '-' + option)
+ return self.tk.call(self.name, "cget", "-" + option)
# XXX config
def __getitem__(self, key):
- return self.tk.call(self.name, 'cget', '-' + key)
+ return self.tk.call(self.name, "cget", "-" + key)
# XXX copy -from, -to, ...?
def copy(self):
"""Return a new PhotoImage with the same image as this widget."""
destImage = PhotoImage(master=self.tk)
- self.tk.call(destImage, 'copy', self.name)
+ self.tk.call(destImage, "copy", self.name)
return destImage
- def zoom(self, x, y=''):
+ def zoom(self, x, y=""):
"""Return a new PhotoImage with the same image as this widget
but zoom it with a factor of x in the X direction and y in the Y
direction. If y is not given, the default value is the same as x.
"""
destImage = PhotoImage(master=self.tk)
- if y=='': y=x
- self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
+ if y=="": y=x
+ self.tk.call(destImage, "copy", self.name, "-zoom",x,y)
return destImage
- def subsample(self, x, y=''):
+ def subsample(self, x, y=""):
"""Return a new PhotoImage based on the same image as this widget
but use only every Xth or Yth pixel. If y is not given, the
default value is the same as x.
"""
destImage = PhotoImage(master=self.tk)
- if y=='': y=x
- self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)
+ if y=="": y=x
+ self.tk.call(destImage, "copy", self.name, "-subsample",x,y)
return destImage
def get(self, x, y):
"""Return the color (red, green, blue) of the pixel at X,Y."""
- return self.tk.call(self.name, 'get', x, y)
+ return self.tk.call(self.name, "get", x, y)
def put(self, data, to=None):
"""Put row formatted colors to image starting from
position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))"""
- args = (self.name, 'put', data)
+ args = (self.name, "put", data)
if to:
- if to[0] == '-to':
+ if to[0] == "-to":
to = to[1:]
- args = args + ('-to',) + tuple(to)
+ args = args + ("-to",) + tuple(to)
self.tk.call(args)
# XXX read
def write(self, filename, format=None, from_coords=None):
"""Write image to file FILENAME in FORMAT starting from
position FROM_COORDS."""
- args = (self.name, 'write', filename)
+ args = (self.name, "write", filename)
if format:
- args = args + ('-format', format)
+ args = args + ("-format", format)
if from_coords:
- args = args + ('-from',) + tuple(from_coords)
+ args = args + ("-from",) + tuple(from_coords)
self.tk.call(args)
def transparency_get(self, x, y):
"""Return True if the pixel at x,y is transparent."""
return self.tk.getboolean(self.tk.call(
- self.name, 'transparency', 'get', x, y))
+ self.name, "transparency", "get", x, y))
def transparency_set(self, x, y, boolean):
"""Set the transparency of the pixel at x,y."""
- self.tk.call(self.name, 'transparency', 'set', x, y, boolean)
+ self.tk.call(self.name, "transparency", "set", x, y, boolean)
class BitmapImage(Image):
@@ -4183,17 +4183,17 @@ def __init__(self, name=None, cnf={}, master=None, **kw):
"""Create a bitmap with NAME.
Valid resource names: background, data, file, foreground, maskdata, maskfile."""
- Image.__init__(self, 'bitmap', name, cnf, master, **kw)
+ Image.__init__(self, "bitmap", name, cnf, master, **kw)
def image_names():
- tk = _get_default_root('use image_names()').tk
- return tk.splitlist(tk.call('image', 'names'))
+ tk = _get_default_root("use image_names()").tk
+ return tk.splitlist(tk.call("image", "names"))
def image_types():
- tk = _get_default_root('use image_types()').tk
- return tk.splitlist(tk.call('image', 'types'))
+ tk = _get_default_root("use image_types()").tk
+ return tk.splitlist(tk.call("image", "types"))
class Spinbox(Widget, XView):
@@ -4226,7 +4226,7 @@ def __init__(self, master=None, cnf={}, **kw):
validate, validatecommand values,
width, wrap,
"""
- Widget.__init__(self, master, 'spinbox', cnf, kw)
+ Widget.__init__(self, master, "spinbox", cnf, kw)
def bbox(self, index):
"""Return a tuple of X1,Y1,X2,Y2 coordinates for a
@@ -4240,7 +4240,7 @@ def bbox(self, index):
bounding box may refer to a region outside the
visible area of the window.
"""
- return self._getints(self.tk.call(self._w, 'bbox', index)) or None
+ return self._getints(self.tk.call(self._w, "bbox", index)) or None
def delete(self, first, last=None):
"""Delete one or more elements of the spinbox.
@@ -4251,11 +4251,11 @@ def delete(self, first, last=None):
defaults to first+1, i.e. a single character is
deleted. This command returns an empty string.
"""
- return self.tk.call(self._w, 'delete', first, last)
+ return self.tk.call(self._w, "delete", first, last)
def get(self):
"""Returns the spinbox's string"""
- return self.tk.call(self._w, 'get')
+ return self.tk.call(self._w, "get")
def icursor(self, index):
"""Alter the position of the insertion cursor.
@@ -4263,26 +4263,26 @@ def icursor(self, index):
The insertion cursor will be displayed just before
the character given by index. Returns an empty string
"""
- return self.tk.call(self._w, 'icursor', index)
+ return self.tk.call(self._w, "icursor", index)
def identify(self, x, y):
"""Returns the name of the widget at position x, y
Return value is one of: none, buttondown, buttonup, entry
"""
- return self.tk.call(self._w, 'identify', x, y)
+ return self.tk.call(self._w, "identify", x, y)
def index(self, index):
"""Returns the numerical index corresponding to index
"""
- return self.tk.call(self._w, 'index', index)
+ return self.tk.call(self._w, "index", index)
def insert(self, index, s):
"""Insert string s at index
Returns an empty string.
"""
- return self.tk.call(self._w, 'insert', index, s)
+ return self.tk.call(self._w, "insert", index, s)
def invoke(self, element):
"""Causes the specified element to be invoked
@@ -4290,12 +4290,12 @@ def invoke(self, element):
The element could be buttondown or buttonup
triggering the action associated with it.
"""
- return self.tk.call(self._w, 'invoke', element)
+ return self.tk.call(self._w, "invoke", element)
def scan(self, *args):
"""Internal function."""
return self._getints(
- self.tk.call((self._w, 'scan') + args)) or ()
+ self.tk.call((self._w, "scan") + args)) or ()
def scan_mark(self, x):
"""Records x and the current view in the spinbox window;
@@ -4321,7 +4321,7 @@ def scan_dragto(self, x):
def selection(self, *args):
"""Internal function."""
return self._getints(
- self.tk.call((self._w, 'selection') + args)) or ()
+ self.tk.call((self._w, "selection") + args)) or ()
def selection_adjust(self, index):
"""Locate the end of the selection nearest to the character
@@ -4351,25 +4351,25 @@ def selection_element(self, element=None):
If a spinbutton element is specified, it will be
displayed depressed.
"""
- return self.tk.call(self._w, 'selection', 'element', element)
+ return self.tk.call(self._w, "selection", "element", element)
def selection_from(self, index):
"""Set the fixed end of a selection to INDEX."""
- self.selection('from', index)
+ self.selection("from", index)
def selection_present(self):
"""Return True if there are characters selected in the spinbox, False
otherwise."""
return self.tk.getboolean(
- self.tk.call(self._w, 'selection', 'present'))
+ self.tk.call(self._w, "selection", "present"))
def selection_range(self, start, end):
"""Set the selection from START to END (not included)."""
- self.selection('range', start, end)
+ self.selection("range", start, end)
def selection_to(self, index):
"""Set the variable end of a selection to INDEX."""
- self.selection('to', index)
+ self.selection("to", index)
###########################################################################
@@ -4393,7 +4393,7 @@ def __init__(self, master=None, cnf={}, **kw):
height, labelanchor, labelwidget,
visual, width
"""
- Widget.__init__(self, master, 'labelframe', cnf, kw)
+ Widget.__init__(self, master, "labelframe", cnf, kw)
########################################################################
@@ -4415,7 +4415,7 @@ def __init__(self, master=None, cnf={}, **kw):
sashcursor, sashpad, sashrelief,
sashwidth, showhandle,
"""
- Widget.__init__(self, master, 'panedwindow', cnf, kw)
+ Widget.__init__(self, master, "panedwindow", cnf, kw)
def add(self, child, **kw):
"""Add a child widget to the panedwindow in a new pane.
@@ -4425,14 +4425,14 @@ def add(self, child, **kw):
manage the windows. The possible options and values
are the ones accepted by the paneconfigure method.
"""
- self.tk.call((self._w, 'add', child) + self._options(kw))
+ self.tk.call((self._w, "add", child) + self._options(kw))
def remove(self, child):
"""Remove the pane containing child from the panedwindow
All geometry management options for child will be forgotten.
"""
- self.tk.call(self._w, 'forget', child)
+ self.tk.call(self._w, "forget", child)
forget = remove
@@ -4446,12 +4446,12 @@ def identify(self, x, y):
is over any other part of the panedwindow, the result is
an empty list.
"""
- return self.tk.call(self._w, 'identify', x, y)
+ return self.tk.call(self._w, "identify", x, y)
def proxy(self, *args):
"""Internal function."""
return self._getints(
- self.tk.call((self._w, 'proxy') + args)) or ()
+ self.tk.call((self._w, "proxy") + args)) or ()
def proxy_coord(self):
"""Return the x and y pair of the most recent proxy location
@@ -4471,7 +4471,7 @@ def proxy_place(self, x, y):
def sash(self, *args):
"""Internal function."""
return self._getints(
- self.tk.call((self._w, 'sash') + args)) or ()
+ self.tk.call((self._w, "sash") + args)) or ()
def sash_coord(self, index):
"""Return the current x and y pair for the sash given by index.
@@ -4505,7 +4505,7 @@ def panecget(self, child, option):
Option may be any value allowed by the paneconfigure subcommand
"""
return self.tk.call(
- (self._w, 'panecget') + (child, '-'+option))
+ (self._w, "panecget") + (child, "-"+option))
def paneconfigure(self, tagOrId, cnf=None, **kw):
"""Query or modify the management options for window.
@@ -4576,18 +4576,18 @@ def paneconfigure(self, tagOrId, cnf=None, **kw):
"""
if cnf is None and not kw:
- return self._getconfigure(self._w, 'paneconfigure', tagOrId)
+ return self._getconfigure(self._w, "paneconfigure", tagOrId)
if isinstance(cnf, str) and not kw:
return self._getconfigure1(
- self._w, 'paneconfigure', tagOrId, '-'+cnf)
- self.tk.call((self._w, 'paneconfigure', tagOrId) +
+ self._w, "paneconfigure", tagOrId, "-"+cnf)
+ self.tk.call((self._w, "paneconfigure", tagOrId) +
self._options(cnf, kw))
paneconfig = paneconfigure
def panes(self):
"""Returns an ordered list of the child panes."""
- return self.tk.splitlist(self.tk.call(self._w, 'panes'))
+ return self.tk.splitlist(self.tk.call(self._w, "panes"))
# Test:
@@ -4600,7 +4600,7 @@ def _test():
label.pack()
test = Button(root, text="Click me!",
command=lambda root=root: root.test.configure(
- text="[%s]" % root.test['text']))
+ text="[%s]" % root.test["text"]))
test.pack()
root.test = test
quit = Button(root, text="QUIT", command=root.destroy)
@@ -4614,8 +4614,8 @@ def _test():
__all__ = [name for name, obj in globals().items()
- if not name.startswith('_') and not isinstance(obj, types.ModuleType)
- and name not in {'wantobjects'}]
+ if not name.startswith("_") and not isinstance(obj, types.ModuleType)
+ and name not in {"wantobjects"}]
-if __name__ == '__main__':
+if __name__ == "__main__":
_test()
diff --git a/.venv3.10/Lib/tkinter/commondialog.py b/.venv3.10/Lib/tkinter/commondialog.py
index e595c99d..fdfb0f57 100644
--- a/.venv3.10/Lib/tkinter/commondialog.py
+++ b/.venv3.10/Lib/tkinter/commondialog.py
@@ -10,7 +10,7 @@
__all__ = ["Dialog"]
-from tkinter import Frame, _get_temp_root, _destroy_temp_root
+from tkinter import _get_temp_root, _destroy_temp_root
class Dialog:
@@ -19,7 +19,7 @@ class Dialog:
def __init__(self, master=None, **options):
if master is None:
- master = options.get('parent')
+ master = options.get("parent")
self.master = master
self.options = options
diff --git a/.venv3.10/Lib/tkinter/constants.py b/.venv3.10/Lib/tkinter/constants.py
index 63eee33d..a4fd798c 100644
--- a/.venv3.10/Lib/tkinter/constants.py
+++ b/.venv3.10/Lib/tkinter/constants.py
@@ -5,106 +5,106 @@
YES=TRUE=ON=1
# -anchor and -sticky
-N='n'
-S='s'
-W='w'
-E='e'
-NW='nw'
-SW='sw'
-NE='ne'
-SE='se'
-NS='ns'
-EW='ew'
-NSEW='nsew'
-CENTER='center'
+N="n"
+S="s"
+W="w"
+E="e"
+NW="nw"
+SW="sw"
+NE="ne"
+SE="se"
+NS="ns"
+EW="ew"
+NSEW="nsew"
+CENTER="center"
# -fill
-NONE='none'
-X='x'
-Y='y'
-BOTH='both'
+NONE="none"
+X="x"
+Y="y"
+BOTH="both"
# -side
-LEFT='left'
-TOP='top'
-RIGHT='right'
-BOTTOM='bottom'
+LEFT="left"
+TOP="top"
+RIGHT="right"
+BOTTOM="bottom"
# -relief
-RAISED='raised'
-SUNKEN='sunken'
-FLAT='flat'
-RIDGE='ridge'
-GROOVE='groove'
-SOLID = 'solid'
+RAISED="raised"
+SUNKEN="sunken"
+FLAT="flat"
+RIDGE="ridge"
+GROOVE="groove"
+SOLID = "solid"
# -orient
-HORIZONTAL='horizontal'
-VERTICAL='vertical'
+HORIZONTAL="horizontal"
+VERTICAL="vertical"
# -tabs
-NUMERIC='numeric'
+NUMERIC="numeric"
# -wrap
-CHAR='char'
-WORD='word'
+CHAR="char"
+WORD="word"
# -align
-BASELINE='baseline'
+BASELINE="baseline"
# -bordermode
-INSIDE='inside'
-OUTSIDE='outside'
+INSIDE="inside"
+OUTSIDE="outside"
# Special tags, marks and insert positions
-SEL='sel'
-SEL_FIRST='sel.first'
-SEL_LAST='sel.last'
-END='end'
-INSERT='insert'
-CURRENT='current'
-ANCHOR='anchor'
-ALL='all' # e.g. Canvas.delete(ALL)
+SEL="sel"
+SEL_FIRST="sel.first"
+SEL_LAST="sel.last"
+END="end"
+INSERT="insert"
+CURRENT="current"
+ANCHOR="anchor"
+ALL="all" # e.g. Canvas.delete(ALL)
# Text widget and button states
-NORMAL='normal'
-DISABLED='disabled'
-ACTIVE='active'
+NORMAL="normal"
+DISABLED="disabled"
+ACTIVE="active"
# Canvas state
-HIDDEN='hidden'
+HIDDEN="hidden"
# Menu item types
-CASCADE='cascade'
-CHECKBUTTON='checkbutton'
-COMMAND='command'
-RADIOBUTTON='radiobutton'
-SEPARATOR='separator'
+CASCADE="cascade"
+CHECKBUTTON="checkbutton"
+COMMAND="command"
+RADIOBUTTON="radiobutton"
+SEPARATOR="separator"
# Selection modes for list boxes
-SINGLE='single'
-BROWSE='browse'
-MULTIPLE='multiple'
-EXTENDED='extended'
+SINGLE="single"
+BROWSE="browse"
+MULTIPLE="multiple"
+EXTENDED="extended"
# Activestyle for list boxes
# NONE='none' is also valid
-DOTBOX='dotbox'
-UNDERLINE='underline'
+DOTBOX="dotbox"
+UNDERLINE="underline"
# Various canvas styles
-PIESLICE='pieslice'
-CHORD='chord'
-ARC='arc'
-FIRST='first'
-LAST='last'
-BUTT='butt'
-PROJECTING='projecting'
-ROUND='round'
-BEVEL='bevel'
-MITER='miter'
+PIESLICE="pieslice"
+CHORD="chord"
+ARC="arc"
+FIRST="first"
+LAST="last"
+BUTT="butt"
+PROJECTING="projecting"
+ROUND="round"
+BEVEL="bevel"
+MITER="miter"
# Arguments to xview/yview
-MOVETO='moveto'
-SCROLL='scroll'
-UNITS='units'
-PAGES='pages'
+MOVETO="moveto"
+SCROLL="scroll"
+UNITS="units"
+PAGES="pages"
diff --git a/.venv3.10/Lib/tkinter/dialog.py b/.venv3.10/Lib/tkinter/dialog.py
index 36ae6c27..fbb539db 100644
--- a/.venv3.10/Lib/tkinter/dialog.py
+++ b/.venv3.10/Lib/tkinter/dialog.py
@@ -4,20 +4,20 @@
__all__ = ["Dialog"]
-DIALOG_ICON = 'questhead'
+DIALOG_ICON = "questhead"
class Dialog(Widget):
def __init__(self, master=None, cnf={}, **kw):
cnf = _cnfmerge((cnf, kw))
- self.widgetName = '__dialog__'
+ self.widgetName = "__dialog__"
self._setup(master, cnf)
self.num = self.tk.getint(
self.tk.call(
- 'tk_dialog', self._w,
- cnf['title'], cnf['text'],
- cnf['bitmap'], cnf['default'],
- *cnf['strings']))
+ "tk_dialog", self._w,
+ cnf["title"], cnf["text"],
+ cnf["bitmap"], cnf["default"],
+ *cnf["strings"]))
try: Widget.destroy(self)
except TclError: pass
@@ -25,25 +25,25 @@ def destroy(self): pass
def _test():
- d = Dialog(None, {'title': 'File Modified',
- 'text':
+ d = Dialog(None, {"title": "File Modified",
+ "text":
'File "Python.h" has been modified'
' since the last time it was saved.'
' Do you want to save it before'
' exiting the application.',
- 'bitmap': DIALOG_ICON,
- 'default': 0,
- 'strings': ('Save File',
- 'Discard Changes',
- 'Return to Editor')})
+ "bitmap": DIALOG_ICON,
+ "default": 0,
+ "strings": ("Save File",
+ "Discard Changes",
+ "Return to Editor")})
print(d.num)
-if __name__ == '__main__':
- t = Button(None, {'text': 'Test',
- 'command': _test,
+if __name__ == "__main__":
+ t = Button(None, {"text": "Test",
+ "command": _test,
Pack: {}})
- q = Button(None, {'text': 'Quit',
- 'command': t.quit,
+ q = Button(None, {"text": "Quit",
+ "command": t.quit,
Pack: {}})
t.mainloop()
diff --git a/.venv3.10/Lib/tkinter/dnd.py b/.venv3.10/Lib/tkinter/dnd.py
index acec61ba..ea3b01ed 100644
--- a/.venv3.10/Lib/tkinter/dnd.py
+++ b/.venv3.10/Lib/tkinter/dnd.py
@@ -135,10 +135,10 @@ def __init__(self, source, event):
self.initial_button = button = event.num
self.initial_widget = widget = event.widget
self.release_pattern = "" % (button, button)
- self.save_cursor = widget['cursor'] or ""
+ self.save_cursor = widget["cursor"] or ""
widget.bind(self.release_pattern, self.on_release)
widget.bind("", self.on_motion)
- widget['cursor'] = "hand2"
+ widget["cursor"] = "hand2"
def __del__(self):
root = self.root
@@ -191,7 +191,7 @@ def finish(self, event, commit=0):
del root.__dnd
self.initial_widget.unbind(self.release_pattern)
self.initial_widget.unbind("")
- widget['cursor'] = self.save_cursor
+ widget["cursor"] = self.save_cursor
self.target = self.source = self.initial_widget = self.root = None
if target is not None:
if commit:
@@ -320,5 +320,5 @@ def test():
root.mainloop()
-if __name__ == '__main__':
+if __name__ == "__main__":
test()
diff --git a/.venv3.10/Lib/tkinter/filedialog.py b/.venv3.10/Lib/tkinter/filedialog.py
index 600d0bd4..b2596376 100644
--- a/.venv3.10/Lib/tkinter/filedialog.py
+++ b/.venv3.10/Lib/tkinter/filedialog.py
@@ -70,11 +70,11 @@ def __init__(self, master, title=None):
self.selection = Entry(self.top)
self.selection.pack(side=BOTTOM, fill=X)
- self.selection.bind('', self.ok_event)
+ self.selection.bind("", self.ok_event)
self.filter = Entry(self.top)
self.filter.pack(side=TOP, fill=X)
- self.filter.bind('', self.filter_command)
+ self.filter.bind("", self.filter_command)
self.midframe = Frame(self.top)
self.midframe.pack(expand=YES, fill=BOTH)
@@ -82,24 +82,24 @@ def __init__(self, master, title=None):
self.filesbar = Scrollbar(self.midframe)
self.filesbar.pack(side=RIGHT, fill=Y)
self.files = Listbox(self.midframe, exportselection=0,
- yscrollcommand=(self.filesbar, 'set'))
+ yscrollcommand=(self.filesbar, "set"))
self.files.pack(side=RIGHT, expand=YES, fill=BOTH)
btags = self.files.bindtags()
self.files.bindtags(btags[1:] + btags[:1])
- self.files.bind('', self.files_select_event)
- self.files.bind('', self.files_double_event)
- self.filesbar.config(command=(self.files, 'yview'))
+ self.files.bind("", self.files_select_event)
+ self.files.bind("", self.files_double_event)
+ self.filesbar.config(command=(self.files, "yview"))
self.dirsbar = Scrollbar(self.midframe)
self.dirsbar.pack(side=LEFT, fill=Y)
self.dirs = Listbox(self.midframe, exportselection=0,
- yscrollcommand=(self.dirsbar, 'set'))
+ yscrollcommand=(self.dirsbar, "set"))
self.dirs.pack(side=LEFT, expand=YES, fill=BOTH)
- self.dirsbar.config(command=(self.dirs, 'yview'))
+ self.dirsbar.config(command=(self.dirs, "yview"))
btags = self.dirs.bindtags()
self.dirs.bindtags(btags[1:] + btags[:1])
- self.dirs.bind('', self.dirs_select_event)
- self.dirs.bind('', self.dirs_double_event)
+ self.dirs.bind("", self.dirs_select_event)
+ self.dirs.bind("", self.dirs_double_event)
self.ok_button = Button(self.botframe,
text="OK",
@@ -114,10 +114,10 @@ def __init__(self, master, title=None):
command=self.cancel_command)
self.cancel_button.pack(side=RIGHT)
- self.top.protocol('WM_DELETE_WINDOW', self.cancel_command)
+ self.top.protocol("WM_DELETE_WINDOW", self.cancel_command)
# XXX Are the following okay for a general audience?
- self.top.bind('', self.cancel_command)
- self.top.bind('', self.cancel_command)
+ self.top.bind("", self.cancel_command)
+ self.top.bind("", self.cancel_command)
def go(self, dir_or_file=os.curdir, pattern="*", default="", key=None):
if key and key in dialogstates:
@@ -153,7 +153,7 @@ def dirs_double_event(self, event):
def dirs_select_event(self, event):
dir, pat = self.get_filter()
- subdir = self.dirs.get('active')
+ subdir = self.dirs.get("active")
dir = os.path.normpath(os.path.join(self.directory, subdir))
self.set_filter(dir, pat)
@@ -161,7 +161,7 @@ def files_double_event(self, event):
self.ok_command()
def files_select_event(self, event):
- file = self.files.get('active')
+ file = self.files.get("active")
self.set_selection(file)
def ok_event(self, event):
@@ -195,7 +195,7 @@ def filter_command(self, event=None):
for name in matchingfiles:
self.files.insert(END, name)
head, tail = os.path.split(self.get_selection())
- if tail == os.curdir: tail = ''
+ if tail == os.curdir: tail = ""
self.set_selection(tail)
def get_filter(self):
@@ -259,7 +259,7 @@ def ok_command(self):
d = Dialog(self.top,
title="Overwrite Existing File Question",
text="Overwrite existing file %r?" % (file,),
- bitmap='questhead',
+ bitmap="questhead",
default=1,
strings=("Yes", "Cancel"))
if d.num != 0:
@@ -466,7 +466,7 @@ def test():
# See whether CODESET is defined
try:
import locale
- locale.setlocale(locale.LC_ALL,'')
+ locale.setlocale(locale.LC_ALL,"")
enc = locale.nl_langinfo(locale.CODESET)
except (ImportError, AttributeError):
pass
@@ -489,5 +489,5 @@ def test():
print("saveas", saveasfilename.encode(enc))
-if __name__ == '__main__':
+if __name__ == "__main__":
test()
diff --git a/.venv3.10/Lib/tkinter/font.py b/.venv3.10/Lib/tkinter/font.py
index 3e24e28e..b43ff8c0 100644
--- a/.venv3.10/Lib/tkinter/font.py
+++ b/.venv3.10/Lib/tkinter/font.py
@@ -69,8 +69,8 @@ def _mkdict(self, args):
def __init__(self, root=None, font=None, name=None, exists=False,
**options):
if root is None:
- root = tkinter._get_default_root('use font')
- tk = getattr(root, 'tk', root)
+ root = tkinter._get_default_root("use font")
+ tk = getattr(root, "tk", root)
if font:
# get actual settings corresponding to the given font
font = tk.splitlist(tk.call("font", "actual", font))
@@ -130,9 +130,9 @@ def actual(self, option=None, displayof=None):
"Return actual font attributes"
args = ()
if displayof:
- args = ('-displayof', displayof)
+ args = ("-displayof", displayof)
if option:
- args = args + ('-' + option, )
+ args = args + ("-" + option, )
return self._call("font", "actual", self.name, *args)
else:
return self._mkdict(
@@ -157,7 +157,7 @@ def measure(self, text, displayof=None):
"Return text width"
args = (text,)
if displayof:
- args = ('-displayof', displayof, text)
+ args = ("-displayof", displayof, text)
return self._tk.getint(self._call("font", "measure", self.name, *args))
def metrics(self, *options, **kw):
@@ -166,9 +166,9 @@ def metrics(self, *options, **kw):
For best performance, create a dummy widget
using this font before calling this method."""
args = ()
- displayof = kw.pop('displayof', None)
+ displayof = kw.pop("displayof", None)
if displayof:
- args = ('-displayof', displayof)
+ args = ("-displayof", displayof)
if options:
args = args + self._get(options)
return self._tk.getint(
@@ -184,17 +184,17 @@ def metrics(self, *options, **kw):
def families(root=None, displayof=None):
"Get font families (as a tuple)"
if root is None:
- root = tkinter._get_default_root('use font.families()')
+ root = tkinter._get_default_root("use font.families()")
args = ()
if displayof:
- args = ('-displayof', displayof)
+ args = ("-displayof", displayof)
return root.tk.splitlist(root.tk.call("font", "families", *args))
def names(root=None):
"Get names of defined fonts (as a tuple)"
if root is None:
- root = tkinter._get_default_root('use font.names()')
+ root = tkinter._get_default_root("use font.names()")
return root.tk.splitlist(root.tk.call("font", "names"))
diff --git a/.venv3.10/Lib/tkinter/scrolledtext.py b/.venv3.10/Lib/tkinter/scrolledtext.py
index 4f9a8815..f0c988a7 100644
--- a/.venv3.10/Lib/tkinter/scrolledtext.py
+++ b/.venv3.10/Lib/tkinter/scrolledtext.py
@@ -14,7 +14,7 @@
from tkinter import Frame, Text, Scrollbar, Pack, Grid, Place
from tkinter.constants import RIGHT, LEFT, Y, BOTH
-__all__ = ['ScrolledText']
+__all__ = ["ScrolledText"]
class ScrolledText(Text):
@@ -23,10 +23,10 @@ def __init__(self, master=None, **kw):
self.vbar = Scrollbar(self.frame)
self.vbar.pack(side=RIGHT, fill=Y)
- kw.update({'yscrollcommand': self.vbar.set})
+ kw.update({"yscrollcommand": self.vbar.set})
Text.__init__(self, self.frame, **kw)
self.pack(side=LEFT, fill=BOTH, expand=True)
- self.vbar['command'] = self.yview
+ self.vbar["command"] = self.yview
# Copy geometry methods of self.frame without overriding Text
# methods -- hack!
@@ -35,7 +35,7 @@ def __init__(self, master=None, **kw):
methods = methods.difference(text_meths)
for m in methods:
- if m[0] != '_' and m != 'config' and m != 'configure':
+ if m[0] != "_" and m != "config" and m != "configure":
setattr(self, m, getattr(self.frame, m))
def __str__(self):
@@ -45,7 +45,7 @@ def __str__(self):
def example():
from tkinter.constants import END
- stext = ScrolledText(bg='white', height=10)
+ stext = ScrolledText(bg="white", height=10)
stext.insert(END, __doc__)
stext.pack(fill=BOTH, side=LEFT, expand=True)
stext.focus_set()
diff --git a/.venv3.10/Lib/tkinter/simpledialog.py b/.venv3.10/Lib/tkinter/simpledialog.py
index 538bbfc3..6700eb52 100644
--- a/.venv3.10/Lib/tkinter/simpledialog.py
+++ b/.venv3.10/Lib/tkinter/simpledialog.py
@@ -31,7 +31,7 @@
class SimpleDialog:
def __init__(self, master,
- text='', buttons=[], default=None, cancel=None,
+ text="", buttons=[], default=None, cancel=None,
title=None, class_=None):
if class_:
self.root = Toplevel(master, class_=class_)
@@ -50,7 +50,7 @@ def __init__(self, master,
self.num = default
self.cancel = cancel
self.default = default
- self.root.bind('', self.return_event)
+ self.root.bind("", self.return_event)
for num in range(len(buttons)):
s = buttons[num]
b = Button(self.frame, text=s,
@@ -58,7 +58,7 @@ def __init__(self, master,
if num == default:
b.config(relief=RIDGE, borderwidth=8)
b.pack(side=LEFT, fill=BOTH, expand=1)
- self.root.protocol('WM_DELETE_WINDOW', self.wm_delete_window)
+ self.root.protocol("WM_DELETE_WINDOW", self.wm_delete_window)
self.root.transient(master)
_place_window(self.root, master)
@@ -88,20 +88,20 @@ def done(self, num):
class Dialog(Toplevel):
- '''Class to open dialogs.
+ """Class to open dialogs.
This class is intended as a base class for custom dialogs
- '''
+ """
def __init__(self, parent, title = None):
- '''Initialize a dialog.
+ """Initialize a dialog.
Arguments:
parent -- a parent window (the application window)
title -- the dialog title
- '''
+ """
master = parent
if master is None:
master = _get_temp_root()
@@ -145,7 +145,7 @@ def __init__(self, parent, title = None):
self.wait_window(self)
def destroy(self):
- '''Destroy the window'''
+ """Destroy the window"""
self.initial_focus = None
Toplevel.destroy(self)
_destroy_temp_root(self.master)
@@ -154,19 +154,19 @@ def destroy(self):
# construction hooks
def body(self, master):
- '''create dialog body.
+ """create dialog body.
return widget that should have initial focus.
This method should be overridden, and is called
by the __init__ method.
- '''
+ """
pass
def buttonbox(self):
- '''add standard button box.
+ """add standard button box.
override if you do not want the standard buttons
- '''
+ """
box = Frame(self)
@@ -208,20 +208,20 @@ def cancel(self, event=None):
# command hooks
def validate(self):
- '''validate the data
+ """validate the data
This method is called automatically to validate the data before the
dialog is destroyed. By default, it always validates OK.
- '''
+ """
return 1 # override
def apply(self):
- '''process the data
+ """process the data
This method is called automatically to process the data, *after*
the dialog is destroyed. By default, it does nothing.
- '''
+ """
pass # override
@@ -245,7 +245,7 @@ def _place_window(w, parent=None):
x = max(x, vrootx)
y = min(y, vrooty + maxheight - minheight)
y = max(y, vrooty)
- if w._windowingsystem == 'aqua':
+ if w._windowingsystem == "aqua":
# Avoid the native menu bar which sits on top of everything.
y = max(y, 22)
else:
@@ -253,7 +253,7 @@ def _place_window(w, parent=None):
y = (w.winfo_screenheight() - minheight) // 2
w.wm_maxsize(maxwidth, maxheight)
- w.wm_geometry('+%d+%d' % (x, y))
+ w.wm_geometry("+%d+%d" % (x, y))
w.wm_deiconify() # Become visible at the desired location
@@ -342,7 +342,7 @@ def getresult(self):
def askinteger(title, prompt, **kw):
- '''get an integer from the user
+ """get an integer from the user
Arguments:
@@ -351,7 +351,7 @@ def askinteger(title, prompt, **kw):
**kw -- see SimpleDialog class
Return value is an integer
- '''
+ """
d = _QueryInteger(title, prompt, **kw)
return d.result
@@ -364,7 +364,7 @@ def getresult(self):
def askfloat(title, prompt, **kw):
- '''get a float from the user
+ """get a float from the user
Arguments:
@@ -373,7 +373,7 @@ def askfloat(title, prompt, **kw):
**kw -- see SimpleDialog class
Return value is a float
- '''
+ """
d = _QueryFloat(title, prompt, **kw)
return d.result
@@ -398,7 +398,7 @@ def getresult(self):
def askstring(title, prompt, **kw):
- '''get a string from the user
+ """get a string from the user
Arguments:
@@ -407,12 +407,12 @@ def askstring(title, prompt, **kw):
**kw -- see SimpleDialog class
Return value is a string
- '''
+ """
d = _QueryString(title, prompt, **kw)
return d.result
-if __name__ == '__main__':
+if __name__ == "__main__":
def test():
root = Tk()
@@ -432,9 +432,9 @@ def doit(root=root):
print(askfloat("Spam", "Egg weight\n(in tons)", minvalue=1,
maxvalue=100))
print(askstring("Spam", "Egg label"))
- t = Button(root, text='Test', command=doit)
+ t = Button(root, text="Test", command=doit)
t.pack()
- q = Button(root, text='Quit', command=t.quit)
+ q = Button(root, text="Quit", command=t.quit)
q.pack()
t.mainloop()
diff --git a/.venv3.10/Lib/tkinter/test/support.py b/.venv3.10/Lib/tkinter/test/support.py
index dbc47a81..e6c7f978 100644
--- a/.venv3.10/Lib/tkinter/test/support.py
+++ b/.venv3.10/Lib/tkinter/test/support.py
@@ -14,9 +14,9 @@ def setUpClass(cls):
cls.wantobjects = cls.root.wantobjects()
# De-maximize main window.
# Some window managers can maximize new windows.
- cls.root.wm_state('normal')
+ cls.root.wm_state("normal")
try:
- cls.root.wm_attributes('-zoomed', False)
+ cls.root.wm_attributes("-zoomed", False)
except tkinter.TclError:
pass
@@ -60,11 +60,11 @@ def _test_widget(self, constructor):
destroy_default_root()
tkinter.NoDefaultRoot()
self.assertRaises(RuntimeError, constructor)
- self.assertFalse(hasattr(tkinter, '_default_root'))
+ self.assertFalse(hasattr(tkinter, "_default_root"))
def destroy_default_root():
- if getattr(tkinter, '_default_root', None):
+ if getattr(tkinter, "_default_root", None):
tkinter._default_root.update_idletasks()
tkinter._default_root.destroy()
tkinter._default_root = None
@@ -72,26 +72,26 @@ def destroy_default_root():
def simulate_mouse_click(widget, x, y):
"""Generate proper events to click at the x, y position (tries to act
like an X server)."""
- widget.event_generate('', x=0, y=0)
- widget.event_generate('', x=x, y=y)
- widget.event_generate('', x=x, y=y)
- widget.event_generate('', x=x, y=y)
+ widget.event_generate("", x=0, y=0)
+ widget.event_generate("", x=x, y=y)
+ widget.event_generate("", x=x, y=y)
+ widget.event_generate("", x=x, y=y)
import _tkinter
-tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split('.')))
+tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split(".")))
def requires_tcl(*version):
if len(version) <= 2:
return unittest.skipUnless(tcl_version >= version,
- 'requires Tcl version >= ' + '.'.join(map(str, version)))
+ "requires Tcl version >= " + ".".join(map(str, version)))
def deco(test):
@functools.wraps(test)
def newtest(self):
if get_tk_patchlevel() < version:
- self.skipTest('requires Tcl version >= ' +
- '.'.join(map(str, version)))
+ self.skipTest("requires Tcl version >= " +
+ ".".join(map(str, version)))
test(self)
return newtest
return deco
@@ -101,22 +101,22 @@ def get_tk_patchlevel():
global _tk_patchlevel
if _tk_patchlevel is None:
tcl = tkinter.Tcl()
- patchlevel = tcl.call('info', 'patchlevel')
- m = re.fullmatch(r'(\d+)\.(\d+)([ab.])(\d+)', patchlevel)
+ patchlevel = tcl.call("info", "patchlevel")
+ m = re.fullmatch(r"(\d+)\.(\d+)([ab.])(\d+)", patchlevel)
major, minor, releaselevel, serial = m.groups()
major, minor, serial = int(major), int(minor), int(serial)
- releaselevel = {'a': 'alpha', 'b': 'beta', '.': 'final'}[releaselevel]
- if releaselevel == 'final':
+ releaselevel = {"a": "alpha", "b": "beta", ".": "final"}[releaselevel]
+ if releaselevel == "final":
_tk_patchlevel = major, minor, serial, releaselevel, 0
else:
_tk_patchlevel = major, minor, 0, releaselevel, serial
return _tk_patchlevel
units = {
- 'c': 72 / 2.54, # centimeters
- 'i': 72, # inches
- 'm': 72 / 25.4, # millimeters
- 'p': 1, # points
+ "c": 72 / 2.54, # centimeters
+ "i": 72, # inches
+ "m": 72 / 25.4, # millimeters
+ "p": 1, # points
}
def pixels_conv(value):
diff --git a/.venv3.10/Lib/tkinter/test/test_tkinter/test_colorchooser.py b/.venv3.10/Lib/tkinter/test/test_tkinter/test_colorchooser.py
index 488162ff..ca0ffaf8 100644
--- a/.venv3.10/Lib/tkinter/test/test_tkinter/test_colorchooser.py
+++ b/.venv3.10/Lib/tkinter/test/test_tkinter/test_colorchooser.py
@@ -6,7 +6,7 @@
from tkinter.colorchooser import askcolor
from tkinter.commondialog import Dialog
-requires('gui')
+requires("gui")
class ChooserTest(AbstractTkTest, unittest.TestCase):
@@ -14,29 +14,29 @@ class ChooserTest(AbstractTkTest, unittest.TestCase):
@classmethod
def setUpClass(cls):
AbstractTkTest.setUpClass.__func__(cls)
- cls.cc = colorchooser.Chooser(initialcolor='dark blue slate')
+ cls.cc = colorchooser.Chooser(initialcolor="dark blue slate")
def test_fixoptions(self):
cc = self.cc
cc._fixoptions()
- self.assertEqual(cc.options['initialcolor'], 'dark blue slate')
+ self.assertEqual(cc.options["initialcolor"], "dark blue slate")
- cc.options['initialcolor'] = '#D2D269691E1E'
+ cc.options["initialcolor"] = "#D2D269691E1E"
cc._fixoptions()
- self.assertEqual(cc.options['initialcolor'], '#D2D269691E1E')
+ self.assertEqual(cc.options["initialcolor"], "#D2D269691E1E")
- cc.options['initialcolor'] = (210, 105, 30)
+ cc.options["initialcolor"] = (210, 105, 30)
cc._fixoptions()
- self.assertEqual(cc.options['initialcolor'], '#d2691e')
+ self.assertEqual(cc.options["initialcolor"], "#d2691e")
def test_fixresult(self):
cc = self.cc
self.assertEqual(cc._fixresult(self.root, ()), (None, None))
- self.assertEqual(cc._fixresult(self.root, ''), (None, None))
- self.assertEqual(cc._fixresult(self.root, 'chocolate'),
- ((210, 105, 30), 'chocolate'))
- self.assertEqual(cc._fixresult(self.root, '#4a3c8c'),
- ((74, 60, 140), '#4a3c8c'))
+ self.assertEqual(cc._fixresult(self.root, ""), (None, None))
+ self.assertEqual(cc._fixresult(self.root, "chocolate"),
+ ((210, 105, 30), "chocolate"))
+ self.assertEqual(cc._fixresult(self.root, "#4a3c8c"),
+ ((74, 60, 140), "#4a3c8c"))
class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
@@ -48,7 +48,7 @@ def test_callback(dialog, master):
ismapped = master.winfo_ismapped()
raise ZeroDivisionError
- with swap_attr(Dialog, '_test_callback', test_callback):
+ with swap_attr(Dialog, "_test_callback", test_callback):
ismapped = None
self.assertRaises(ZeroDivisionError, askcolor)
#askcolor()
diff --git a/.venv3.10/Lib/tkinter/test/test_tkinter/test_font.py b/.venv3.10/Lib/tkinter/test/test_tkinter/test_font.py
index 058c53a9..5b284f55 100644
--- a/.venv3.10/Lib/tkinter/test/test_tkinter/test_font.py
+++ b/.venv3.10/Lib/tkinter/test/test_tkinter/test_font.py
@@ -4,7 +4,7 @@
from test.support import requires, gc_collect, ALWAYS_EQ
from tkinter.test.support import AbstractTkTest, AbstractDefaultRootTest
-requires('gui')
+requires("gui")
fontname = "TkDefaultFont"
@@ -21,41 +21,41 @@ def setUpClass(cls):
def test_configure(self):
options = self.font.configure()
self.assertGreaterEqual(set(options),
- {'family', 'size', 'weight', 'slant', 'underline', 'overstrike'})
+ {"family", "size", "weight", "slant", "underline", "overstrike"})
for key in options:
self.assertEqual(self.font.cget(key), options[key])
self.assertEqual(self.font[key], options[key])
- for key in 'family', 'weight', 'slant':
+ for key in "family", "weight", "slant":
self.assertIsInstance(options[key], str)
self.assertIsInstance(self.font.cget(key), str)
self.assertIsInstance(self.font[key], str)
sizetype = int if self.wantobjects else str
- for key in 'size', 'underline', 'overstrike':
+ for key in "size", "underline", "overstrike":
self.assertIsInstance(options[key], sizetype)
self.assertIsInstance(self.font.cget(key), sizetype)
self.assertIsInstance(self.font[key], sizetype)
def test_unicode_family(self):
- family = 'MS \u30b4\u30b7\u30c3\u30af'
+ family = "MS \u30b4\u30b7\u30c3\u30af"
try:
f = font.Font(root=self.root, family=family, exists=True)
except tkinter.TclError:
f = font.Font(root=self.root, family=family, exists=False)
- self.assertEqual(f.cget('family'), family)
+ self.assertEqual(f.cget("family"), family)
del f
gc_collect()
def test_actual(self):
options = self.font.actual()
self.assertGreaterEqual(set(options),
- {'family', 'size', 'weight', 'slant', 'underline', 'overstrike'})
+ {"family", "size", "weight", "slant", "underline", "overstrike"})
for key in options:
self.assertEqual(self.font.actual(key), options[key])
- for key in 'family', 'weight', 'slant':
+ for key in "family", "weight", "slant":
self.assertIsInstance(options[key], str)
self.assertIsInstance(self.font.actual(key), str)
sizetype = int if self.wantobjects else str
- for key in 'size', 'underline', 'overstrike':
+ for key in "size", "underline", "overstrike":
self.assertIsInstance(options[key], sizetype)
self.assertIsInstance(self.font.actual(key), sizetype)
@@ -80,12 +80,12 @@ def test_equality(self):
self.assertNotEqual(font1, font3)
def test_measure(self):
- self.assertIsInstance(self.font.measure('abc'), int)
+ self.assertIsInstance(self.font.measure("abc"), int)
def test_metrics(self):
metrics = self.font.metrics()
self.assertGreaterEqual(set(metrics),
- {'ascent', 'descent', 'linespace', 'fixed'})
+ {"ascent", "descent", "linespace", "fixed"})
for key in metrics:
self.assertEqual(self.font.metrics(key), metrics[key])
self.assertIsInstance(metrics[key], int)
@@ -115,7 +115,7 @@ def test_nametofont(self):
def test_repr(self):
self.assertEqual(
- repr(self.font), f'