From eaec9e7db4c15208fe274c61e6e4736b95ed5905 Mon Sep 17 00:00:00 2001 From: jgoerzen Date: Mon, 7 Oct 2002 22:11:19 +0100 Subject: [PATCH] /offlineimap/head: changeset 260 Updated -- the init changes now actually work. --- offlineimap/head/debian/changelog | 1 + offlineimap/head/offlineimap/init.py | 27 +++++++++++++++-------- offlineimap/head/offlineimap/localeval.py | 18 +++++++++++++++ 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/offlineimap/head/debian/changelog b/offlineimap/head/debian/changelog index 0d1b3dd..f644b98 100644 --- a/offlineimap/head/debian/changelog +++ b/offlineimap/head/debian/changelog @@ -15,6 +15,7 @@ offlineimap (3.99.0) unstable; urgency=low offlineimap/init.py. * Moved __main__.ui to functions in UIBase: getglobalui() and setglobalui(). + * Added license comments to some source files that were missing them. -- John Goerzen Mon, 30 Sep 2002 12:08:08 -0500 diff --git a/offlineimap/head/offlineimap/init.py b/offlineimap/head/offlineimap/init.py index 8fa505a..c910555 100644 --- a/offlineimap/head/offlineimap/init.py +++ b/offlineimap/head/offlineimap/init.py @@ -67,7 +67,6 @@ def startup(revno): ui = offlineimap.ui.detector.findUI(config, localeval, options.get('-u')) ui.init_banner() UIBase.setglobalui(ui) - print "UI is", UIBase.getglobalui() if '-d' in options: for debugtype in options['-d'].split(','): @@ -104,7 +103,6 @@ def startup(revno): # asking for passwords simultaneously. for account in accounts: - print "Processing account", account #if '.' in account: # raise ValueError, "Account '%s' contains a dot; dots are not " \ # "allowed in account names." % account @@ -130,7 +128,13 @@ def startup(revno): threadutil.initexitnotify() t = ExitNotifyThread(target=sync_with_timer, - name='Sync Runner') + name='Sync Runner', + kwargs = {'accounts': accounts, + 'metadatadir': metadatadir, + 'servers': servers, + 'config': config, + 'passwords': passwords, + 'localeval': localeval}) t.setDaemon(1) t.start() try: @@ -140,7 +144,8 @@ def startup(revno): except: ui.mainException() # Also expected to terminate. -def syncaccount(accountname, *args): +def syncaccount(accountname, metadatadir, servers, config, passwords, + localeval, *args): ui = UIBase.getglobalui() # We don't need an account lock because syncitall() goes through # each account once, then waits for all to finish. @@ -263,7 +268,7 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos, -def syncitall(): +def syncitall(accounts, metadatadir, servers, config, passwords, localeval): ui = UIBase.getglobalui() global mailboxes mailboxes = [] # Reset. @@ -272,7 +277,9 @@ def syncitall(): thread = InstanceLimitedThread(instancename = 'ACCOUNTLIMIT', target = syncaccount, name = "Account sync %s" % accountname, - args = (accountname,)) + args = (accountname, metadatadir, + servers, config, passwords, + localeval)) thread.setDaemon(1) thread.start() threads.append(thread) @@ -280,10 +287,11 @@ def syncitall(): threadutil.threadsreset(threads) mbnames.genmbnames(config, localeval, mailboxes) -def sync_with_timer(): +def sync_with_timer(accounts, metadatadir, servers, config, passwords, + localeval): ui = UIBase.getglobalui() currentThread().setExitMessage('SYNC_WITH_TIMER_TERMINATE') - syncitall() + syncitall(accounts, metadatadir, servers, config, passwords, localeval) if config.has_option('general', 'autorefresh'): refreshperiod = config.getint('general', 'autorefresh') * 60 while 1: @@ -313,7 +321,8 @@ def sync_with_timer(): event.set() for thread in kathreads.values(): thread.join() - syncitall() + syncitall(accounts, metadatadir, servers, config, passwords, + localeval) def threadexited(thread): ui = UIBase.getglobalui() diff --git a/offlineimap/head/offlineimap/localeval.py b/offlineimap/head/offlineimap/localeval.py index 6556073..c45214d 100644 --- a/offlineimap/head/offlineimap/localeval.py +++ b/offlineimap/head/offlineimap/localeval.py @@ -1,4 +1,22 @@ """Eval python code with global namespace of a python source file.""" + +# Copyright (C) 2002 John Goerzen +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + import imp, errno class LocalEval: