summaryrefslogtreecommitdiffstats
path: root/sorter.py
diff options
context:
space:
mode:
authorGravatar ryuslash2010-03-19 16:08:39 +0100
committerGravatar ryuslash2010-03-19 16:08:39 +0100
commit4b70374e9d6c041fda31d5b594f1f6605496ea92 (patch)
treeaa669241844cb05d5712a9085081d9af3dae29a7 /sorter.py
parent96247d41d50c53e7d3e1c5aa4c6a8dcba6d647f2 (diff)
download4grab-4b70374e9d6c041fda31d5b594f1f6605496ea92.tar.gz
4grab-4b70374e9d6c041fda31d5b594f1f6605496ea92.zip
FAIL and print
If source and dest in copy are the same, it is no longer reported If an image can't be read, it is counted as failed
Diffstat (limited to 'sorter.py')
-rw-r--r--sorter.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sorter.py b/sorter.py
index 482e343..c52ab9a 100644
--- a/sorter.py
+++ b/sorter.py
@@ -33,6 +33,7 @@ class Sorter:
def act(self, filename):
download_base = self.conf.get_download_location()
+ retval = True
if self.check_filename(filename):
image = None
@@ -40,8 +41,7 @@ class Sorter:
image = Image.open(os.path.join(download_base,
filename))
except IOError:
- print "Cannot read image file %s, might be broken" \
- % filename
+ retval = False
if not image == None and self.archive_check(filename):
for resolution in self.resolutions:
@@ -55,13 +55,13 @@ class Sorter:
str(image.size[1]) == resolution[1]:
if not os.path.exists(folderpath):
os.makedirs(folderpath)
- #print "creating", folderpath
self.copy(filename, folderpath)
break
self.archive(filename)
self.remove(filename)
+ return retval
def copy(self, filename, destpath):
download_base = self.conf.get_download_location()
@@ -73,7 +73,6 @@ class Sorter:
shutil.copy(source, dest)
else:
print "\nHow can this even happen?! Copying", source, "to", dest
- #print "\nParameters are", filename, "and", destpath
def archive(self, filename):
download_base = self.conf.get_download_location()