Implemented simplified CLI interface

This commit is contained in:
Armin Ronacher 2016-05-26 20:07:52 +02:00
parent 92f63a1c1d
commit 523e271183
5 changed files with 51 additions and 91 deletions

View file

@ -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.