mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 13:57:45 +00:00
Reducing input print output
This commit is contained in:
@@ -52,7 +52,7 @@ def parseCaveQMs(cave,inputFile):
|
|||||||
elif cave=='hauch':
|
elif cave=='hauch':
|
||||||
placeholder, hadToCreate = LogbookEntry.objects.get_or_create(date__year=year, title="placeholder for QMs in 234", text="QMs temporarily attached to this should be re-attached to their actual trips", defaults={"date": date(year, 1, 1),"cave":hauchHl})
|
placeholder, hadToCreate = LogbookEntry.objects.get_or_create(date__year=year, title="placeholder for QMs in 234", text="QMs temporarily attached to this should be re-attached to their actual trips", defaults={"date": date(year, 1, 1),"cave":hauchHl})
|
||||||
if hadToCreate:
|
if hadToCreate:
|
||||||
print((cave + " placeholder logbook entry for " + str(year) + " added to database"))
|
print((" - placeholder logbook entry for " + cave + " " + str(year) + " added to database"))
|
||||||
QMnum=re.match(r".*?-\d*?-X?(?P<numb>\d*)",line[0]).group("numb")
|
QMnum=re.match(r".*?-\d*?-X?(?P<numb>\d*)",line[0]).group("numb")
|
||||||
newQM = QM()
|
newQM = QM()
|
||||||
newQM.found_by=placeholder
|
newQM.found_by=placeholder
|
||||||
@@ -75,9 +75,9 @@ def parseCaveQMs(cave,inputFile):
|
|||||||
if preexistingQM.new_since_parsing==False: #if the pre-existing QM has not been modified, overwrite it
|
if preexistingQM.new_since_parsing==False: #if the pre-existing QM has not been modified, overwrite it
|
||||||
preexistingQM.delete()
|
preexistingQM.delete()
|
||||||
newQM.save()
|
newQM.save()
|
||||||
print(("overwriting " + str(preexistingQM) +"\r"))
|
#print((" - overwriting " + str(preexistingQM) +"\r"))
|
||||||
else: # otherwise, print that it was ignored
|
else: # otherwise, print that it was ignored
|
||||||
print(("preserving " + str(preexistingQM) + ", which was edited in admin \r"))
|
print((" - preserving " + str(preexistingQM) + ", which was edited in admin \r"))
|
||||||
|
|
||||||
except QM.DoesNotExist: #if there is no pre-existing QM, save the new one
|
except QM.DoesNotExist: #if there is no pre-existing QM, save the new one
|
||||||
newQM.save()
|
newQM.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user