Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: SORRY! Bug in the code...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: SORRY! Bug in the code...
Authored by: fitzgunnar on Apr 06, '06 11:48:11PM
I just discovered that the regexp I suggested is bad. It matches anything and everything. Use this instead:

ATTACH_EXP_STR = r'\b(?:attachment|attachments|attach|attaching|attaches|attached)\b'

(And replace the english words with your own.)

Further, if you (like me) want to use words that include non-american letters (Ã¥, ä, ö, è, é etc) you need to escape these characters. In my case I had to write h=E4r instead of här

An easy way to find out how to escape the characters is to

  1. type them in a mail message
  2. save the message as a draft
  3. then save it again as a plain text file and select 'original source code' as text format.
  4. Then open the saved message in a text editor and see what the characters look like.

Regards,
MagnusG!

[ Reply to This | # ]

10.4: SORRY! Bug in the code... #2 + message warning customize
Authored by: shadownight on Apr 07, '06 01:35:43PM
Sorry, but the correction you posted is the same as the other one. The correct one I discovered is:
ATTACH_EXP_STR = r'\b(?:attachment|attachments|attach|attaching|attaches|attached|pi=E8ce jointe|pi=E8ces jointes|inclus|incluse)\b'
(the difference is the two backward slashes before the Bs) Thanks a lot for making me put this in my own language!! Note: as you can see above, pièce jointe is pi=E8ce jointe Note2: you can also customize the dialog box message as you want by scrolling down (about half-way) and changing this:
alert.setMessageText_('Message Has No Attachment')
        alert.setInformativeText_("Your mail appears to refer to an attachment, "
                                  "but none exists.  Do you wish to continue?")


[ Reply to This | # ]