Rename method to avoid similar names

This commit is contained in:
Kristóf Tóth 2018-04-28 23:34:54 +02:00
parent d5bbe5139d
commit c1bfe294ce

4
cli.py
View File

@ -42,13 +42,13 @@ class Cli:
def calculate_ratings(self):
with Pool(processes=cpu_count()) as pool:
ratings = [(image, pool.apply_async(self.calculate_rating,
ratings = [(image, pool.apply_async(self.rate_image,
(image, self.args.method)))
for image in self.args.images]
self.image_ratings = {image: promise.get() for image, promise in ratings}
@staticmethod
def calculate_rating(image, method):
def rate_image(image, method):
return getattr(imgrate(image), method)
def print_ratings(self):