mirror of
https://github.com/pypiserver/pypiserver
synced 2025-02-22 19:19:37 +01:00
Merge branch 'master' into chore-adjust-contributors-entry-in-readme-rst
This commit is contained in:
commit
f2330fa95e
@ -256,6 +256,7 @@ def handle_rpc():
|
||||
def simpleindex():
|
||||
links = sorted(config.backend.get_projects())
|
||||
tmpl = """\
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Simple Index</title>
|
||||
@ -299,6 +300,7 @@ def simple(project):
|
||||
)
|
||||
|
||||
tmpl = """\
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Links for {{project}}</title>
|
||||
@ -328,6 +330,7 @@ def list_packages():
|
||||
)
|
||||
|
||||
tmpl = """\
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Index of packages</title>
|
||||
|
@ -204,7 +204,7 @@ def write_file(fh: t.BinaryIO, destination: PathLike) -> None:
|
||||
"""write a byte stream into a destination file. Writes are chunked to reduce
|
||||
the memory footprint
|
||||
"""
|
||||
chunk_size = 2 ** 20 # 1 MB
|
||||
chunk_size = 2**20 # 1 MB
|
||||
offset = fh.tell()
|
||||
try:
|
||||
with open(destination, "wb") as dest:
|
||||
@ -259,7 +259,7 @@ def digest_file(file_path: PathLike, hash_algo: str) -> str:
|
||||
|
||||
From http://stackoverflow.com/a/21565932/548792
|
||||
"""
|
||||
blocksize = 2 ** 16
|
||||
blocksize = 2**16
|
||||
digester = hashlib.new(hash_algo)
|
||||
with open(file_path, "rb") as f:
|
||||
for block in iter(lambda: f.read(blocksize), b""):
|
||||
|
@ -57,7 +57,7 @@ def run_server(root, authed=False, other_cli=""):
|
||||
f"run -vvv --overwrite -i 127.0.0.1 "
|
||||
f"-p {port} {pswd_opts} {other_cli} {root}"
|
||||
)
|
||||
proc = Popen(cmd.split(), bufsize=2 ** 16)
|
||||
proc = Popen(cmd.split(), bufsize=2**16)
|
||||
srv = Srv(port, root)
|
||||
try:
|
||||
wait_until_ready(srv)
|
||||
|
Loading…
Reference in New Issue
Block a user