climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1502257 - /incubator/climate/trunk/rcmet/src/main/python/rcmes/services/directory_helpers.py
Date Thu, 11 Jul 2013 16:02:17 GMT
Author: joyce
Date: Thu Jul 11 16:02:17 2013
New Revision: 1502257

URL: http://svn.apache.org/r1502257
Log:
CLIMATE-191 - getResultsDirInfo returns invalid options

- Filter the returned paths so that directories aren't returned with the
  results. This resolves the issue that we were encountering where the
  cache directory path was returned with the results and a broken image
  link was displayed.

Modified:
    incubator/climate/trunk/rcmet/src/main/python/rcmes/services/directory_helpers.py

Modified: incubator/climate/trunk/rcmet/src/main/python/rcmes/services/directory_helpers.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/python/rcmes/services/directory_helpers.py?rev=1502257&r1=1502256&r2=1502257&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/python/rcmes/services/directory_helpers.py (original)
+++ incubator/climate/trunk/rcmet/src/main/python/rcmes/services/directory_helpers.py Thu
Jul 11 16:02:17 2013
@@ -60,8 +60,8 @@ def getResultDirInfo():
         listing = os.listdir(dirPath)
         listingNoHidden = [f for f in listing if f[0] != '.']
         joinedPaths = [os.path.join(dirPath, f) for f in listingNoHidden]
-        joinedPaths = [f + "/" if os.path.isdir(f) else f for f in joinedPaths]
-        finalPaths = [p.replace(WORK_DIR, '') for p in joinedPaths]
+        onlyFilesNoDirs = [f for f in joinedPaths if os.path.isfile(f)]
+        finalPaths = [p.replace(WORK_DIR, '') for p in onlyFilesNoDirs]
         sorted(finalPaths, key=lambda s: s.lower())
         returnJSON = finalPaths
     else:



Mime
View raw message