Commit graph

56 commits

Author SHA1 Message Date
David Lord
c279a827cc add sort by match order
sort by endpoint by default
combine sort flags
sort methods
ignore HEAD and OPTIONS methods by default
rearrange columns
use format to build row format string
rework tests
add changelog
2017-04-26 10:26:59 -07:00
David Lord
57515e1887 Merge branch 'master' into routes-command 2017-04-25 13:13:10 -07:00
Ed Brannin
9223569767 shorten output when ImportError due to app bug.
Before:
```
C:\dev\tmp>py -2 -m flask run
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\dev\sourcetree\flask\flask\__main__.py", line 15, in <module>
    main(as_module=True)
  File "c:\dev\sourcetree\flask\flask\cli.py", line 523, in main
    cli.main(args=args, prog_name=name)
  File "c:\dev\sourcetree\flask\flask\cli.py", line 383, in main
    return AppGroup.main(self, *args, **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Python27\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python27\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python27\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\dev\sourcetree\flask\flask\cli.py", line 433, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "c:\dev\sourcetree\flask\flask\cli.py", line 153, in __init__
    self._load_unlocked()
  File "c:\dev\sourcetree\flask\flask\cli.py", line 177, in _load_unlocked
    self._app = rv = self.loader()
  File "c:\dev\sourcetree\flask\flask\cli.py", line 238, in load_app
    rv = locate_app(self.app_import_path)
  File "c:\dev\sourcetree\flask\flask\cli.py", line 91, in locate_app
    __import__(module)
  File "C:\dev\tmp\error.py", line 1, in <module>
    import whatisthisidonteven
ImportError: No module named whatisthisidonteven
```

After:
```
C:\dev\tmp>py -2 -m flask run
Usage: python -m flask run [OPTIONS]

Error: There was an error trying to import the app (error):
Traceback (most recent call last):
  File "c:\dev\sourcetree\flask\flask\cli.py", line 91, in locate_app
    __import__(module)
  File "C:\dev\tmp\error.py", line 1, in <module>
    import whatisthisidonteven
ImportError: No module named whatisthisidonteven```
2017-03-21 15:22:15 -04:00
Sven-Hendrik Haase
c53aa3affe Remove useless pass 2017-03-16 14:42:16 +01:00
Sven-Hendrik Haase
ae6617e85d Print a stacktrace on CLI error (closes #2208) 2017-03-16 14:37:58 +01:00
Armin Ronacher
02b5eadc43 Convert Flask.run into a noop when run from the CLI 2017-01-29 12:26:52 +01:00
Paul Brown
74a0eee5a1 prevent NoAppException when ImportError occurs within imported module 2016-12-30 22:45:53 +01:00
Clenimar Filemon
562656af0a Capitalize occurrences of 'flask' (#2067) 2016-11-01 18:52:32 -07:00
Michael Recachinas
d544a46a7d Remove -a/--app from Quickstart documentation (#2046)
* Remove `-a/--app` from Quickstart documentation

As mentioned in #2009, simplifying the CLI saw the removal of the `-a/--app` flag. Therefore, the only way to specify the module to import is by setting `FLASK_APP`.

* Remove misleading `either` from CLI help

The CLI help details how to run the application, but still uses the phrasing "either through the `FLASK_APP`...". This likely is an artifact from when `-a/--app` was still present in the CLI.
2016-10-01 18:45:22 +02:00
Markus Unterwaditzer
ec9e9c2f6e Don't passthrough_errors unless instructed. (#2006)
Fix #2005

Revert #1679 and #1996
2016-09-06 22:32:34 +02:00
Markus Unterwaditzer
2a5061282b Only passthrough_errors if PROPAGATE_EXCEPTIONS
See pallets/werkzeug#954
2016-08-27 14:38:13 +02:00
Nate Prewitt
9608198047 adding in try around __import__ to catch invalid files/paths (#1950) 2016-08-12 15:12:00 +02:00
David Lord
d775103a03 clean up code formatting in some docs
fix warnings while building docs
2016-06-26 13:03:29 -07:00
Kiss György
53444cfc8a Added tests, fixed some minor alignment problems. 2016-06-25 13:22:18 +02:00
Kiss György
9522f4f76c Added routes command, which shows all the endpoints registered for the app.
Orderable by rules, endpoints and methods. Shows up in the builtin command list.
2016-06-25 12:15:14 +02:00
David Lord
18a00020e5 re-add passthrough_errors to cli runner (#1928)
This got dropped during the cli simplification.  Re: #1679
2016-06-23 13:00:45 -07:00
jphilipsen05
92000b6658 fixed unmatched elif (#1872) 2016-06-03 18:41:10 +02:00
RamiC
b79d3f3f35 Use the whole sys.version string 2016-06-02 13:55:00 +03:00
RamiC
ffa148810b Add a --version switch to flask cli
re #1828
2016-06-02 13:35:16 +03:00
Yoav Ram
0dd2f0a88c Update help to > set FLASK_APP=hello.py (#1830)
When running `flask --help`, the printed string contains this:
>   Example usage:
>
>   set FLASK_APP=hello
>    set FLASK_DEBUG=1
>    flask run

but it actually only works with `set FLASK_APP=hello.py` so the help should be changed.

This is true on my Windows 7 Python 3.5 flask 0.11 setup.
2016-05-30 23:20:35 +02:00
Armin Ronacher
d7f5bbb4e1 Added plugin support to the cli 2016-05-26 21:29:01 +02:00
Armin Ronacher
4cb36cbafc Update docs to the new CLI patterns 2016-05-26 20:45:50 +02:00
Armin Ronacher
3b98e39768 Implemented simplified CLI interface 2016-05-26 20:07:52 +02:00
Miguel Grinberg
2bbddf57f8 Werkzeug should not block propagated exceptions from Flask 2016-01-02 14:18:36 -08:00
GunWoo Choi
b037e50c83 Update title of docstring in flask.cli 2015-06-12 13:40:53 +09:00
Parkayun
e05771ff60 Happy New Year 2015 2015-01-02 11:35:00 +09:00
Armin Ronacher
3481827dda Hide a few traceback frames from the cli interface. 2014-12-27 12:25:03 +01:00
defuz
ec806c1bbe docs: :command:pip, :option:--debug 2014-11-05 07:03:55 +03:00
Petr Zemek
feeab8fa00 Fix two typos in the description of FlaskGroup. 2014-10-27 11:03:07 +01:00
Markus Unterwaditzer
8c05493066 Fix syntax error on py3 2014-09-03 15:27:06 +02:00
Armin Ronacher
c313962f05 Added support for background loading of the application to speed up initial requests in dev mode. 2014-09-02 16:20:46 +02:00
Armin Ronacher
8b41cacfb0 AppGroups produce more AppGroups 2014-08-28 09:35:06 +02:00
Armin Ronacher
f9e25bdd64 Made FlaskGroup an AppGroup 2014-08-28 08:56:58 +02:00
Armin Ronacher
565878713f Added support for PYTHONSTARTUP to shell command. 2014-08-26 12:07:09 +02:00
Armin Ronacher
3b8acece5a Added a missing self 2014-08-26 10:14:27 +02:00
Armin Ronacher
32f2f70a7d Removed ridiculous constructor from AppGroup 2014-08-26 10:09:17 +02:00
Armin Ronacher
ef6ae15126 Refactored the scripting interface greatly. 2014-08-25 16:50:22 +02:00
Armin Ronacher
bb2d8387cc Converted a leftover old-style click callback. 2014-08-25 15:43:27 +02:00
Armin Ronacher
1e3ae27d88 Switch to newer click (2.0) 2014-08-12 23:23:52 +02:00
Armin Ronacher
3682b67bdf Simplified app finding for cli 2014-05-12 02:16:38 +02:00
Armin Ronacher
205a558ca1 Simplified click integration a bit 2014-05-12 02:16:38 +02:00
Armin Ronacher
86ed5bbf6f Fixed the cli system failing syntax errors. 2014-05-08 22:33:58 +02:00
Armin Ronacher
e2cbb5ae32 Merge pull request #1040 from schlamar/patch-1
Fixed typo.
2014-05-07 21:44:30 +02:00
Armin Ronacher
f7c31e29b0 Greatly refactored click integration and documented it a bit more. 2014-05-07 21:35:51 +02:00
Marc Schlaich
6659b1c884 Fixed typo. 2014-05-07 15:53:19 +02:00
Armin Ronacher
7e2bccb51d Further refactored script system to allow more customization for special apps. 2014-05-07 13:27:41 +02:00
Armin Ronacher
dc67f1dea0 Refactored loading logic to super properly. 2014-05-07 11:36:49 +02:00
Armin Ronacher
9000ed7df3 Refactored script info to allow more advanced patterns. 2014-05-07 11:34:20 +02:00
Armin Ronacher
081fe261be Fixed flask tests 2014-05-02 11:46:04 +01:00
Armin Ronacher
9869fc9106 Improved support for composable cli 2014-05-01 13:44:11 +01:00