From 545f35710f9c1fc716df01eda83a4fffabac0d70 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 5 Jul 2022 11:24:34 -0400 Subject: [PATCH] Island: Add class docstrings for IFileRepository decorators --- .../cc/repository/file_repository_caching_decorator.py | 4 ++++ .../cc/repository/file_repository_locking_decorator.py | 4 ++++ .../cc/repository/file_repository_logging_decorator.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/monkey/monkey_island/cc/repository/file_repository_caching_decorator.py b/monkey/monkey_island/cc/repository/file_repository_caching_decorator.py index 76739716f..0e026d035 100644 --- a/monkey/monkey_island/cc/repository/file_repository_caching_decorator.py +++ b/monkey/monkey_island/cc/repository/file_repository_caching_decorator.py @@ -7,6 +7,10 @@ from . import IFileRepository class FileRepositoryCachingDecorator(IFileRepository): + """ + An IFileRepository decorator that provides caching for other IFileRepositories. + """ + def __init__(self, file_repository: IFileRepository): self._file_repository = file_repository diff --git a/monkey/monkey_island/cc/repository/file_repository_locking_decorator.py b/monkey/monkey_island/cc/repository/file_repository_locking_decorator.py index 0e7ee8a50..1bd76b4dd 100644 --- a/monkey/monkey_island/cc/repository/file_repository_locking_decorator.py +++ b/monkey/monkey_island/cc/repository/file_repository_locking_decorator.py @@ -6,6 +6,10 @@ from . import IFileRepository class FileRepositoryLockingDecorator(IFileRepository): + """ + An IFileRepository decorator that makes other IFileRepositories thread-safe. + """ + def __init__(self, file_repository: IFileRepository): self._file_repository = file_repository self._rwlock = rwlock.RWLockFair() diff --git a/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py b/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py index 5365faf4b..2bf8bfe6e 100644 --- a/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py +++ b/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py @@ -7,6 +7,10 @@ logger = logging.getLogger(__name__) class FileRepositoryLoggingDecorator(IFileRepository): + """ + An IFileRepository decorator that provides debug logging for other IFileRepositories. + """ + def __init__(self, file_repository: IFileRepository): self._file_repository = file_repository