From 23642e49f4d7731367a6608b6a2fcd34e08bafa8 Mon Sep 17 00:00:00 2001 From: Roman Mogylatov Date: Sun, 26 Jan 2020 14:22:43 -0500 Subject: [PATCH] Fix PEP257 doc block errors in example modules. --- docs/main/changelog.rst | 4 ++++ examples/di_demo/example.py | 2 +- examples/di_demo/example_di.py | 2 +- examples/miniapps/api_client/api.py | 2 +- examples/miniapps/api_client/models.py | 2 +- examples/miniapps/bundles/bundles/photos/repositories.py | 2 +- examples/miniapps/bundles/bundles/users/entities.py | 2 +- examples/miniapps/bundles/bundles/users/repositories.py | 2 +- examples/miniapps/engines_cars/example/cars.py | 2 +- examples/miniapps/mail_service/example.py | 2 +- examples/miniapps/movie_lister/movies/finders.py | 6 +++--- examples/miniapps/movie_lister/movies/listers.py | 2 +- examples/miniapps/movie_lister/movies/models.py | 2 +- examples/miniapps/password_hashing/example.py | 2 +- examples/miniapps/services_v1/example/services.py | 6 +++--- examples/miniapps/services_v2/example/services.py | 6 +++--- examples/miniapps/use_cases/example/use_cases.py | 2 +- examples/providers/abstract_factory/cache.py | 4 ++-- examples/providers/custom_factory.py | 2 +- examples/providers/dependency.py | 2 +- examples/providers/factory_aggregate/games.py | 2 +- examples/providers/factory_aggregate/prototype.py | 2 +- examples/providers/factory_delegation.py | 2 +- examples/providers/overriding_users_model.py | 6 +++--- 24 files changed, 36 insertions(+), 32 deletions(-) diff --git a/docs/main/changelog.rst b/docs/main/changelog.rst index 787435ad..7676b246 100644 --- a/docs/main/changelog.rst +++ b/docs/main/changelog.rst @@ -7,6 +7,10 @@ that were made in every particular version. From version 0.7.6 *Dependency Injector* framework strictly follows `Semantic versioning`_ +Development version +------------------- ++ Fix PEP257 doc block errors in example modules. + 3.14.12 ------- + Fix ``3.14.11`` degradation issue causing inability of using ``Delegate`` provider in diff --git a/examples/di_demo/example.py b/examples/di_demo/example.py index 3a0d8036..545b3e86 100644 --- a/examples/di_demo/example.py +++ b/examples/di_demo/example.py @@ -9,7 +9,7 @@ class Client(object): """Some "Client" that uses "Service".""" def __init__(self): - """Initializer.""" + """Initialize instance.""" self.service = Service() # Service instance is created inside Client diff --git a/examples/di_demo/example_di.py b/examples/di_demo/example_di.py index cb289a19..0cb704c9 100644 --- a/examples/di_demo/example_di.py +++ b/examples/di_demo/example_di.py @@ -9,7 +9,7 @@ class Client(object): """Some "Client" that uses "Service".""" def __init__(self, service): # Service instance is injected into Client - """Initializer.""" + """Initialize instance.""" self.service = service diff --git a/examples/miniapps/api_client/api.py b/examples/miniapps/api_client/api.py index b92641e3..e7b0d6ae 100644 --- a/examples/miniapps/api_client/api.py +++ b/examples/miniapps/api_client/api.py @@ -5,7 +5,7 @@ class ApiClient(object): """Some API client.""" def __init__(self, host, api_key): - """Initializer.""" + """Initialize instance.""" self.host = host self.api_key = api_key diff --git a/examples/miniapps/api_client/models.py b/examples/miniapps/api_client/models.py index 0cd1c7c9..376bb51e 100644 --- a/examples/miniapps/api_client/models.py +++ b/examples/miniapps/api_client/models.py @@ -5,7 +5,7 @@ class User(object): """User model.""" def __init__(self, id, api_client): - """Initializer.""" + """Initialize instance.""" self.id = id self.api_client = api_client diff --git a/examples/miniapps/bundles/bundles/photos/repositories.py b/examples/miniapps/bundles/bundles/photos/repositories.py index 710872ae..b8ec453f 100644 --- a/examples/miniapps/bundles/bundles/photos/repositories.py +++ b/examples/miniapps/bundles/bundles/photos/repositories.py @@ -5,7 +5,7 @@ class PhotoRepository(object): """Photo entity repository.""" def __init__(self, object_factory, fs, db): - """Initializer.""" + """Initialize instance.""" self.object_factory = object_factory self.fs = fs self.db = db diff --git a/examples/miniapps/bundles/bundles/users/entities.py b/examples/miniapps/bundles/bundles/users/entities.py index 104dace4..258bec0a 100644 --- a/examples/miniapps/bundles/bundles/users/entities.py +++ b/examples/miniapps/bundles/bundles/users/entities.py @@ -5,5 +5,5 @@ class User(object): """User entity.""" def __init__(self, id): - """Initializer.""" + """Initialize instance.""" self.id = id diff --git a/examples/miniapps/bundles/bundles/users/repositories.py b/examples/miniapps/bundles/bundles/users/repositories.py index d661a4c3..8d561c85 100644 --- a/examples/miniapps/bundles/bundles/users/repositories.py +++ b/examples/miniapps/bundles/bundles/users/repositories.py @@ -5,7 +5,7 @@ class UserRepository(object): """User entity repository.""" def __init__(self, object_factory, db): - """Initializer.""" + """Initialize instance.""" self.object_factory = object_factory self.db = db diff --git a/examples/miniapps/engines_cars/example/cars.py b/examples/miniapps/engines_cars/example/cars.py index a1ddc027..0f6265cb 100644 --- a/examples/miniapps/engines_cars/example/cars.py +++ b/examples/miniapps/engines_cars/example/cars.py @@ -5,5 +5,5 @@ class Car(object): """Example car.""" def __init__(self, engine): - """Initializer.""" + """Initialize instance.""" self._engine = engine # Engine is injected diff --git a/examples/miniapps/mail_service/example.py b/examples/miniapps/mail_service/example.py index ae69b9aa..08f1eb8a 100644 --- a/examples/miniapps/mail_service/example.py +++ b/examples/miniapps/mail_service/example.py @@ -13,7 +13,7 @@ class MailService(AbstractMailService): """Mail service.""" def __init__(self, host, port, login, password): - """Initializer.""" + """Initialize instance.""" self._host = host self._port = port self._login = login diff --git a/examples/miniapps/movie_lister/movies/finders.py b/examples/miniapps/movie_lister/movies/finders.py index b9b8f42a..f09e106c 100644 --- a/examples/miniapps/movie_lister/movies/finders.py +++ b/examples/miniapps/movie_lister/movies/finders.py @@ -14,7 +14,7 @@ class MovieFinder(object): """ def __init__(self, movie_model): - """Initializer. + """Initialize instance. :param movie_model: Movie model's factory :type movie_model: movies.models.Movie @@ -34,7 +34,7 @@ class CsvMovieFinder(MovieFinder): """Movie finder that fetches movies data from csv file.""" def __init__(self, movie_model, csv_file_path, delimiter): - """Initializer. + """Initialize instance. :param movie_model: Movie model's factory :type movie_model: movies.models.Movie @@ -64,7 +64,7 @@ class SqliteMovieFinder(MovieFinder): """Movie finder that fetches movies data from sqlite database.""" def __init__(self, movie_model, database): - """Initializer. + """Initialize instance. :param movie_model: Movie model's factory :type movie_model: (object) -> movies.models.Movie diff --git a/examples/miniapps/movie_lister/movies/listers.py b/examples/miniapps/movie_lister/movies/listers.py index 2ae78860..5d4d88fb 100644 --- a/examples/miniapps/movie_lister/movies/listers.py +++ b/examples/miniapps/movie_lister/movies/listers.py @@ -12,7 +12,7 @@ class MovieLister(object): """ def __init__(self, movie_finder): - """Initializer. + """Initialize instance. :param movie_finder: Movie finder instance :type movie_finder: movies.finders.MovieFinder diff --git a/examples/miniapps/movie_lister/movies/models.py b/examples/miniapps/movie_lister/movies/models.py index 9e22d693..e0371d5d 100644 --- a/examples/miniapps/movie_lister/movies/models.py +++ b/examples/miniapps/movie_lister/movies/models.py @@ -8,7 +8,7 @@ class Movie(object): """Base movie model.""" def __init__(self, name, year, director): - """Initializer. + """Initialize instance. :param name: Movie's name :type name: str diff --git a/examples/miniapps/password_hashing/example.py b/examples/miniapps/password_hashing/example.py index a291485d..1f9cd957 100644 --- a/examples/miniapps/password_hashing/example.py +++ b/examples/miniapps/password_hashing/example.py @@ -10,7 +10,7 @@ class UsersService(object): """Users service.""" def __init__(self, password_hasher): - """Initializer.""" + """Initialize instance.""" self._password_hasher = password_hasher def create_user(self, name, password): diff --git a/examples/miniapps/services_v1/example/services.py b/examples/miniapps/services_v1/example/services.py index c3b1b7cf..60f7a5cc 100644 --- a/examples/miniapps/services_v1/example/services.py +++ b/examples/miniapps/services_v1/example/services.py @@ -9,7 +9,7 @@ class UsersService(BaseService): """Users service.""" def __init__(self, logger, db): - """Initializer.""" + """Initialize instance.""" self.logger = logger self.db = db @@ -23,7 +23,7 @@ class AuthService(BaseService): """Authentication service.""" def __init__(self, logger, db, token_ttl): - """Initializer.""" + """Initialize instance.""" self.logger = logger self.db = db self.token_ttl = token_ttl @@ -39,7 +39,7 @@ class PhotosService(BaseService): """Photos service.""" def __init__(self, logger, db, s3): - """Initializer.""" + """Initialize instance.""" self.logger = logger self.db = db self.s3 = s3 diff --git a/examples/miniapps/services_v2/example/services.py b/examples/miniapps/services_v2/example/services.py index c3b1b7cf..60f7a5cc 100644 --- a/examples/miniapps/services_v2/example/services.py +++ b/examples/miniapps/services_v2/example/services.py @@ -9,7 +9,7 @@ class UsersService(BaseService): """Users service.""" def __init__(self, logger, db): - """Initializer.""" + """Initialize instance.""" self.logger = logger self.db = db @@ -23,7 +23,7 @@ class AuthService(BaseService): """Authentication service.""" def __init__(self, logger, db, token_ttl): - """Initializer.""" + """Initialize instance.""" self.logger = logger self.db = db self.token_ttl = token_ttl @@ -39,7 +39,7 @@ class PhotosService(BaseService): """Photos service.""" def __init__(self, logger, db, s3): - """Initializer.""" + """Initialize instance.""" self.logger = logger self.db = db self.s3 = s3 diff --git a/examples/miniapps/use_cases/example/use_cases.py b/examples/miniapps/use_cases/example/use_cases.py index 8bf5c938..1cd8f144 100644 --- a/examples/miniapps/use_cases/example/use_cases.py +++ b/examples/miniapps/use_cases/example/use_cases.py @@ -13,7 +13,7 @@ class SignupUseCase(object): """Sign up use cases registers users.""" def __init__(self, email_sender): - """Initializer.""" + """Initialize instance.""" self.email_sender = email_sender def execute(self, email): diff --git a/examples/providers/abstract_factory/cache.py b/examples/providers/abstract_factory/cache.py index fe499a2c..751e03af 100644 --- a/examples/providers/abstract_factory/cache.py +++ b/examples/providers/abstract_factory/cache.py @@ -9,7 +9,7 @@ class RedisCacheClient(AbstractCacheClient): """Cache client implementation based on Redis.""" def __init__(self, host, port, db): - """Initializer.""" + """Initialize instance.""" self.host = host self.port = port self.db = db @@ -19,7 +19,7 @@ class MemcacheCacheClient(AbstractCacheClient): """Cache client implementation based on Memcached.""" def __init__(self, hosts, port, prefix): - """Initializer.""" + """Initialize instance.""" self.hosts = hosts self.port = port self.prefix = prefix diff --git a/examples/providers/custom_factory.py b/examples/providers/custom_factory.py index 8e978872..f890a585 100644 --- a/examples/providers/custom_factory.py +++ b/examples/providers/custom_factory.py @@ -13,7 +13,7 @@ class UsersFactory(providers.Provider): __slots__ = ('_factory',) def __init__(self): - """Initializer.""" + """Initialize instance.""" self._factory = providers.Factory(User) super(UsersFactory, self).__init__() diff --git a/examples/providers/dependency.py b/examples/providers/dependency.py index 142db49a..987e39d9 100644 --- a/examples/providers/dependency.py +++ b/examples/providers/dependency.py @@ -13,7 +13,7 @@ class UsersService(object): """ def __init__(self, database): - """Initializer. + """Initialize instance. :param database: Database connection. :type database: sqlite3.dbapi2.Connection diff --git a/examples/providers/factory_aggregate/games.py b/examples/providers/factory_aggregate/games.py index f7627496..3900ac9d 100644 --- a/examples/providers/factory_aggregate/games.py +++ b/examples/providers/factory_aggregate/games.py @@ -5,7 +5,7 @@ class Game(object): """Base game class.""" def __init__(self, player1, player2): - """Initializer.""" + """Initialize instance.""" self.player1 = player1 self.player2 = player2 diff --git a/examples/providers/factory_aggregate/prototype.py b/examples/providers/factory_aggregate/prototype.py index 08ebed3d..799d1905 100644 --- a/examples/providers/factory_aggregate/prototype.py +++ b/examples/providers/factory_aggregate/prototype.py @@ -5,7 +5,7 @@ class FactoryAggregate(object): """FactoryAggregate provider prototype.""" def __init__(self, **factories): - """Initializer.""" + """Initialize instance.""" self.factories = factories def __call__(self, factory_name, *args, **kwargs): diff --git a/examples/providers/factory_delegation.py b/examples/providers/factory_delegation.py index 2a2a01fc..fd19a119 100644 --- a/examples/providers/factory_delegation.py +++ b/examples/providers/factory_delegation.py @@ -12,7 +12,7 @@ class User(object): """Example user model.""" def __init__(self, photos_factory): - """Initializer.""" + """Initialize instance.""" self.photos_factory = photos_factory self._main_photo = None diff --git a/examples/providers/overriding_users_model.py b/examples/providers/overriding_users_model.py index b3ab2adc..ca415a4c 100644 --- a/examples/providers/overriding_users_model.py +++ b/examples/providers/overriding_users_model.py @@ -7,7 +7,7 @@ class User(object): """Example class User.""" def __init__(self, id, password): - """Initializer.""" + """Initialize instance.""" self.id = id self.password = password super(User, self).__init__() @@ -17,7 +17,7 @@ class UsersService(object): """Example class UsersService.""" def __init__(self, user_cls): - """Initializer.""" + """Initialize instance.""" self.user_cls = user_cls super(UsersService, self).__init__() @@ -52,7 +52,7 @@ class ExtendedUser(User): def __init__(self, id, password, first_name=None, last_name=None, gender=None): - """Initializer.""" + """Initialize instance.""" self.first_name = first_name self.last_name = last_name self.gender = gender