mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-28 20:44:01 +03:00
Fix PEP257 doc block errors in example modules.
This commit is contained in:
parent
d58a10a2c5
commit
23642e49f4
|
@ -7,6 +7,10 @@ that were made in every particular version.
|
||||||
From version 0.7.6 *Dependency Injector* framework strictly
|
From version 0.7.6 *Dependency Injector* framework strictly
|
||||||
follows `Semantic versioning`_
|
follows `Semantic versioning`_
|
||||||
|
|
||||||
|
Development version
|
||||||
|
-------------------
|
||||||
|
+ Fix PEP257 doc block errors in example modules.
|
||||||
|
|
||||||
3.14.12
|
3.14.12
|
||||||
-------
|
-------
|
||||||
+ Fix ``3.14.11`` degradation issue causing inability of using ``Delegate`` provider in
|
+ Fix ``3.14.11`` degradation issue causing inability of using ``Delegate`` provider in
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Client(object):
|
||||||
"""Some "Client" that uses "Service"."""
|
"""Some "Client" that uses "Service"."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.service = Service() # Service instance is created inside Client
|
self.service = Service() # Service instance is created inside Client
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Client(object):
|
||||||
"""Some "Client" that uses "Service"."""
|
"""Some "Client" that uses "Service"."""
|
||||||
|
|
||||||
def __init__(self, service): # Service instance is injected into Client
|
def __init__(self, service): # Service instance is injected into Client
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.service = service
|
self.service = service
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class ApiClient(object):
|
||||||
"""Some API client."""
|
"""Some API client."""
|
||||||
|
|
||||||
def __init__(self, host, api_key):
|
def __init__(self, host, api_key):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.host = host
|
self.host = host
|
||||||
self.api_key = api_key
|
self.api_key = api_key
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class User(object):
|
||||||
"""User model."""
|
"""User model."""
|
||||||
|
|
||||||
def __init__(self, id, api_client):
|
def __init__(self, id, api_client):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.id = id
|
self.id = id
|
||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class PhotoRepository(object):
|
||||||
"""Photo entity repository."""
|
"""Photo entity repository."""
|
||||||
|
|
||||||
def __init__(self, object_factory, fs, db):
|
def __init__(self, object_factory, fs, db):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.object_factory = object_factory
|
self.object_factory = object_factory
|
||||||
self.fs = fs
|
self.fs = fs
|
||||||
self.db = db
|
self.db = db
|
||||||
|
|
|
@ -5,5 +5,5 @@ class User(object):
|
||||||
"""User entity."""
|
"""User entity."""
|
||||||
|
|
||||||
def __init__(self, id):
|
def __init__(self, id):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.id = id
|
self.id = id
|
||||||
|
|
|
@ -5,7 +5,7 @@ class UserRepository(object):
|
||||||
"""User entity repository."""
|
"""User entity repository."""
|
||||||
|
|
||||||
def __init__(self, object_factory, db):
|
def __init__(self, object_factory, db):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.object_factory = object_factory
|
self.object_factory = object_factory
|
||||||
self.db = db
|
self.db = db
|
||||||
|
|
||||||
|
|
|
@ -5,5 +5,5 @@ class Car(object):
|
||||||
"""Example car."""
|
"""Example car."""
|
||||||
|
|
||||||
def __init__(self, engine):
|
def __init__(self, engine):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self._engine = engine # Engine is injected
|
self._engine = engine # Engine is injected
|
||||||
|
|
|
@ -13,7 +13,7 @@ class MailService(AbstractMailService):
|
||||||
"""Mail service."""
|
"""Mail service."""
|
||||||
|
|
||||||
def __init__(self, host, port, login, password):
|
def __init__(self, host, port, login, password):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self._host = host
|
self._host = host
|
||||||
self._port = port
|
self._port = port
|
||||||
self._login = login
|
self._login = login
|
||||||
|
|
|
@ -14,7 +14,7 @@ class MovieFinder(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, movie_model):
|
def __init__(self, movie_model):
|
||||||
"""Initializer.
|
"""Initialize instance.
|
||||||
|
|
||||||
:param movie_model: Movie model's factory
|
:param movie_model: Movie model's factory
|
||||||
:type movie_model: movies.models.Movie
|
:type movie_model: movies.models.Movie
|
||||||
|
@ -34,7 +34,7 @@ class CsvMovieFinder(MovieFinder):
|
||||||
"""Movie finder that fetches movies data from csv file."""
|
"""Movie finder that fetches movies data from csv file."""
|
||||||
|
|
||||||
def __init__(self, movie_model, csv_file_path, delimiter):
|
def __init__(self, movie_model, csv_file_path, delimiter):
|
||||||
"""Initializer.
|
"""Initialize instance.
|
||||||
|
|
||||||
:param movie_model: Movie model's factory
|
:param movie_model: Movie model's factory
|
||||||
:type movie_model: movies.models.Movie
|
:type movie_model: movies.models.Movie
|
||||||
|
@ -64,7 +64,7 @@ class SqliteMovieFinder(MovieFinder):
|
||||||
"""Movie finder that fetches movies data from sqlite database."""
|
"""Movie finder that fetches movies data from sqlite database."""
|
||||||
|
|
||||||
def __init__(self, movie_model, database):
|
def __init__(self, movie_model, database):
|
||||||
"""Initializer.
|
"""Initialize instance.
|
||||||
|
|
||||||
:param movie_model: Movie model's factory
|
:param movie_model: Movie model's factory
|
||||||
:type movie_model: (object) -> movies.models.Movie
|
:type movie_model: (object) -> movies.models.Movie
|
||||||
|
|
|
@ -12,7 +12,7 @@ class MovieLister(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, movie_finder):
|
def __init__(self, movie_finder):
|
||||||
"""Initializer.
|
"""Initialize instance.
|
||||||
|
|
||||||
:param movie_finder: Movie finder instance
|
:param movie_finder: Movie finder instance
|
||||||
:type movie_finder: movies.finders.MovieFinder
|
:type movie_finder: movies.finders.MovieFinder
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Movie(object):
|
||||||
"""Base movie model."""
|
"""Base movie model."""
|
||||||
|
|
||||||
def __init__(self, name, year, director):
|
def __init__(self, name, year, director):
|
||||||
"""Initializer.
|
"""Initialize instance.
|
||||||
|
|
||||||
:param name: Movie's name
|
:param name: Movie's name
|
||||||
:type name: str
|
:type name: str
|
||||||
|
|
|
@ -10,7 +10,7 @@ class UsersService(object):
|
||||||
"""Users service."""
|
"""Users service."""
|
||||||
|
|
||||||
def __init__(self, password_hasher):
|
def __init__(self, password_hasher):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self._password_hasher = password_hasher
|
self._password_hasher = password_hasher
|
||||||
|
|
||||||
def create_user(self, name, password):
|
def create_user(self, name, password):
|
||||||
|
|
|
@ -9,7 +9,7 @@ class UsersService(BaseService):
|
||||||
"""Users service."""
|
"""Users service."""
|
||||||
|
|
||||||
def __init__(self, logger, db):
|
def __init__(self, logger, db):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.db = db
|
self.db = db
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class AuthService(BaseService):
|
||||||
"""Authentication service."""
|
"""Authentication service."""
|
||||||
|
|
||||||
def __init__(self, logger, db, token_ttl):
|
def __init__(self, logger, db, token_ttl):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.db = db
|
self.db = db
|
||||||
self.token_ttl = token_ttl
|
self.token_ttl = token_ttl
|
||||||
|
@ -39,7 +39,7 @@ class PhotosService(BaseService):
|
||||||
"""Photos service."""
|
"""Photos service."""
|
||||||
|
|
||||||
def __init__(self, logger, db, s3):
|
def __init__(self, logger, db, s3):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.db = db
|
self.db = db
|
||||||
self.s3 = s3
|
self.s3 = s3
|
||||||
|
|
|
@ -9,7 +9,7 @@ class UsersService(BaseService):
|
||||||
"""Users service."""
|
"""Users service."""
|
||||||
|
|
||||||
def __init__(self, logger, db):
|
def __init__(self, logger, db):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.db = db
|
self.db = db
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class AuthService(BaseService):
|
||||||
"""Authentication service."""
|
"""Authentication service."""
|
||||||
|
|
||||||
def __init__(self, logger, db, token_ttl):
|
def __init__(self, logger, db, token_ttl):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.db = db
|
self.db = db
|
||||||
self.token_ttl = token_ttl
|
self.token_ttl = token_ttl
|
||||||
|
@ -39,7 +39,7 @@ class PhotosService(BaseService):
|
||||||
"""Photos service."""
|
"""Photos service."""
|
||||||
|
|
||||||
def __init__(self, logger, db, s3):
|
def __init__(self, logger, db, s3):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
self.db = db
|
self.db = db
|
||||||
self.s3 = s3
|
self.s3 = s3
|
||||||
|
|
|
@ -13,7 +13,7 @@ class SignupUseCase(object):
|
||||||
"""Sign up use cases registers users."""
|
"""Sign up use cases registers users."""
|
||||||
|
|
||||||
def __init__(self, email_sender):
|
def __init__(self, email_sender):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.email_sender = email_sender
|
self.email_sender = email_sender
|
||||||
|
|
||||||
def execute(self, email):
|
def execute(self, email):
|
||||||
|
|
|
@ -9,7 +9,7 @@ class RedisCacheClient(AbstractCacheClient):
|
||||||
"""Cache client implementation based on Redis."""
|
"""Cache client implementation based on Redis."""
|
||||||
|
|
||||||
def __init__(self, host, port, db):
|
def __init__(self, host, port, db):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.host = host
|
self.host = host
|
||||||
self.port = port
|
self.port = port
|
||||||
self.db = db
|
self.db = db
|
||||||
|
@ -19,7 +19,7 @@ class MemcacheCacheClient(AbstractCacheClient):
|
||||||
"""Cache client implementation based on Memcached."""
|
"""Cache client implementation based on Memcached."""
|
||||||
|
|
||||||
def __init__(self, hosts, port, prefix):
|
def __init__(self, hosts, port, prefix):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.hosts = hosts
|
self.hosts = hosts
|
||||||
self.port = port
|
self.port = port
|
||||||
self.prefix = prefix
|
self.prefix = prefix
|
||||||
|
|
|
@ -13,7 +13,7 @@ class UsersFactory(providers.Provider):
|
||||||
__slots__ = ('_factory',)
|
__slots__ = ('_factory',)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self._factory = providers.Factory(User)
|
self._factory = providers.Factory(User)
|
||||||
super(UsersFactory, self).__init__()
|
super(UsersFactory, self).__init__()
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ class UsersService(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, database):
|
def __init__(self, database):
|
||||||
"""Initializer.
|
"""Initialize instance.
|
||||||
|
|
||||||
:param database: Database connection.
|
:param database: Database connection.
|
||||||
:type database: sqlite3.dbapi2.Connection
|
:type database: sqlite3.dbapi2.Connection
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Game(object):
|
||||||
"""Base game class."""
|
"""Base game class."""
|
||||||
|
|
||||||
def __init__(self, player1, player2):
|
def __init__(self, player1, player2):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.player1 = player1
|
self.player1 = player1
|
||||||
self.player2 = player2
|
self.player2 = player2
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ class FactoryAggregate(object):
|
||||||
"""FactoryAggregate provider prototype."""
|
"""FactoryAggregate provider prototype."""
|
||||||
|
|
||||||
def __init__(self, **factories):
|
def __init__(self, **factories):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.factories = factories
|
self.factories = factories
|
||||||
|
|
||||||
def __call__(self, factory_name, *args, **kwargs):
|
def __call__(self, factory_name, *args, **kwargs):
|
||||||
|
|
|
@ -12,7 +12,7 @@ class User(object):
|
||||||
"""Example user model."""
|
"""Example user model."""
|
||||||
|
|
||||||
def __init__(self, photos_factory):
|
def __init__(self, photos_factory):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.photos_factory = photos_factory
|
self.photos_factory = photos_factory
|
||||||
self._main_photo = None
|
self._main_photo = None
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ class User(object):
|
||||||
"""Example class User."""
|
"""Example class User."""
|
||||||
|
|
||||||
def __init__(self, id, password):
|
def __init__(self, id, password):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.id = id
|
self.id = id
|
||||||
self.password = password
|
self.password = password
|
||||||
super(User, self).__init__()
|
super(User, self).__init__()
|
||||||
|
@ -17,7 +17,7 @@ class UsersService(object):
|
||||||
"""Example class UsersService."""
|
"""Example class UsersService."""
|
||||||
|
|
||||||
def __init__(self, user_cls):
|
def __init__(self, user_cls):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.user_cls = user_cls
|
self.user_cls = user_cls
|
||||||
super(UsersService, self).__init__()
|
super(UsersService, self).__init__()
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class ExtendedUser(User):
|
||||||
|
|
||||||
def __init__(self, id, password, first_name=None, last_name=None,
|
def __init__(self, id, password, first_name=None, last_name=None,
|
||||||
gender=None):
|
gender=None):
|
||||||
"""Initializer."""
|
"""Initialize instance."""
|
||||||
self.first_name = first_name
|
self.first_name = first_name
|
||||||
self.last_name = last_name
|
self.last_name = last_name
|
||||||
self.gender = gender
|
self.gender = gender
|
||||||
|
|
Loading…
Reference in New Issue
Block a user