Skip to content

Commit

Permalink
update black rules
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jul 2, 2024
1 parent 9285f93 commit 61253f7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 41 deletions.
12 changes: 5 additions & 7 deletions pyftpdlib/_asyncore.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,11 @@ def compact_traceback():
if not tb: # Must have a traceback
raise AssertionError("traceback does not exist")
while tb:
tbinfo.append(
(
tb.tb_frame.f_code.co_filename,
tb.tb_frame.f_code.co_name,
str(tb.tb_lineno),
)
)
tbinfo.append((
tb.tb_frame.f_code.co_filename,
tb.tb_frame.f_code.co_name,
str(tb.tb_lineno),
))
tb = tb.tb_next

# just to be safe
Expand Down
61 changes: 28 additions & 33 deletions pyftpdlib/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3094,13 +3094,11 @@ def ftp_STAT(self, path):
def ftp_FEAT(self, line):
"""List all new features supported as defined in RFC-2398."""
features = {'UTF8', 'TVFS'}
features.update(
[
feat
for feat in ('EPRT', 'EPSV', 'MDTM', 'MFMT', 'SIZE')
if feat in self.proto_cmds
]
)
features.update([
feat
for feat in ('EPRT', 'EPSV', 'MDTM', 'MFMT', 'SIZE')
if feat in self.proto_cmds
])
features.update(self._extra_feats)
if 'MLST' in self.proto_cmds or 'MLSD' in self.proto_cmds:
facts = ''
Expand Down Expand Up @@ -3706,34 +3704,31 @@ class TLS_FTPHandler(SSLConnection, FTPHandler):
# overridden attributes
dtp_handler = TLS_DTPHandler
proto_cmds = FTPHandler.proto_cmds.copy()
proto_cmds.update(
{
'AUTH': dict(
perm=None,
auth=False,
arg=True,
help=(
'Syntax: AUTH <SP> TLS|SSL (set up secure control '
'channel).'
),
proto_cmds.update({
'AUTH': dict(
perm=None,
auth=False,
arg=True,
help=(
'Syntax: AUTH <SP> TLS|SSL (set up secure control '
'channel).'
),
'PBSZ': dict(
perm=None,
auth=False,
arg=True,
help='Syntax: PBSZ <SP> 0 (negotiate TLS buffer).',
),
'PBSZ': dict(
perm=None,
auth=False,
arg=True,
help='Syntax: PBSZ <SP> 0 (negotiate TLS buffer).',
),
'PROT': dict(
perm=None,
auth=False,
arg=True,
help=(
'Syntax: PROT <SP> [C|P] (set up un/secure data channel).'
),
'PROT': dict(
perm=None,
auth=False,
arg=True,
help=(
'Syntax: PROT <SP> [C|P] (set up un/secure data'
' channel).'
),
),
}
)
),
})

def __init__(self, conn, server, ioloop=None):
super().__init__(conn, server, ioloop)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ line-length = 79
skip-string-normalization = true
# https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html
preview = true
enable-unstable-feature = ["multiline_string_handling", "string_processing", "wrap_long_dict_values_in_parens"]
enable-unstable-feature = ["hug_parens_with_braces_and_square_brackets", "multiline_string_handling", "string_processing", "wrap_long_dict_values_in_parens"]

[tool.ruff]
# https://beta.ruff.rs/docs/settings/
Expand Down

0 comments on commit 61253f7

Please sign in to comment.