mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-26 01:01:53 +00:00
Decode the url encoded # when looking at wallets
This commit is contained in:
parent
e59f8308ce
commit
b43bd58f22
@ -6,6 +6,7 @@ import os, stat
|
|||||||
import re
|
import re
|
||||||
from troggle.core.models import SurvexScansFolder, SurvexScanSingle, SurvexBlock, TunnelFile
|
from troggle.core.models import SurvexScansFolder, SurvexScanSingle, SurvexBlock, TunnelFile
|
||||||
import parsers.surveys
|
import parsers.surveys
|
||||||
|
import urllib
|
||||||
|
|
||||||
# inline fileabstraction into here if it's not going to be useful anywhere else
|
# inline fileabstraction into here if it's not going to be useful anywhere else
|
||||||
# keep things simple and ignore exceptions everywhere for now
|
# keep things simple and ignore exceptions everywhere for now
|
||||||
@ -17,7 +18,7 @@ def getMimeType(extension):
|
|||||||
"html": "text/html",
|
"html": "text/html",
|
||||||
}[extension]
|
}[extension]
|
||||||
except:
|
except:
|
||||||
print "unknown file type"
|
print("unknown file type")
|
||||||
return "text/plain"
|
return "text/plain"
|
||||||
|
|
||||||
|
|
||||||
@ -166,11 +167,11 @@ def jgtuploadfile(request):
|
|||||||
|
|
||||||
def surveyscansfolder(request, path):
|
def surveyscansfolder(request, path):
|
||||||
#print [ s.walletname for s in SurvexScansFolder.objects.all() ]
|
#print [ s.walletname for s in SurvexScansFolder.objects.all() ]
|
||||||
survexscansfolder = SurvexScansFolder.objects.get(walletname=path)
|
survexscansfolder = SurvexScansFolder.objects.get(walletname=urllib.unquote(path))
|
||||||
return render_to_response('survexscansfolder.html', { 'survexscansfolder':survexscansfolder, 'settings': settings })
|
return render_to_response('survexscansfolder.html', { 'survexscansfolder':survexscansfolder, 'settings': settings })
|
||||||
|
|
||||||
def surveyscansingle(request, path, file):
|
def surveyscansingle(request, path, file):
|
||||||
survexscansfolder = SurvexScansFolder.objects.get(walletname=path)
|
survexscansfolder = SurvexScansFolder.objects.get(walletname=urllib.unquote(path))
|
||||||
survexscansingle = SurvexScanSingle.objects.get(survexscansfolder=survexscansfolder, name=file)
|
survexscansingle = SurvexScanSingle.objects.get(survexscansfolder=survexscansfolder, name=file)
|
||||||
return HttpResponse(content=open(survexscansingle.ffile), content_type=getMimeType(path.split(".")[-1]))
|
return HttpResponse(content=open(survexscansingle.ffile), content_type=getMimeType(path.split(".")[-1]))
|
||||||
#return render_to_response('survexscansfolder.html', { 'survexscansfolder':survexscansfolder, 'settings': settings })
|
#return render_to_response('survexscansfolder.html', { 'survexscansfolder':survexscansfolder, 'settings': settings })
|
||||||
@ -186,12 +187,12 @@ def tunneldata(request):
|
|||||||
|
|
||||||
|
|
||||||
def tunnelfile(request, path):
|
def tunnelfile(request, path):
|
||||||
tunnelfile = TunnelFile.objects.get(tunnelpath=path)
|
tunnelfile = TunnelFile.objects.get(tunnelpath=urllib.unquote(path))
|
||||||
tfile = os.path.join(settings.TUNNEL_DATA, tunnelfile.tunnelpath)
|
tfile = os.path.join(settings.TUNNEL_DATA, tunnelfile.tunnelpath)
|
||||||
return HttpResponse(content=open(tfile), content_type="text/plain")
|
return HttpResponse(content=open(tfile), content_type="text/plain")
|
||||||
|
|
||||||
def tunnelfileupload(request, path):
|
def tunnelfileupload(request, path):
|
||||||
tunnelfile = TunnelFile.objects.get(tunnelpath=path)
|
tunnelfile = TunnelFile.objects.get(tunnelpath=urllib.unquote(path))
|
||||||
tfile = os.path.join(settings.TUNNEL_DATA, tunnelfile.tunnelpath)
|
tfile = os.path.join(settings.TUNNEL_DATA, tunnelfile.tunnelpath)
|
||||||
|
|
||||||
project, user, password, tunnelversion = request.POST["tunnelproject"], request.POST["tunneluser"], request.POST["tunnelpassword"], request.POST["tunnelversion"]
|
project, user, password, tunnelversion = request.POST["tunnelproject"], request.POST["tunneluser"], request.POST["tunnelpassword"], request.POST["tunnelversion"]
|
||||||
|
Loading…
Reference in New Issue
Block a user