[run_flaschengeist] fixed bool definition

This commit is contained in:
Tim Gröger 2021-03-18 17:27:19 +01:00
parent d5ba1f023e
commit 2b35eec0fc
2 changed files with 24 additions and 17 deletions

View File

@ -10,27 +10,33 @@ from flaschengeist.config import config
class PrefixMiddleware(object): class PrefixMiddleware(object):
def __init__(self, app, prefix=""):
def __init__(self, app, prefix=''):
self.app = app self.app = app
self.prefix = prefix self.prefix = prefix
def __call__(self, environ, start_response): def __call__(self, environ, start_response):
if environ['PATH_INFO'].startswith(self.prefix): if environ["PATH_INFO"].startswith(self.prefix):
environ['PATH_INFO'] = environ['PATH_INFO'][len(self.prefix):] environ["PATH_INFO"] = environ["PATH_INFO"][len(self.prefix) :]
environ['SCRIPT_NAME'] = self.prefix environ["SCRIPT_NAME"] = self.prefix
return self.app(environ, start_response) return self.app(environ, start_response)
else: else:
start_response('404', [('Content-Type', 'text/plain')]) start_response("404", [("Content-Type", "text/plain")])
return ["This url does not belong to the app.".encode()] return ["This url does not belong to the app.".encode()]
class InterfaceGenerator: class InterfaceGenerator:
known = [] known = []
classes = {} classes = {}
mapper = {"str": "string", "int": "number", "float": "number", "date": "Date", "datetime": "Date", mapper = {
"NoneType": "null"} "str": "string",
"int": "number",
"float": "number",
"date": "Date",
"datetime": "Date",
"NoneType": "null",
"bool": "boolean",
}
def __init__(self, namespace, filename): def __init__(self, namespace, filename):
self.basename = "" self.basename = ""
@ -45,6 +51,7 @@ class InterfaceGenerator:
def _pytype(self, cls): def _pytype(self, cls):
import typing import typing
origin = typing.get_origin(cls) origin = typing.get_origin(cls)
arguments = typing.get_args(cls) arguments = typing.get_args(cls)

View File

@ -22,7 +22,7 @@ setup(
"flask_sqlalchemy", "flask_sqlalchemy",
"flask_cors", "flask_cors",
"werkzeug", "werkzeug",
mysql_driver mysql_driver,
], ],
extras_require={"ldap": ["flask_ldapconn", "ldap3"], "test": ["pytest", "coverage"]}, extras_require={"ldap": ["flask_ldapconn", "ldap3"], "test": ["pytest", "coverage"]},
entry_points={ entry_points={