mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-03-23 06:38:01 +00:00
stop print msg
This commit is contained in:
@@ -64,8 +64,8 @@ def get_survexfile(filename):
|
||||
else:
|
||||
survexfile = refs[0]
|
||||
# OK this is due to a bug in the import file parsing, whoops. Now fixed ?!
|
||||
print("BUG - to be fixed in the survex parser - not critical..")
|
||||
print(f"Number of SurvexFile objects found: {len(refs)}")
|
||||
# print"BUG - to be fixed in the survex parser - not critical..")
|
||||
# printf"Number of SurvexFile objects found: {len(refs)}")
|
||||
for s in refs:
|
||||
print (s.path, s.primary, s.cave)
|
||||
# print(type(survexfile), filename)
|
||||
@@ -104,7 +104,7 @@ class SvxForm(forms.Form):
|
||||
def GetDiscCode(self):
|
||||
fname = SVXPATH / (self.data["filename"] + ".svx")
|
||||
if not fname.is_file():
|
||||
print(">>> >>> WARNING - svx file not found, showing TEMPLATE SVX", fname, flush=True)
|
||||
# print">>> >>> WARNING - svx file not found, showing TEMPLATE SVX", fname, flush=True)
|
||||
self.template = True
|
||||
self.survexfile = False
|
||||
with open(templatepath,"r") as tf:
|
||||
@@ -114,7 +114,7 @@ class SvxForm(forms.Form):
|
||||
if sf := get_survexfile(self.data["filename"]): # walrus!
|
||||
self.survexfile = sf
|
||||
else:
|
||||
print(">>> >>> WARNING - svx file not a SurvexFile object yet", fname, flush=True)
|
||||
# print">>> >>> WARNING - svx file not a SurvexFile object yet", fname, flush=True)
|
||||
self.survexfile = fname
|
||||
|
||||
try:
|
||||
@@ -179,7 +179,7 @@ class SvxForm(forms.Form):
|
||||
def Process(self):
|
||||
message =""
|
||||
|
||||
print(">>>>....\n....Processing\n")
|
||||
# print">>>>....\n....Processing\n")
|
||||
froox = SVXPATH / f"{self.data['filename']}.svx"
|
||||
froog = SVXPATH / f"{self.data['filename']}.log"
|
||||
frooerr = SVXPATH / f"{self.data["filename"]}.err"
|
||||
@@ -199,8 +199,8 @@ class SvxForm(forms.Form):
|
||||
if sp.returncode != 0:
|
||||
message = f' ! Error running {settings.CAVERN}: {froox}'
|
||||
DataIssue.objects.create(parser='survex', message=message)
|
||||
print(message)
|
||||
print(f"sp = subprocess.run([{settings.CAVERN} --log {froox}], cwd={froogdir}"
|
||||
# print(message)
|
||||
# print(f"sp = subprocess.run([{settings.CAVERN} --log {froox}], cwd={froogdir}"
|
||||
f"\n\nstderr:\n\n{str(sp.stderr)}\n\nstdout:{str(sp.stdout)}\n\nreturn code: {str(sp.returncode)}")
|
||||
|
||||
os.chdir(cwd) # Restore working directory
|
||||
@@ -297,7 +297,7 @@ def svx(request, survex_file):
|
||||
if "save" in rform.data:
|
||||
if request.user.is_authenticated:
|
||||
if difflist:
|
||||
print(f"Saving code and editor id {editor=}")
|
||||
# print(f"Saving code and editor id {editor=}")
|
||||
message = form.SaveCode(rcode, editor) # saves file and does git thing
|
||||
else:
|
||||
message = "NO DIFFERENCES - so not saving the file"
|
||||
@@ -307,7 +307,7 @@ def svx(request, survex_file):
|
||||
form.data["code"] = rcode
|
||||
|
||||
if "diff" in rform.data:
|
||||
print("Differences: ")
|
||||
# print("Differences: ")
|
||||
form.data["code"] = rcode
|
||||
|
||||
# GET, also fall-through after POST-specific handling
|
||||
@@ -386,7 +386,7 @@ def svx(request, survex_file):
|
||||
edit_response = render(request, "svxfile.html", vmap)
|
||||
|
||||
edit_response.set_cookie('editor_id', editor, max_age=get_cookie_max_age(request)) # cookie expires after get_cookie_max_age(request) seconds
|
||||
print(f"Cookie reset: {editor} for another {get_cookie_max_age(request)/3600} hour(s)")
|
||||
# print(f"Cookie reset: {editor} for another {get_cookie_max_age(request)/3600} hour(s)")
|
||||
|
||||
return edit_response
|
||||
|
||||
@@ -616,7 +616,8 @@ def survexcaveslist(request):
|
||||
if survdirobj:
|
||||
subdircaves.append((cavedir, (survdirobj[0], survdirobj[1:]), subsurvdirs))
|
||||
else:
|
||||
print(f" ! Subdirectory containing empty subdirectory {subdirs} in {gcavedir}")
|
||||
pass
|
||||
# print(f" ! Subdirectory containing empty subdirectory {subdirs} in {gcavedir}")
|
||||
|
||||
# multifile caves
|
||||
elif len(survdirobj) > 1:
|
||||
@@ -692,7 +693,7 @@ def survex_by_cave_id(request, svx_filepath):
|
||||
else:
|
||||
# A decision needs to be made: is this a silly thing or is it a real file?
|
||||
filepath = settings.SURVEX_DATA / svx_filepath
|
||||
print(f" - {filepath=}\n - {svx_filepath=}")
|
||||
# print(f" - {filepath=}\n - {svx_filepath=}")
|
||||
if filepath.is_file():
|
||||
# survex file not a cave, e.g. surface/1623/allsurface.svx
|
||||
return svx(request, svx_filepath)
|
||||
|
||||
Reference in New Issue
Block a user