Skip to content

Commit

Permalink
Fix print messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lguerard committed Mar 2, 2023
1 parent 93287f0 commit 240f0bf
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ def get_ome_metadata(source, imagenames):
z_interval = physSizeZ.value()

if frame_size_z > 1 and physSizeZ is None:
print "no z calibration found, trying to recover"
print("no z calibration found, trying to recover")
first_plane = omeMeta.getPlanePositionZ(0, 0)
next_plane_imagenumber = frame_size_c + frame_size_t - 1
second_plane = omeMeta.getPlanePositionZ(0, next_plane_imagenumber)
z_interval = abs(abs(first_plane.value()) - abs(second_plane.value()))
print "z-interval seems to be: ", z_interval
print("z-interval seems to be: " + str(z_interval))

# create an image calibration
image_calibration = [physSizeX.value(), physSizeY.value(), z_interval]
Expand All @@ -213,7 +213,7 @@ def get_ome_metadata(source, imagenames):
pos_y = current_position_y.value()

if current_position_z is None:
print "the z-position is missing in the ome-xml metadata."
print("the z-position is missing in the ome-xml metadata.")
pos_z = 1.0
else:
pos_z = current_position_z.value()
Expand Down Expand Up @@ -356,7 +356,7 @@ def save_current_image_as_tiff(filename, filetype, target):
savename = filename.replace(filetype, "_stitched.tif")
savepath = target + savename
IJ.log("now saving: " + str(savepath))
print "now saving", savepath
print("now saving " + savepath)
IJ.saveAs(imp, "Tiff", savepath)
imp.close()

Expand Down Expand Up @@ -385,7 +385,7 @@ def save_current_image_as_bdv(filename, filetype, target):
savename = filename.replace(filetype, "_stitched.xml")
savepath = target + savename
IJ.log("now saving: " + str(savepath))
print "now saving", savepath
print("now saving " + savepath)
IJ.run("Export Current Image as XML/HDF5", " use_deflate_compression export_path=["+savepath+"]")
imp.close()

Expand Down Expand Up @@ -414,7 +414,7 @@ def save_current_image_as_ics1(filename, filetype, target):
savename = filename.replace(filetype, "_stitched.ics")
savepath = target + savename
IJ.log("now saving: " + str(savepath))
print "now saving", savepath
print("now saving " + savepath)
io.save(img, savepath)
IJ.run("Close")

Expand Down Expand Up @@ -443,7 +443,7 @@ def save_current_image_with_BF_as_ics1(filename, filetype, target):
savename = filename.replace(filetype, "_stitched.ids")
savepath = os.path.join(target, savename)
IJ.log("now saving: " + str(savepath))
print "now saving", savepath
print("now saving " + savepath)
IJ.run(imp, "Bio-Formats Exporter", "save=[" + savepath + "]")
imp.close()

Expand Down Expand Up @@ -613,9 +613,9 @@ def send_mail( sender, recipient, filename, total_execution_time_min ):
try:
smtpObj = smtplib.SMTP("smtp.unibas.ch")
smtpObj.sendmail( sender, recipient, message % ( recipient, filename, total_execution_time_min ) )
print "Successfully sent email"
print("Successfully sent email")
except smtplib.SMTPException:
print "Error: unable to send email"
print("Error: unable to send email")

def sorted_alphanumeric(data):
"""Sort a list alphanumerically
Expand Down Expand Up @@ -727,7 +727,7 @@ def elapsed_time_since(start,end=None):
if email_address != "":
send_mail( "[email protected]", email_address, source, total_execution_time_min )
else:
print "Email address field is empty, no email was sent"
print("Email address field is empty, no email was sent")


# update the log
Expand Down

0 comments on commit 240f0bf

Please sign in to comment.