Ticket #13: spelling.patch
| File spelling.patch, 5.4 kB (added by fs, 1 year ago) |
|---|
-
turbomail/pool.py
15 15 16 16 17 17 class Pool(Thread): 18 """A thread pool which checks regularily for new jobs and spawns processes18 """A thread pool which checks regularly for new jobs and spawns processes 19 19 as needed. 20 20 21 21 Do not use this class directly. Always subclass and override the worker … … 23 23 """ 24 24 25 25 def __init__(self, interval=10, threads=4, jobs=10, timeout=60, polling=False, **kw): 26 """Initialize the thread pool.26 """Initialize the thread pool. 27 27 28 28 @param interval: A delay, in seconds, between spawn runs. 29 29 @type interval: int … … 71 71 72 72 @param block: Block code execution until there is a free slot in 73 73 the queue. If I{block} is True and I{timeout} is 74 None, block indefin ately.74 None, block indefinitely. 75 75 @type block: bool 76 76 77 77 @param timeout: How long to block execution (in seconds). If … … 146 146 147 147 def worker(self): 148 148 """This method must be overridden in a subclass and is used to 149 perform the work of the thread pool.149 perform the work of the thread pool. 150 150 151 151 Will raise a NotImplementedError exception if not subclassed.""" 152 152 … … 154 154 155 155 156 156 class MailPool(Pool): 157 """Mail delivery thread pool.157 """Mail delivery thread pool. 158 158 159 159 This class delivers messages from a queue using the Dispatch class. 160 160 -
turbomail/__init__.py
22 22 23 23 Throughput using the default options is sufficient for most use: 24 24 100 messages in 45 seconds; just over 2 messages a second. Using 25 a greater number of threads, 10 vs. 4, 100 messag s take 3025 a greater number of threads, 10 vs. 4, 100 messages take 30 26 26 seconds; just over 3 messages a second. YMMV. Note that if a 27 27 thread is idle, it will immediately deliver requests added to 28 28 the queue, thus increasing the idle time will increase sparse … … 81 81 thread. 82 82 - I{mail.timeout} (Default: B{60}) Maximum time a worker thread 83 83 will wait for additional jobs, in seconds. 84 - I{mail.tls} (Defa lut: None) Enable or disable TLS, None will84 - I{mail.tls} (Default: None) Enable or disable TLS, None will 85 85 attempt to auto-detect TLS. This will not always work. 86 86 - I{mail.encoding} (Default: B{'us-ascii'}) Set the character 87 87 set and encoding on the MIMEText parts of the message. … … 94 94 by TurboMail, and will override the global defaults: 95 95 - utf-8-qp - I{Sets utf-8 to use quoted-printable encoding.} 96 96 Headers are not encoded. DIY. 97 - I{mail.polling} (Defau t: B{False}) If enabled, configures the97 - I{mail.polling} (Default: B{False}) If enabled, configures the 98 98 thread pool to poll every I{mail.interval} seconds for new 99 99 jobs. This may give performance benefits to the running 100 100 application. The default behaviour is to create new threads … … 137 137 ======================== 138 138 139 139 Additionally, you can configure your application to log TurboMail 140 events differently, in a more loggable and machine pars able way.140 events differently, in a more loggable and machine parseable way. 141 141 You do so by adding the following lines to the formatters section 142 142 of your log.cfg:: 143 143 -
turbomail/dispatch.py
45 45 I{Optional.} 46 46 @type username: string 47 47 48 @param password: The password to use during authent action.48 @param password: The password to use during authentication. 49 49 I{Optional.} 50 50 @type password: string 51 51 … … 77 77 """Connect to the SMTP server if not already connected. 78 78 79 79 This process also automatically enables TLS, if available, and 80 authenticates against the username and password previous ally80 authenticates against the username and password previously 81 81 provided. 82 82 """ 83 83 … … 118 118 connect, if needed, and will also automatically disconnect if 119 119 debug mode has been enabled. 120 120 121 @param message: This param ater must be a callable which returns121 @param message: This parameter must be a callable which returns 122 122 a tuple of (from, to, message), where all three 123 123 are strings, and message is valid content for an 124 124 e-mail message. -
turbomail/message.py
221 221 def _process(self): 222 222 """Produce the final MIME message. 223 223 224 Additi noally, if only a rich text part exits, strip the HTML to224 Additionally, if only a rich text part exits, strip the HTML to 225 225 produce the plain text part. (This produces identical output as 226 226 KID, although lacks reverse entity conversion -- &, etc.) 227 227 """ … … 388 388 """ 389 389 390 390 def __init__(self, sender, recipient, subject, template, variables={}, **kw): 391 """Store the addit onal template and variable information.391 """Store the additional template and variable information. 392 392 393 393 @param template: A dot-path to a valid KID template. 394 394 @type template: string
