allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: [#8180] Formatting cleanup
Date Thu, 01 Feb 2018 15:50:10 GMT
Repository: allura
Updated Branches:
  refs/heads/master e7aa4c2a0 -> 4bc85b681


[#8180] Formatting cleanup


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/4bc85b68
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/4bc85b68
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/4bc85b68

Branch: refs/heads/master
Commit: 4bc85b681126d74eb3bf566002d2938ceaa4c7db
Parents: 2f2f6d0
Author: Dave Brondsema <dave@brondsema.net>
Authored: Mon Jan 29 11:29:40 2018 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu Feb 1 10:47:48 2018 -0500

----------------------------------------------------------------------
 Allura/allura/lib/custom_middleware.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/4bc85b68/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 01e58e1..b510d8f 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -74,17 +74,12 @@ class StaticFilesMiddleware(object):
                 resource_path = os.path.join('nf', ep.name.lower(), filename)
                 resource_cls = ep.load().has_resource(resource_path)
                 if resource_cls:
-                    file_path = pkg_resources.resource_filename(
-                        resource_cls.__module__, resource_path)
-                    return fileapp.FileApp(file_path, [
-                        ('Access-Control-Allow-Origin', '*')])
+                    file_path = pkg_resources.resource_filename(resource_cls.__module__,
resource_path)
+                    return fileapp.FileApp(file_path, [('Access-Control-Allow-Origin', '*')])
         filename = environ['PATH_INFO'][len(self.script_name):]
-        file_path = pkg_resources.resource_filename(
-            'allura', os.path.join(
-                'public', 'nf',
-                filename))
-        return fileapp.FileApp(file_path, [
-            ('Access-Control-Allow-Origin', '*')])
+        file_path = pkg_resources.resource_filename('allura', os.path.join('public', 'nf',
filename))
+        return fileapp.FileApp(file_path, [('Access-Control-Allow-Origin', '*')])
+
 
 class CORSMiddleware(object):
     '''Enables Cross-Origin Resource Sharing for REST API'''


Mime
View raw message