mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 02:53:56 +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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -5,5 +5,5 @@ class User(object):
|
|||
"""User entity."""
|
||||
|
||||
def __init__(self, id):
|
||||
"""Initializer."""
|
||||
"""Initialize instance."""
|
||||
self.id = id
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -5,5 +5,5 @@ class Car(object):
|
|||
"""Example car."""
|
||||
|
||||
def __init__(self, engine):
|
||||
"""Initializer."""
|
||||
"""Initialize instance."""
|
||||
self._engine = engine # Engine is injected
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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__()
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class UsersService(object):
|
|||
"""
|
||||
|
||||
def __init__(self, database):
|
||||
"""Initializer.
|
||||
"""Initialize instance.
|
||||
|
||||
:param database: Database connection.
|
||||
:type database: sqlite3.dbapi2.Connection
|
||||
|
|
|
@ -5,7 +5,7 @@ class Game(object):
|
|||
"""Base game class."""
|
||||
|
||||
def __init__(self, player1, player2):
|
||||
"""Initializer."""
|
||||
"""Initialize instance."""
|
||||
self.player1 = player1
|
||||
self.player2 = player2
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user