From 72c27d98c62a794f4582a23c9d39f3da67868b25 Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Tue, 27 Nov 2012 19:37:04 +0000 Subject: [PATCH] Added check of comic archive's home folder's write permission git-svn-id: http://comictagger.googlecode.com/svn/trunk@100 6c5673fe-1810-88d6-992b-cd32ca31540c --- comicarchive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/comicarchive.py b/comicarchive.py index 16b5389..1b146bf 100644 --- a/comicarchive.py +++ b/comicarchive.py @@ -390,7 +390,7 @@ class ComicArchive: def isFolder( self ): return self.archive_type == self.ArchiveType.Folder - def isWritable( self ): + def isWritable( self ): if self.archive_type == self.ArchiveType.Unknown : return False @@ -399,6 +399,10 @@ class ComicArchive: elif not os.access(self.path, os.W_OK): return False + + elif ((self.archive_type != self.ArchiveType.Folder) and + (not os.access( os.path.dirname( os.path.abspath(self.path)), os.W_OK ))): + return False return True