diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-07-18 18:42:21 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-07-18 18:42:21 +0300 |
commit | 4efeefe6c9205f6c0678619307253f4b82d8a8c6 (patch) | |
tree | 264cc470d31e2d05543ea0b27ea4f5165533dd7e /core/views/survex.py | |
parent | 5b7c105c5fa663917076b9bdce02425ef505387e (diff) | |
download | troggle-4efeefe6c9205f6c0678619307253f4b82d8a8c6.tar.gz troggle-4efeefe6c9205f6c0678619307253f4b82d8a8c6.tar.bz2 troggle-4efeefe6c9205f6c0678619307253f4b82d8a8c6.zip |
git commit when editing survex files online
Diffstat (limited to 'core/views/survex.py')
-rw-r--r-- | core/views/survex.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/views/survex.py b/core/views/survex.py index caeaba6..c07ce2d 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -18,6 +18,7 @@ from troggle.core.models.troggle import Expedition, Person, PersonExpedition from troggle.core.models.survex import SurvexBlock, SurvexPersonRole, SurvexFile, SurvexDirectory from troggle.core.models.caves import Cave, PersonTrip, LogbookEntry from troggle.parsers.people import GetPersonExpeditionNameLookup +from troggle.core.utils import only_commit, WriteAndCommitError '''Everything that views survexfiles but also displays data on a cave or caves when there is ambiguity @@ -124,6 +125,7 @@ class SvxForm(forms.Form): svxtext = fin.read() fin.close() except: + # hack. Replace this with something better. fin = open(fname, "r",encoding='iso-8859-1',newline='') svxtext = fin.read() fin.close() @@ -163,9 +165,9 @@ class SvxForm(forms.Form): res = fout.write("\n") fout.close() - # INSERT code to do git add and commit here, to loser repo. When Wookey chnages :loser: to use git. + only_commit(fname, f"Online survex edit: {self.data['filename']}.svx") - return "SAVED" + return "SAVED and committed to git" def Process(self): print(">>>>....\n....Processing\n") |