ci: Use black instead of flake8

It results in mostly the same style, plus it’s configurable via pyprojects.toml.
This commit is contained in:
2023-10-29 09:47:57 +01:00
parent bbfc137ca8
commit 93f2d329a4
14 changed files with 221 additions and 117 deletions

View File

@@ -7,13 +7,13 @@ from nacl.signing import SigningKey
from secret_handshake import SHSClient
with open(os.path.expanduser('~/.ssb/secret')) as f:
with open(os.path.expanduser("~/.ssb/secret")) as f:
config = yaml.safe_load(f)
async def main():
server_pub_key = b64decode(config['public'][:-8])
client = SHSClient('localhost', 8008, SigningKey.generate(), server_pub_key)
server_pub_key = b64decode(config["public"][:-8])
client = SHSClient("localhost", 8008, SigningKey.generate(), server_pub_key)
await client.open()
async for msg in client:

View File

@@ -7,7 +7,7 @@ from nacl.signing import SigningKey
from secret_handshake import SHSServer
with open(os.path.expanduser('~/.ssb/secret')) as f:
with open(os.path.expanduser("~/.ssb/secret")) as f:
config = yaml.safe_load(f)
@@ -17,11 +17,12 @@ async def _on_connect(conn):
async def main():
server_keypair = SigningKey(b64decode(config['private'][:-8])[:32])
server = SHSServer('localhost', 8008, server_keypair)
server_keypair = SigningKey(b64decode(config["private"][:-8])[:32])
server = SHSServer("localhost", 8008, server_keypair)
server.on_connect(_on_connect)
await server.listen()
loop = get_event_loop()
loop.run_until_complete(main())
loop.run_forever()