Indents (-:

This commit is contained in:
Joachim Tingvold 2014-03-16 15:19:52 +01:00
parent dee0ab294f
commit a7192297df

View File

@ -232,9 +232,8 @@ class Photo(object):
_metadata.scene_capture_type_list = ["Standard", "Landscape", "Portrait", "Night scene"] _metadata.scene_capture_type_list = ["Standard", "Landscape", "Portrait", "Night scene"]
_metadata.subject_distance_range_list = ["Unknown", "Macro", "Close view", "Distant view"] _metadata.subject_distance_range_list = ["Unknown", "Macro", "Close view", "Distant view"]
def _thumbnail(self, image, thumb_path, original_path, size, square=False): def _thumbnail(self, original_path, thumb_path, size, square=False):
def _thumbnail(self, original_path, thumb_path, size, square=False): try:
try:
image = Image.open(original_path) image = Image.open(original_path)
except KeyboardInterrupt: except KeyboardInterrupt:
raise raise
@ -264,7 +263,7 @@ class Photo(object):
elif self._orientation == 8: elif self._orientation == 8:
# Rotation 90 # Rotation 90
mirror = image.transpose(Image.ROTATE_90) mirror = image.transpose(Image.ROTATE_90)
image = mirror image = mirror
thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square)) thumb_path = os.path.join(thumb_path, image_cache(self._path, size, square))
info_string = "%s -> %spx" % (os.path.basename(original_path), str(size)) info_string = "%s -> %spx" % (os.path.basename(original_path), str(size))
@ -309,14 +308,14 @@ class Photo(object):
message("save failure", os.path.basename(thumb_path)) message("save failure", os.path.basename(thumb_path))
os.unlink(thumb_path) os.unlink(thumb_path)
def _thumbnails(self, original_path, thumb_path): def _thumbnails(self, original_path, thumb_path):
# get number of cores on the system, and use all minus one # get number of cores on the system, and use all minus one
num_of_cores = os.sysconf('SC_NPROCESSORS_ONLN') - 1 num_of_cores = os.sysconf('SC_NPROCESSORS_ONLN') - 1
pool = Pool(processes=num_of_cores) pool = Pool(processes=num_of_cores)
for size in Photo.thumb_sizes: for size in Photo.thumb_sizes:
pool.apply_async(make_thumbs, args = (self, original_path, thumb_path, size)) pool.apply_async(make_thumbs, args = (self, original_path, thumb_path, size))
pool.close() pool.close()
pool.join() pool.join()
@property @property
def name(self): def name(self):