- sendMIMEMail: better wording for some error messages during file conversion

git-svn-id: https://svn.ibp.de/svn/capisuite/trunk/capisuite@183 4ebea2bb-67d4-0310-8558-a5799e421b66
This commit is contained in:
gernot 2003-10-19 20:17:54 +00:00
parent 0404427ba1
commit ce322b0860
2 changed files with 10 additions and 4 deletions

View File

@ -21,4 +21,7 @@
* docs/manual.docbook (require_soft): updated link to jpeg2ps (thx to
Achim Bohnet)
* docs/manual-de.docbook (require_soft): see above
* scripts/cs_helpers.pyin (sendMIMEMail): better wording for some error
messages

View File

@ -2,7 +2,7 @@
# -----------------------------------------------------------
# copyright : (C) 2002 by Gernot Hillier
# email : gernot@hillier.de
# version : $Revision: 1.13 $
# version : $Revision: 1.14 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -165,7 +165,7 @@ def sendMIMEMail(mail_from,mail_to,mail_subject,mail_type,text,attachment):
# sff -> tif
ret=os.spawnlp(os.P_WAIT,"sfftobmp","sfftobmp","-tif",attachment,basename+"tif")
if (ret or not os.access(basename+"tif",os.F_OK)):
raise "conv-error","Can't convert sff to tif. sfftobmp not installed?"
raise "conv-error","Error while converting sff to tif. File damaged or sfftobmp not installed?"
# tif -> ps -> pdf
# the first pipe must be handled by the shell so that the output of
# of ps2pdf can be read immediately. Handling this shell in Python
@ -189,7 +189,7 @@ def sendMIMEMail(mail_from,mail_to,mail_subject,mail_type,text,attachment):
# cff -> ps
ret=os.spawnlp(os.P_WAIT,"jpeg2ps","jpeg2ps","-m",attachment,"-o",basename+"ps")
if (ret or not os.access(basename+"ps",os.F_OK)):
raise "conv-error","Can't convert cff to ps. jpeg2ps not installed?"
raise "conv-error","Can't convert cff to ps. File damaged or jpeg2ps not installed?"
# tif -> ps -> pdf
# the first pipe must be handled by the shell so that the output of
# of ps2pdf can be read immediately. Handling this shell in Python
@ -214,7 +214,7 @@ def sendMIMEMail(mail_from,mail_to,mail_subject,mail_type,text,attachment):
# don't use stdout as sox needs a file to be able to seek in it otherwise the header will be incomplete
ret = os.spawnlp(os.P_WAIT,"sox","sox",attachment,basename+"wav")
if (ret or not os.access(basename+"wav",os.R_OK)):
raise "conv-error","Error while calling sox. Not installed?"
raise "conv-error","Error while calling sox. File damaged or sox not installed?"
filepart = email.MIMEAudio.MIMEAudio(open(basename+"wav").read(),"x-wav",email.Encoders.encode_base64,name=os.path.basename(basename)+"wav")
filepart.add_header('Content-Disposition','attachment',filename=os.path.basename(basename)+"wav")
os.unlink(basename+"wav")
@ -341,6 +341,9 @@ def sayNumber(call,number,curr_user,config):
capisuite.audio_send(call,getAudio(config,curr_user,i+".la"),1)
# $Log: cs_helpers.pyin,v $
# Revision 1.14 2003/10/19 20:17:54 gernot
# - sendMIMEMail: better wording for some error messages during file conversion
#
# Revision 1.13 2003/07/21 17:44:07 gernot
# - forgot one import in last commit :-|
#