diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-06-04 23:53:36 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-06-04 23:53:36 +0100 |
commit | 681bfcb4c452fd24233a2304ad8d9d1a416036fc (patch) | |
tree | 01051c27b94ce6b5bedf93131829a33e12fd41b8 /core/view_surveys.py | |
parent | 27816724f81f1655bd605cdbd3161a19a0222dfe (diff) | |
download | troggle-681bfcb4c452fd24233a2304ad8d9d1a416036fc.tar.gz troggle-681bfcb4c452fd24233a2304ad8d9d1a416036fc.tar.bz2 troggle-681bfcb4c452fd24233a2304ad8d9d1a416036fc.zip |
removing redundant functions
Diffstat (limited to 'core/view_surveys.py')
-rw-r--r-- | core/view_surveys.py | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/core/view_surveys.py b/core/view_surveys.py index d78c3e6..ae2d531 100644 --- a/core/view_surveys.py +++ b/core/view_surveys.py @@ -10,30 +10,30 @@ import urllib.request, urllib.parse, urllib.error # inlined use of fileabstraction into here -def fa_listdir(*path): - try: - strippedpath = [p for p in path if p] - root = os.path.join(settings.FILES, *strippedpath ) - l = "" - #l = root + "\n" - isdir = os.path.isdir(root) #This seems to be required for os.path.isdir to work... - #l += str(isdir) + "\n" - for p in os.listdir(root): - if os.path.isdir(os.path.join(root, p)): - l += p + "/\n" +# def fa_listdir(*path): + # try: + # strippedpath = [p for p in path if p] + # root = os.path.join(settings.FILES, *strippedpath ) + # l = "" + # #l = root + "\n" + # isdir = os.path.isdir(root) #This seems to be required for os.path.isdir to work... + # #l += str(isdir) + "\n" + # for p in os.listdir(root): + # if os.path.isdir(os.path.join(root, p)): + # l += p + "/\n" - elif os.path.isfile(os.path.join(root, p)): - l += p + "\n" - #Ignore non-files and non-directories - return l - except: - if strippedpath: - c = reduce(urljoin, strippedpath) - else: - c = "" - c = c.replace("#", "%23") - print(("FILE: ", settings.FILES + "listdir/" + c)) - return urllib.request.urlopen(settings.FILES + "listdir/" + c).read() + # elif os.path.isfile(os.path.join(root, p)): + # l += p + "\n" + # #Ignore non-files and non-directories + # return l + # except: + # if strippedpath: + # c = reduce(urljoin, strippedpath) + # else: + # c = "" + # c = c.replace("#", "%23") + # print(("FILE: ", settings.FILES + "listdir/" + c)) + # return urllib.request.urlopen(settings.FILES + "listdir/" + c).read() def fa_readFile(*path): try: @@ -52,11 +52,11 @@ def getMimeType(extension): return "text/plain" -def listdir(request, path): - #try: - return HttpResponse(fa_listdir(path), content_type="text/plain") - #except: - # raise Http404 +# def listdir(request, path): + # #try: + # return HttpResponse(fa_listdir(path), content_type="text/plain") + # #except: + # # raise Http404 def upload(request, path): pass |