[svn] MOre work on abstracting the file locations on scanned survey notes

Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8190 by julian @ 1/18/2009 9:04 PM
This commit is contained in:
substantialnoninfringinguser
2009-05-13 05:38:37 +01:00
parent 0f5109cb09
commit 99ab1e22e9
3 changed files with 17 additions and 7 deletions

View File

@@ -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: