Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pcapkit/const/ftp/command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# mypy: disable-error-code=assignment
# pylint: disable=line-too-long,consider-using-f-string
# pylint: disable=line-too-long
"""FTP Command
=================

Expand Down Expand Up @@ -37,7 +37,7 @@ class FEATCode(StrEnum):
nat6 = '<nat6>'

def __repr__(self) -> 'str':
return "<%s [%s]>" % (self.__class__.__name__, self._name_)
return f'<{self.__class__.__name__} [{self._name_}]>'

@classmethod
def _missing_(cls, value: 'str') -> 'FEATCode':
Expand Down Expand Up @@ -116,7 +116,7 @@ def __new__(cls, name: 'str', feat: 'Optional[FEATCode]' = None,
return obj

def __repr__(self) -> 'str':
return "<%s.%s: %s>" % (self.__class__.__name__, self._name_, self.desc)
return f'<{self.__class__.__name__}.{self._name_}: {self.desc}>'

#: Abort [:rfc:`959`]
ABOR: 'Command' = 'ABOR', FEATCode.base, 'Abort', CommandType.S, ConformanceRequirement.M
Expand Down
4 changes: 2 additions & 2 deletions pcapkit/const/http/method.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,consider-using-f-string
# pylint: disable=line-too-long
"""HTTP Method
=================

Expand Down Expand Up @@ -39,7 +39,7 @@ def __new__(cls, value: 'str', safe: 'bool' = False,
return obj

def __repr__(self) -> 'str':
return "<%s.%s>" % (self.__class__.__name__, self._value_)
return f'<{self.__class__.__name__}.{self._value_}>'

#: ACL [:rfc:`3744#section-8.1`]
ACL = 'ACL', False, True
Expand Down
8 changes: 4 additions & 4 deletions pcapkit/vendor/ftp/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
LINE = lambda NAME, DOCS, ENUM, MODL: f'''\
# -*- coding: utf-8 -*-
# mypy: disable-error-code=assignment
# pylint: disable=line-too-long,consider-using-f-string
# pylint: disable=line-too-long
"""{(name := DOCS.split(' [', maxsplit=1)[0])}
{'=' * (len(name) + 6)}

Expand Down Expand Up @@ -77,7 +77,7 @@ class FEATCode(StrEnum):
nat6 = '<nat6>'

def __repr__(self) -> 'str':
return "<%s [%s]>" % (self.__class__.__name__, self._name_)
return f'<{{self.__class__.__name__}} [{{self._name_}}]>'

@classmethod
def _missing_(cls, value: 'str') -> 'FEATCode':
Expand Down Expand Up @@ -156,7 +156,7 @@ def __new__(cls, name: 'str', feat: 'Optional[FEATCode]' = None,
return obj

def __repr__(self) -> 'str':
return "<%s.%s: %s>" % (self.__class__.__name__, self._name_, self.desc)
return f'<{{self.__class__.__name__}}.{{self._name_}}: {{self.desc}}>'

{ENUM}

Expand Down Expand Up @@ -229,7 +229,7 @@ def process(self, data: 'list[str]') -> 'list[str]': # type: ignore[override]
temp.append(f'[:rfc:`{rfc[3:]}`]')
else:
temp.append(f'[{rfc}]'.replace('_', ' '))
cmmt = self.wrap_comment('%s %s' % (desc, ''.join(temp))) # pylint: disable=consider-using-f-string
cmmt = self.wrap_comment(f'{desc} {"".join(temp)}')

if cmmd == '-N/A-':
cmmd = cast('str', feat)
Expand Down
10 changes: 5 additions & 5 deletions pcapkit/vendor/http/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#: Default constant template of enumerate registry from IANA CSV.
LINE = lambda NAME, DOCS, ENUM, MODL: f'''\
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,consider-using-f-string
# pylint: disable=line-too-long
"""{(name := DOCS.split(' [', maxsplit=1)[0])}
{'=' * (len(name) + 6)}

Expand Down Expand Up @@ -63,7 +63,7 @@ def __new__(cls, value: 'str', safe: 'bool' = False,
return obj

def __repr__(self) -> 'str':
return "<%s.%s>" % (self.__class__.__name__, self._value_)
return f'<{{self.__class__.__name__}}.{{self._value_}}>'

{ENUM}

Expand Down Expand Up @@ -141,9 +141,9 @@ def process(self, data: 'list[str]') -> 'list[str]': # type: ignore[override]
temp.append(f'[:rfc:`{temp_split[0]}`]')
else:
temp.append(f'[{rfc}]'.replace('_', ' '))
desc = self.wrap_comment(re.sub(r'\r*\n', ' ', '%s %s' % ( # pylint: disable=consider-using-f-string
meth, ''.join(temp) if rfcs else '',
), flags=re.MULTILINE))
desc = self.wrap_comment(re.sub(
r'\r*\n', ' ', f'{meth} {"".join(temp) if rfcs else ""}',
flags=re.MULTILINE))

name = self.safe_name(meth).upper()
safe_flag = 'True' if safe == 'yes' else 'False'
Expand Down
Loading
Loading