Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit ea1dd2d

Browse files
Ready for v1.0.0 (#14)
* Bump black from 19.10b0 to 21.12b0 Bumps [black](https://github.com/psf/black) from 19.10b0 to 21.12b0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> * Bump to v1.0.0 (#13) * Bump pytest from 5.4.3 to 6.2.5 (#12) Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.4.3 to 6.2.5. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@5.4.3...6.2.5) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Linting and bumping deps Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 2170210 commit ea1dd2d

File tree

4 files changed

+170
-197
lines changed

4 files changed

+170
-197
lines changed

clammy/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ def _init_socket(self):
6060
return clamd_socket
6161

6262
def ping(self):
63-
""" Sends the ping command to the ClamAV daemon """
63+
"""Sends the ping command to the ClamAV daemon"""
6464
return self._basic_command("PING")
6565

6666
def version(self):
67-
""" Sends the version command to the ClamAV daemon """
67+
"""Sends the version command to the ClamAV daemon"""
6868
return self._basic_command("VERSION")
6969

7070
def reload(self):
71-
""" Sends the reload command to the ClamAV daemon """
71+
"""Sends the reload command to the ClamAV daemon"""
7272
return self._basic_command("RELOAD")
7373

7474
def shutdown(self):
@@ -88,19 +88,19 @@ def shutdown(self):
8888
self._close_socket()
8989

9090
def scan(self, filename):
91-
""" Scan a file. """
91+
"""Scan a file."""
9292
return self._file_system_scan("SCAN", filename)
9393

9494
def cont_scan(self, filename):
95-
""" Scan a file but don't stop if a virus is found. """
95+
"""Scan a file but don't stop if a virus is found."""
9696
return self._file_system_scan("CONTSCAN", filename)
9797

9898
def multi_scan(self, filename):
99-
""" Scan a file using multiple threads. """
99+
"""Scan a file using multiple threads."""
100100
return self._file_system_scan("MULTISCAN", filename)
101101

102102
def _basic_command(self, command):
103-
""" Send a command to the clamav server, and return the reply. """
103+
"""Send a command to the clamav server, and return the reply."""
104104
self._init_socket()
105105
try:
106106
self._send_command(command)
@@ -212,7 +212,7 @@ def _send_command(self, cmd, *args):
212212
self.socket.sendall(cmd)
213213

214214
def _recv_response(self):
215-
""" Receive line from clamd """
215+
"""Receive line from clamd"""
216216
try:
217217
with contextlib.closing(self.socket.makefile("rb")) as file_object:
218218
return file_object.readline().decode("utf-8").strip()
@@ -222,7 +222,7 @@ def _recv_response(self):
222222
) from error
223223

224224
def _recv_response_multiline(self):
225-
""" Receive multiple line response from clamd and strip all whitespace characters """
225+
"""Receive multiple line response from clamd and strip all whitespace characters"""
226226
try:
227227
with contextlib.closing(self.socket.makefile("rb")) as file_object:
228228
return file_object.read().decode("utf-8")
@@ -232,12 +232,12 @@ def _recv_response_multiline(self):
232232
) from error
233233

234234
def _close_socket(self):
235-
""" Close clamd socket """
235+
"""Close clamd socket"""
236236
self.socket.close()
237237

238238

239239
def parse_response(msg):
240-
""" Parses responses for SCAN, CONTSCAN, MULTISCAN and STREAM commands. """
240+
"""Parses responses for SCAN, CONTSCAN, MULTISCAN and STREAM commands."""
241241

242242
scan_response = re.compile(
243243
r"^(?P<path>.*): ((?P<virus>.+) )?(?P<status>(FOUND|OK|ERROR))$"

noxfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
@session(python=["3.7", "3.8", "3.9"])
77
def test(session):
88
session.run(
9-
"pytest", "-vvv", external=True,
9+
"pytest",
10+
"-vvv",
11+
external=True,
1012
)
1113

1214

0 commit comments

Comments
 (0)