forked from orbit-oss/flask
Implemented simplified CLI interface
This commit is contained in:
parent
92f63a1c1d
commit
523e271183
5 changed files with 51 additions and 91 deletions
|
|
@ -14,7 +14,6 @@ import sys
|
|||
import pkgutil
|
||||
import posixpath
|
||||
import mimetypes
|
||||
from datetime import timedelta
|
||||
from time import time
|
||||
from zlib import adler32
|
||||
from threading import RLock
|
||||
|
|
@ -54,6 +53,13 @@ _os_alt_seps = list(sep for sep in [os.path.sep, os.path.altsep]
|
|||
if sep not in (None, '/'))
|
||||
|
||||
|
||||
def get_debug_flag(default=None):
|
||||
val = os.environ.get('FLASK_DEBUG')
|
||||
if not val:
|
||||
return default
|
||||
return val not in ('0', 'false', 'no')
|
||||
|
||||
|
||||
def _endpoint_from_view_func(view_func):
|
||||
"""Internal helper that returns the default endpoint for a given
|
||||
function. This always is the function name.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue