Skip to content

Commit 146a9ef

Browse files
Add interactive test for notification email
1 parent cf7e66f commit 146a9ef

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Prerequisites before running this script in Fiji:
2+
#
3+
# Add the following lines to IJ_Prefs.txt:
4+
# Linux/Mac: ~/.imagej/IJ_Prefs.txt
5+
# Windows: C:\Users\<USERNAME>\.imagej\IJ_Prefs.txt
6+
#
7+
# .imcf.sender_email=imcf@unibas.ch
8+
# .imcf.smtpserver=smtp.unibas.ch
9+
#
10+
# Expected result: a mail is sent to nikolaus.ehrenfeuchter@unibas.ch from
11+
# imcf@unibas.ch, with Fiji printing "Successfully sent email to
12+
# <nikolaus.ehrenfeuchter@unibas.ch>".
13+
14+
from imcflibs.imagej.misc import send_notification_email
15+
16+
from imcflibs.log import LOG as log
17+
from imcflibs.log import enable_console_logging
18+
from imcflibs.log import set_loglevel
19+
20+
enable_console_logging()
21+
set_loglevel(2)
22+
23+
# see if logging works:
24+
log.warn("warn")
25+
log.debug("DEBUG")
26+
27+
send_notification_email(
28+
job_name="my job",
29+
recipient="nikolaus.ehrenfeuchter@unibas.ch",
30+
filename="magic-segmentation.py",
31+
total_execution_time="5 years",
32+
)
33+
34+
log.info("DONE")

0 commit comments

Comments
 (0)