diff options
author | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-03-15 19:48:36 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tomasz@kramkow.ski> | 2023-03-24 20:25:00 +0000 |
commit | 46a7594340cdf5572d60ae9440d36635f7589ecf (patch) | |
tree | 79fc38baf71369a98ee20eff0184ff11bf332ce1 | |
parent | 86f356b7896fa1b95a9438d7a073f9eff8e6e205 (diff) | |
download | paste-46a7594340cdf5572d60ae9440d36635f7589ecf.tar.gz paste-46a7594340cdf5572d60ae9440d36635f7589ecf.tar.xz paste-46a7594340cdf5572d60ae9440d36635f7589ecf.zip |
isort imports
-rw-r--r-- | paste/__init__.py | 13 | ||||
-rw-r--r-- | paste/__main__.py | 9 | ||||
-rw-r--r-- | paste/db.py | 8 |
3 files changed, 14 insertions, 16 deletions
diff --git a/paste/__init__.py b/paste/__init__.py index f7ee3a8..85afc63 100644 --- a/paste/__init__.py +++ b/paste/__init__.py @@ -1,14 +1,13 @@ -from base64 import b64decode, b64encode -from functools import wraps -from wsgiref.util import request_uri -from typing import Optional, Any, Protocol, runtime_checkable -from collections.abc import Callable, Iterable import binascii import traceback +from base64 import b64decode, b64encode +from collections.abc import Callable, Iterable +from functools import wraps from sqlite3 import Connection +from typing import Any, Optional, Protocol, runtime_checkable +from wsgiref.util import request_uri -from . import db -from . import store +from . import db, store @runtime_checkable diff --git a/paste/__main__.py b/paste/__main__.py index f1aa117..325bf09 100644 --- a/paste/__main__.py +++ b/paste/__main__.py @@ -1,15 +1,14 @@ -from base64 import b64encode, b64decode +from base64 import b64decode, b64encode +from contextlib import AbstractContextManager from datetime import datetime, timezone from hashlib import sha256 from os import getenv from secrets import token_bytes +from sqlite3 import Connection from sys import argv, stderr from wsgiref.simple_server import make_server -from sqlite3 import Connection -from contextlib import AbstractContextManager -from . import application, DB_PATH -from . import db +from . import DB_PATH, application, db TOKEN_BYTES = 96 // 8 PROGRAM_NAME = "paste" diff --git a/paste/db.py b/paste/db.py index 15e4f03..bef3c46 100644 --- a/paste/db.py +++ b/paste/db.py @@ -1,9 +1,9 @@ +import sqlite3 +from collections.abc import Iterator from contextlib import contextmanager -from hashlib import sha256 +from hashlib import blake2b, sha256 from itertools import count -from collections.abc import Iterator -from typing import Union -import sqlite3 +from typing import Optional, Union migrations = [ """CREATE TABLE file ( |