Rework conditionals to not be inline

This commit is contained in:
Eli Uriegas 2016-12-24 18:11:12 -08:00 committed by GitHub
parent 2003eceba1
commit 29f3c22fed

View File

@ -37,8 +37,10 @@ def register(app, uri, file_or_directory, pattern, use_modified_since):
# Merge served directory and requested file if provided # Merge served directory and requested file if provided
# Strip all / that in the beginning of the URL to help prevent python # Strip all / that in the beginning of the URL to help prevent python
# from herping a derp and treating the uri as an absolute path # from herping a derp and treating the uri as an absolute path
file_path = path.join(file_or_directory, sub('^[/]*', '', file_uri)) \ file_path = file_or_directory
if file_uri else file_or_directory if file_uri:
file_path = path.join(
file_or_directory, sub('^[/]*', '', file_uri))
# URL decode the path sent by the browser otherwise we won't be able to # URL decode the path sent by the browser otherwise we won't be able to
# match filenames which got encoded (filenames with spaces etc) # match filenames which got encoded (filenames with spaces etc)