Skip to content

Commit b276204

Browse files
committedOct 17, 2015
1 parent 47c9810 commit b276204

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed
 

‎flask_script/__init__.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,20 @@ def __call__(self, app=None, **kwargs):
143143
144144
If your sub-Manager does not override this, any values for options will get lost.
145145
"""
146-
if app is None:
147-
app = self.app
146+
if self.app is None:
148147
if app is None:
149148
raise Exception("There is no app here. This is unlikely to work.")
149+
self.app = app
150+
elif app is not None:
151+
kwargs['app'] = app
150152

151-
if isinstance(app, Flask):
152-
if kwargs:
153-
import warnings
154-
warnings.warn("Options will be ignored.")
155-
return app
153+
if isinstance(self.app, Flask):
154+
# if kwargs:
155+
# import warnings
156+
# warnings.warn("Options will be ignored.")
157+
return self.app
156158

157-
app = app(**kwargs)
159+
app = self.app(**kwargs)
158160
self.app = app
159161
return app
160162

@@ -380,6 +382,7 @@ def handle(self, prog, args=None):
380382

381383
if handle is last_func and getattr(last_func, 'capture_all_args', False):
382384
args.append(remaining_args)
385+
383386
try:
384387
res = handle(*args, **config)
385388
except TypeError as err:

0 commit comments

Comments
 (0)
Please sign in to comment.