Support for windows

This commit is contained in:
Fabrice Reix 2021-01-14 16:14:04 +01:00
parent eef4568e3f
commit 13e8d5fe7b

View File

@ -9,7 +9,7 @@ current_dir = os.path.basename(os.path.dirname(__file__))
for python_file in glob.glob(current_dir + '/*.py'):
if python_file.endswith('__init__.py'):
continue
module_name = python_file.split('.')[0].replace('/', '.')
module_name = python_file.split('.')[0].replace(os.path.sep, '.')
print('loading %s' % module_name)
try:
importlib.import_module(module_name)
@ -20,4 +20,4 @@ for python_file in glob.glob(current_dir + '/*.py'):
@app.after_request
def remove_header(response):
response.headers['Server'] = 'Flask Server'
return response
return response