mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-11 13:04:34 +01:00
...
This commit is contained in:
parent
0b24aeb77f
commit
36bae4bc7b
2 changed files with 9 additions and 2 deletions
|
|
@ -73,6 +73,11 @@ def __init__(self, job_manager):
|
|||
self.jobs = Queue()
|
||||
self.job_manager = job_manager
|
||||
self._run = True
|
||||
self.calculate_rate_limit()
|
||||
|
||||
self.last_send_time = time.time() - self.rate_limit
|
||||
|
||||
def calculate_rate_limit(self):
|
||||
self.rate_limit = 1
|
||||
opts = email_config().parse()
|
||||
rh = opts.relay_host
|
||||
|
|
@ -80,8 +85,6 @@ def __init__(self, job_manager):
|
|||
'gmail.com' in rh or 'live.com' in rh):
|
||||
self.rate_limit = 301
|
||||
|
||||
self.last_send_time = time.time() - self.rate_limit
|
||||
|
||||
def stop(self):
|
||||
self._run = False
|
||||
self.jobs.put(None)
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ def commit(self):
|
|||
if not self.send_email_widget.set_email_settings(to_set):
|
||||
raise AbortCommit('abort')
|
||||
self.proxy['accounts'] = self._email_accounts.accounts
|
||||
|
||||
return ConfigWidgetBase.commit(self)
|
||||
|
||||
def make_default(self, *args):
|
||||
|
|
@ -188,6 +189,9 @@ def remove_email_account(self, *args):
|
|||
self._email_accounts.remove(idx)
|
||||
self.changed_signal.emit()
|
||||
|
||||
def refresh_gui(self, gui):
|
||||
gui.emailer.calculate_rate_limit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.Qt import QApplication
|
||||
|
|
|
|||
Loading…
Reference in a new issue