comparison contrib/patchbomb @ 1154:c3cb9f39a91f

patchbomb: fix up confusion between strings and lists of strings.
author bos@serpentine.internal.keyresearch.com
date Mon, 29 Aug 2005 12:15:37 -0700
parents d451888505d7
children b0f6053df539
comparison
equal deleted inserted replaced
1153:fa9ae7df88a9 1154:c3cb9f39a91f
170 msg = MIMEMultipart() 170 msg = MIMEMultipart()
171 msg['Subject'] = '[PATCH 0 of %d] %s' % ( 171 msg['Subject'] = '[PATCH 0 of %d] %s' % (
172 len(patches), 172 len(patches),
173 opts['subject'] or 173 opts['subject'] or
174 prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches))) 174 prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches)))
175 to = opts['to'] or ui.config('patchbomb', 'to') or prompt('To') 175
176 to = [t.strip() for t in to.split(',')] 176 def getaddrs(opt, prpt, default = None):
177 cc = (opts['cc'] or ui.config('patchbomb', 'cc') or 177 addrs = opts[opt] or (ui.config('patchbomb', opt) or
178 prompt('Cc', default = '')) 178 prompt(prpt, default = default)).split(',')
179 cc = (cc and [c.strip() for c in cc.split(',')]) or [] 179 return [a.strip() for a in addrs if a.strip()]
180 to = getaddrs('to', 'To')
181 cc = getaddrs('cc', 'Cc', '')
180 182
181 ui.write('Finish with ^D or a dot on a line by itself.\n\n') 183 ui.write('Finish with ^D or a dot on a line by itself.\n\n')
182 184
183 body = [] 185 body = []
184 186