@@ -28,10 +28,10 @@ if sys.version_info[:2] >= (3, 6):
2828 from .wiring import wire, unwire
2929else :
3030 def wire (*args , **kwargs ):
31- raise NotImplementedError (' Wiring requires Python 3.6 or above' )
31+ raise NotImplementedError (" Wiring requires Python 3.6 or above" )
3232
3333 def unwire (*args , **kwargs ):
34- raise NotImplementedError (' Wiring requires Python 3.6 or above' )
34+ raise NotImplementedError (" Wiring requires Python 3.6 or above" )
3535
3636if sys.version_info[:2 ] == (3 , 5 ):
3737 warnings.warn(
@@ -137,17 +137,17 @@ class DynamicContainer(Container):
137137 If value of attribute is provider, it will be added into providers
138138 dictionary.
139139
140- :param name: Attribute's name
140+ :param name: Attribute name
141141 :type name: object
142142
143- :param value: Attribute's value
143+ :param value: Attribute value
144144 :type value: object
145145
146146 :rtype: None
147147 """
148148 if isinstance (value, providers.Provider) \
149149 and not isinstance (value, providers.Self) \
150- and name != ' parent' :
150+ and name != " parent" :
151151 _check_provider_type(self , value)
152152
153153 self .providers[name] = value
@@ -163,7 +163,7 @@ class DynamicContainer(Container):
163163 If value of attribute is provider, it will be deleted from providers
164164 dictionary.
165165
166- :param name: Attribute's name
166+ :param name: Attribute name
167167 :type name: object
168168
169169 :rtype: None
@@ -229,8 +229,8 @@ class DynamicContainer(Container):
229229 :rtype: None
230230 """
231231 if overriding is self :
232- raise errors.Error(' Container {0} could not be overridden '
233- ' with itself' .format(self ))
232+ raise errors.Error(" Container {0} could not be overridden "
233+ " with itself" .format(self ))
234234
235235 self .overridden += (overriding,)
236236
@@ -262,7 +262,7 @@ class DynamicContainer(Container):
262262 :rtype: None
263263 """
264264 if not self .overridden:
265- raise errors.Error(' Container {0} is not overridden' .format(self ))
265+ raise errors.Error(" Container {0} is not overridden" .format(self ))
266266
267267 self .overridden = self .overridden[:- 1 ]
268268
@@ -364,7 +364,7 @@ class DynamicContainer(Container):
364364 while any (resource.initialized for resource in resources):
365365 resources_to_shutdown = list (_independent_resources(resources))
366366 if not resources_to_shutdown:
367- raise RuntimeError (' Unable to resolve resources shutdown order' )
367+ raise RuntimeError (" Unable to resolve resources shutdown order" )
368368 futures = []
369369 for resource in resources_to_shutdown:
370370 result = resource.shutdown()
@@ -376,7 +376,7 @@ class DynamicContainer(Container):
376376 while any (resource.initialized for resource in resources):
377377 resources_to_shutdown = list (_independent_resources(resources))
378378 if not resources_to_shutdown:
379- raise RuntimeError (' Unable to resolve resources shutdown order' )
379+ raise RuntimeError (" Unable to resolve resources shutdown order" )
380380 for resource in resources_to_shutdown:
381381 resource.shutdown()
382382
@@ -393,7 +393,7 @@ class DynamicContainer(Container):
393393 config.load()
394394
395395 def apply_container_providers_overridings (self ):
396- """ Apply container providers' overridings."""
396+ """ Apply container providers overridings."""
397397 for provider in self .traverse(types = [providers.Container]):
398398 provider.apply_overridings()
399399
@@ -419,12 +419,12 @@ class DynamicContainer(Container):
419419
420420 container_name = self .parent_name if self .parent_name else self .__class__.__name__
421421 undefined_names = [
422- f' " {dependency.parent_name if dependency.parent_name else dependency}" '
422+ f" \" {dependency.parent_name if dependency.parent_name else dependency}\" "
423423 for dependency in undefined
424424 ]
425425 raise errors.Error(
426- f' Container "{container_name}" has undefined dependencies: '
427- f' {", " .join(undefined_names)}' ,
426+ f" Container \ " {container_name}\ " has undefined dependencies: "
427+ f" {', ' .join(undefined_names)}" ,
428428 )
429429
430430 def from_schema (self , schema ):
@@ -441,9 +441,9 @@ class DynamicContainer(Container):
441441 """
442442 if yaml is None :
443443 raise errors.Error(
444- ' Unable to load yaml schema - PyYAML is not installed. '
445- ' Install PyYAML or install Dependency Injector with yaml extras: '
446- ' " pip install dependency-injector[yaml]" '
444+ " Unable to load yaml schema - PyYAML is not installed. "
445+ " Install PyYAML or install Dependency Injector with yaml extras: "
446+ " \" pip install dependency-injector[yaml]\" "
447447 )
448448
449449 if loader is None :
@@ -466,7 +466,7 @@ class DynamicContainer(Container):
466466 if container_provider is provider:
467467 return provider_name
468468 else :
469- raise errors.Error(f' Can not resolve name for provider "{provider}" ' )
469+ raise errors.Error(f" Can not resolve name for provider \ " {provider}\" " )
470470
471471 @property
472472 def parent_name (self ):
@@ -525,11 +525,11 @@ class DeclarativeContainerMetaClass(type):
525525 " instead got {0}" .format(wiring_config)
526526 )
527527
528- attributes[' containers' ] = containers
529- attributes[' inherited_providers' ] = inherited_providers
530- attributes[' cls_providers' ] = cls_providers
531- attributes[' providers' ] = all_providers
532- attributes[' wiring_config' ] = wiring_config
528+ attributes[" containers" ] = containers
529+ attributes[" inherited_providers" ] = inherited_providers
530+ attributes[" cls_providers" ] = cls_providers
531+ attributes[" providers" ] = all_providers
532+ attributes[" wiring_config" ] = wiring_config
533533
534534 cls = < type > type .__new__ (mcs, class_name, bases, attributes)
535535
@@ -551,15 +551,15 @@ class DeclarativeContainerMetaClass(type):
551551 If value of attribute is provider, it will be added into providers
552552 dictionary.
553553
554- :param name: Attribute's name
554+ :param name: Attribute name
555555 :type name: object
556556
557- :param value: Attribute's value
557+ :param value: Attribute value
558558 :type value: object
559559
560560 :rtype: None
561561 """
562- if isinstance (value, providers.Provider) and name != ' __self__' :
562+ if isinstance (value, providers.Provider) and name != " __self__" :
563563 _check_provider_type(cls , value)
564564
565565 if isinstance (value, providers.CHILD_PROVIDERS):
@@ -575,7 +575,7 @@ class DeclarativeContainerMetaClass(type):
575575 If value of attribute is provider, it will be deleted from providers
576576 dictionary.
577577
578- :param name: Attribute's name
578+ :param name: Attribute name
579579 :type name: object
580580
581581 :rtype: None
@@ -611,7 +611,7 @@ class DeclarativeContainerMetaClass(type):
611611 if container_provider is provider:
612612 return provider_name
613613 else :
614- raise errors.Error(f' Can not resolve name for provider "{provider}" ' )
614+ raise errors.Error(f" Can not resolve name for provider \ " {provider}\" " )
615615
616616 @property
617617 def parent_name (cls ):
@@ -628,9 +628,9 @@ class DeclarativeContainerMetaClass(type):
628628 continue
629629
630630 if self is not None and value is not self :
631- raise errors.Error(' Container can have only one "Self" provider' )
631+ raise errors.Error(" Container can have only one \ " Self\ " provider" )
632632
633- if name != ' __self__' :
633+ if name != " __self__" :
634634 alt_names.append(name)
635635
636636 self = value
@@ -727,8 +727,8 @@ class DeclarativeContainer(Container):
727727 container.wiring_config = copy_module.deepcopy(cls .wiring_config)
728728 container.declarative_parent = cls
729729
730- copied_providers = providers.deepcopy({ ** cls .providers, ** {' @@self@@' : cls .__self__}})
731- copied_self = copied_providers.pop(' @@self@@' )
730+ copied_providers = providers.deepcopy({ ** cls .providers, ** {" @@self@@" : cls .__self__}})
731+ copied_self = copied_providers.pop(" @@self@@" )
732732 copied_self.set_container(container)
733733
734734 container.__self__ = copied_self
@@ -762,8 +762,8 @@ class DeclarativeContainer(Container):
762762 :rtype: None
763763 """
764764 if issubclass (cls , overriding):
765- raise errors.Error(' Container {0} could not be overridden '
766- ' with itself or its subclasses' .format(cls ))
765+ raise errors.Error(" Container {0} could not be overridden "
766+ " with itself or its subclasses" .format(cls ))
767767
768768 cls .overridden += (overriding,)
769769
@@ -780,7 +780,7 @@ class DeclarativeContainer(Container):
780780 :rtype: None
781781 """
782782 if not cls .overridden:
783- raise errors.Error(' Container {0} is not overridden' .format(cls ))
783+ raise errors.Error(" Container {0} is not overridden" .format(cls ))
784784
785785 cls .overridden = cls .overridden[:- 1 ]
786786
@@ -833,7 +833,7 @@ def override(object container):
833833 container.
834834 :type container: :py:class:`DeclarativeContainer`
835835
836- :return: Declarative container's overriding decorator.
836+ :return: Declarative container overriding decorator.
837837 :rtype: callable(:py:class:`DeclarativeContainer`)
838838 """
839839 def _decorator (object overriding_container ):
@@ -853,7 +853,7 @@ def copy(object base_container):
853853 :param base_container: Container that should be copied by decorated container.
854854 :type base_container: :py:class:`DeclarativeContainer`
855855
856- :return: Declarative container's copying decorator.
856+ :return: Declarative container copying decorator.
857857 :rtype: callable(:py:class:`DeclarativeContainer`)
858858 """
859859 def _get_memo_for_matching_names (new_providers , base_providers ):
@@ -864,7 +864,7 @@ def copy(object base_container):
864864 source_provider = base_providers[new_provider_name]
865865 memo[id (source_provider)] = new_provider
866866
867- if hasattr (new_provider, ' providers' ) and hasattr (source_provider, ' providers' ):
867+ if hasattr (new_provider, " providers" ) and hasattr (source_provider, " providers" ):
868868 sub_memo = _get_memo_for_matching_names(new_provider.providers, source_provider.providers)
869869 memo.update(sub_memo)
870870 return memo
@@ -892,13 +892,13 @@ cpdef bint is_container(object instance):
892892
893893 :rtype: bool
894894 """
895- return getattr (instance, ' __IS_CONTAINER__' , False ) is True
895+ return getattr (instance, " __IS_CONTAINER__" , False ) is True
896896
897897
898898cpdef object _check_provider_type(object container, object provider):
899899 if not isinstance (provider, container.provider_type):
900- raise errors.Error(' {0} can contain only {1} '
901- ' instances' .format(container, container.provider_type))
900+ raise errors.Error(" {0} can contain only {1} "
901+ " instances" .format(container, container.provider_type))
902902
903903
904904cpdef bint _any_relative_string_imports_in(object modules):
0 commit comments