[Spambayes-checkins] spambayes/Outlook2000 manager.py,1.53,1.54
Tim Peters
tim_one at users.sourceforge.net
Sat Mar 8 16:54:07 EST 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv17649
Modified Files:
manager.py
Log Message:
SF bug: 700165: MoveFileEx doesn't exist on Win98
_MigrateFile(): MoveFileEx doesn't exist at or before Win98, so don't
use it.
Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** manager.py 4 Mar 2003 10:42:23 -0000 1.53
--- manager.py 9 Mar 2003 00:54:04 -0000 1.54
***************
*** 204,217 ****
self._MigrateFile("default_configuration.pck")
def _MigrateFile(self, filename, do_move = True):
src = os.path.join(self.application_directory, filename)
dest = os.path.join(self.data_directory, filename)
if os.path.isfile(src) and not os.path.isfile(dest):
if do_move:
! # shutil in 2.2 and earlier does not contain 'move'
! win32api.MoveFileEx(src, dest,
! win32con.MOVEFILE_COPY_ALLOWED)
! else:
! shutil.copyfile(src, dest)
def FormatFolderNames(self, folder_ids, include_sub):
--- 204,219 ----
self._MigrateFile("default_configuration.pck")
+ # Copy a file from the application_directory to the data_directory.
+ # By default (do_move not specified), the source file is deleted.
+ # Pass do_move=False to leave the original file.
def _MigrateFile(self, filename, do_move = True):
src = os.path.join(self.application_directory, filename)
dest = os.path.join(self.data_directory, filename)
if os.path.isfile(src) and not os.path.isfile(dest):
+ # shutil in 2.2 and earlier don't contain 'move'.
+ # Win95 and Win98 don't support MoveFileEx.
+ shutil.copyfile(src, dest)
if do_move:
! os.remove(src)
def FormatFolderNames(self, folder_ids, include_sub):
More information about the Spambayes-checkins
mailing list