2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

Unicode fix for SVX display and edit page

This commit is contained in:
Philip Sargent 2020-05-31 20:46:12 +01:00
parent fe515e9f01
commit 09aedecc3b
2 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@ class SvxForm(forms.Form):
if mbeginend.group(1) != mbeginend.group(2): if mbeginend.group(1) != mbeginend.group(2):
return "Error: mismatching beginend" return "Error: mismatching beginend"
fout = open(fname, "w") fout = open(fname, "wb")
res = fout.write(rcode.encode("latin1")) res = fout.write(rcode.encode("latin1"))
fout.close() fout.close()
return "SAVED" return "SAVED"
@ -109,7 +109,7 @@ class SvxForm(forms.Form):
fin = open(settings.SURVEX_DATA + self.data['filename'] + ".log", "rb") fin = open(settings.SURVEX_DATA + self.data['filename'] + ".log", "rb")
log = fin.read() log = fin.read()
fin.close() fin.close()
log = re.sub("(?s).*?(Survey contains)", "\\1", log) log = re.sub(b"(?s).*?(Survey contains)", "\\1", log)
return log return log

View File

@ -49,9 +49,9 @@ $(document).ready(function()
<form id="codewikiform" action="" method="POST">{% csrf_token %} <form id="codewikiform" action="" method="POST">{% csrf_token %}
<div class="codeframebit">{{form.code}}</div> <div class="codeframebit">{{form.code}}</div>
<div style="display:none">{{form.filename}} {{form.dirname}} {{form.datetime}} {{form.outputtype}}</div> <div style="display:none">{{form.filename}} {{form.dirname}} {{form.datetime}} {{form.outputtype}}</div>
<input type="submit" name="diff" value="Diffy" /> <input type="submit" name="diff" value="Differences between edited and saved versions of this file" />
<input type="submit" name="save" value="Save"/> <input type="submit" name="save" value="Save this edited svx file"/>
<input type="submit" name="process" value="Process" title="executes cavern"/> <input type="submit" name="process" value="Run 'cavern' on this svx file" title="executes cavern"/>
</form> </form>
<div id="difflistajax"> <div id="difflistajax">