@@ -78,9 +78,10 @@ def parallel_all_errors(effects):
7878 False, then ``result`` will just be the result as provided by the child
7979 effect.
8080 """
81- effects = [effect .on (success = lambda r : (False , r ),
82- error = lambda e : (True , e ))
83- for effect in effects ]
81+ effects = [
82+ effect .on (success = lambda r : (False , r ), error = lambda e : (True , e ))
83+ for effect in effects
84+ ]
8485 return Effect (ParallelEffects (list (effects )))
8586
8687
@@ -90,12 +91,16 @@ class FirstError(Exception):
9091 One of the effects in a :obj:`ParallelEffects` resulted in an error. This
9192 represents the first such error that occurred.
9293 """
94+
9395 exception = attr .ib ()
9496 index = attr .ib ()
9597
9698 def __str__ (self ):
97- return '(index=%s) %s: %s' % (
98- self .index , type (self .exception ).__name__ , self .exception )
99+ return "(index=%s) %s: %s" % (
100+ self .index ,
101+ type (self .exception ).__name__ ,
102+ self .exception ,
103+ )
99104
100105
101106@attr .s
@@ -108,6 +113,7 @@ class Delay(object):
108113
109114 :param float delay: The number of seconds to delay.
110115 """
116+
111117 delay = attr .ib ()
112118
113119
@@ -124,6 +130,7 @@ class Constant(object):
124130
125131 :param result: The object which the Effect will result in.
126132 """
133+
127134 result = attr .ib ()
128135
129136
@@ -140,6 +147,7 @@ class Error(object):
140147
141148 :param BaseException exception: Exception instance to raise.
142149 """
150+
143151 exception = attr .ib ()
144152
145153
@@ -173,6 +181,7 @@ class Func(object):
173181 :param args: Positional arguments to pass to the function.
174182 :param kwargs: Keyword arguments to pass to the function.
175183 """
184+
176185 func = attr .ib ()
177186 args = attr .ib ()
178187 kwargs = attr .ib ()
@@ -189,8 +198,6 @@ def perform_func(dispatcher, intent):
189198 return intent .func (* intent .args , ** intent .kwargs )
190199
191200
192- base_dispatcher = TypeDispatcher ({
193- Constant : perform_constant ,
194- Error : perform_error ,
195- Func : perform_func ,
196- })
201+ base_dispatcher = TypeDispatcher (
202+ {Constant : perform_constant , Error : perform_error , Func : perform_func ,}
203+ )
0 commit comments