Skip to content

Commit

Permalink
Re-run modern black on the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Spindel committed Apr 18, 2024
1 parent 7b10b60 commit 09aa6dc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion caramel/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def get_log_level(argument_level, logger=None, env=None):
logger = logging.getLogger()
current_level = logger.level

argument_verbosity = logging.ERROR - argument_level * 10 # level steps are 10
argument_verbosity = logging.ERROR - argument_level * 10 # level steps are 10
verbosity = min(argument_verbosity, env_level, current_level)
log_level = (
verbosity if logging.DEBUG <= verbosity <= logging.ERROR else logging.ERROR
Expand Down
7 changes: 2 additions & 5 deletions caramel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
# vim: expandtab shiftwidth=4 softtabstop=4 tabstop=17 filetype=python :

import sqlalchemy as _sa
from sqlalchemy.ext.declarative import (
declared_attr,
as_declarative
)
from sqlalchemy.ext.declarative import declared_attr, as_declarative
import sqlalchemy.orm as _orm
from zope.sqlalchemy import register

Expand Down Expand Up @@ -98,7 +95,7 @@ class Base(object):

@declared_attr # type: ignore
def __tablename__(cls) -> str: # pylint: disable=no-self-argument
return cls.__name__.lower() # pylint: disable=no-member
return cls.__name__.lower() # pylint: disable=no-member

id = _sa.Column(_sa.Integer, primary_key=True)

Expand Down
2 changes: 1 addition & 1 deletion caramel/scripts/generate_ca.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def later_check(subject):
casubject = casubject[:-2]
subject = subject[:-2]

for (ca, sub) in zip(casubject, subject):
for ca, sub in zip(casubject, subject):
if ca != sub:
raise ValueError("Subject needs to match CA cert:" "{}".format(casubject))

Expand Down
4 changes: 2 additions & 2 deletions caramel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# 2 kbyte should be enough for up to 4 kbit keys.
# XXX: This should probably be handled outside of app (i.e. by the
# server), or at least be configurable.
_MAXLEN = 2 * 2 ** 10
_MAXLEN = 2 * 2**10


def raise_for_length(req, limit=_MAXLEN):
Expand All @@ -38,7 +38,7 @@ def raise_for_length(req, limit=_MAXLEN):
if length is None:
raise HTTPLengthRequired
if length > limit:
raise HTTPRequestEntityTooLarge("Max size: {0} kB".format(limit / 2 ** 10))
raise HTTPRequestEntityTooLarge("Max size: {0} kB".format(limit / 2**10))


def raise_for_subject(components, required_prefix):
Expand Down

0 comments on commit 09aa6dc

Please sign in to comment.