summaryrefslogtreecommitdiffstats
path: root/expo/fileAbstraction.py
diff options
context:
space:
mode:
Diffstat (limited to 'expo/fileAbstraction.py')
-rw-r--r--expo/fileAbstraction.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/expo/fileAbstraction.py b/expo/fileAbstraction.py
index 4431480..299a488 100644
--- a/expo/fileAbstraction.py
+++ b/expo/fileAbstraction.py
@@ -25,9 +25,15 @@ def listdir(*path):
c = reduce(urljoin, strippedpath)
else:
c = ""
- print strippedpath, c
- return urllib.urlopen(settings.FILES + "listdir/" + c)
+ c = c.replace("#", "%23")
+ print "FILE: ", settings.FILES + "listdir/" + c
+ return urllib.urlopen(settings.FILES + "listdir/" + c).read()
+
+def dirsAsList(*path):
+ return [d for d in listdir(*path).split("\n") if len(d) > 0 and d[-1] == "/"]
+def filesAsList(*path):
+ return [d for d in listdir(*path).split("\n") if len(d) > 0 and d[-1] != "/"]
def readFile(*path):
try: