comparison hgext/patchbomb.py @ 6963:71da881b259e

i18n: mark strings for translation in patchbomb extension
author Martin Geisler <mg@daimi.au.dk>
date Sun, 31 Aug 2008 16:12:03 +0200
parents 53465a7464e2
children 0ed11838bd1a
comparison
equal deleted inserted replaced
6962:2af657eafeba 6963:71da881b259e
396 if cc: 396 if cc:
397 m['Cc'] = ', '.join(cc) 397 m['Cc'] = ', '.join(cc)
398 if bcc: 398 if bcc:
399 m['Bcc'] = ', '.join(bcc) 399 m['Bcc'] = ', '.join(bcc)
400 if opts.get('test'): 400 if opts.get('test'):
401 ui.status('Displaying ', m['Subject'], ' ...\n') 401 ui.status(_('Displaying '), m['Subject'], ' ...\n')
402 ui.flush() 402 ui.flush()
403 if 'PAGER' in os.environ: 403 if 'PAGER' in os.environ:
404 fp = util.popen(os.environ['PAGER'], 'w') 404 fp = util.popen(os.environ['PAGER'], 'w')
405 else: 405 else:
406 fp = ui 406 fp = ui
412 if inst.errno != errno.EPIPE: 412 if inst.errno != errno.EPIPE:
413 raise 413 raise
414 if fp is not ui: 414 if fp is not ui:
415 fp.close() 415 fp.close()
416 elif opts.get('mbox'): 416 elif opts.get('mbox'):
417 ui.status('Writing ', m['Subject'], ' ...\n') 417 ui.status(_('Writing '), m['Subject'], ' ...\n')
418 fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+') 418 fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+')
419 generator = email.Generator.Generator(fp, mangle_from_=True) 419 generator = email.Generator.Generator(fp, mangle_from_=True)
420 date = util.datestr(start_time, '%a %b %d %H:%M:%S %Y') 420 date = util.datestr(start_time, '%a %b %d %H:%M:%S %Y')
421 fp.write('From %s %s\n' % (sender_addr, date)) 421 fp.write('From %s %s\n' % (sender_addr, date))
422 generator.flatten(m, 0) 422 generator.flatten(m, 0)
423 fp.write('\n\n') 423 fp.write('\n\n')
424 fp.close() 424 fp.close()
425 else: 425 else:
426 if not sendmail: 426 if not sendmail:
427 sendmail = mail.connect(ui) 427 sendmail = mail.connect(ui)
428 ui.status('Sending ', m['Subject'], ' ...\n') 428 ui.status(_('Sending '), m['Subject'], ' ...\n')
429 # Exim does not remove the Bcc field 429 # Exim does not remove the Bcc field
430 del m['Bcc'] 430 del m['Bcc']
431 fp = cStringIO.StringIO() 431 fp = cStringIO.StringIO()
432 generator = email.Generator.Generator(fp, mangle_from_=False) 432 generator = email.Generator.Generator(fp, mangle_from_=False)
433 generator.flatten(m, 0) 433 generator.flatten(m, 0)