Skip to content

Commit d0d7f6b

Browse files
committed
GH-49: Update progress descriptions
1 parent bccfa67 commit d0d7f6b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/thumbnails/thumbnail.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, video, base, skip, output):
4747
self.metadata_path = self._get_metadata_path()
4848
self._perform_skip()
4949

50-
with Progress("Extracting frames", "Frames have been extracted"):
50+
with Progress("Extracting the frames by the given interval"):
5151
self.extract_frames()
5252

5353
def _get_metadata_path(self):
@@ -103,14 +103,15 @@ def prepare_frames(self):
103103
master = Image.new(mode="RGBA", size=next(thumbnails))
104104
master_path = os.path.join(self.thumbnail_dir, extract_name(self.filepath) + ".png")
105105

106-
with Progress("Processing frames", "Frames have been merged into one") as progress:
106+
with Progress("Preprocessing the frames before merging") as progress:
107107
for frame, *_, x, y in thumbnails:
108-
progress.update("Processing '%s'" % frame)
108+
offset = extract_name(frame).replace("-", ":").split(".")[0]
109+
progress.update("Processing [bold]%s[/bold] frame" % offset)
109110
with Image.open(frame) as image:
110111
image = image.resize((self.width, self.height), Image.ANTIALIAS)
111112
master.paste(image, (x, y))
112113

113-
progress.update("Saving the result '%s'" % master_path)
114+
with Progress("Saving the result at '%s'" % master_path):
114115
master.save(master_path)
115116

116117
def generate(self):
@@ -123,7 +124,7 @@ def format_time(secs):
123124
route = os.path.join(prefix, extract_name(self.filepath) + ".png")
124125
route = pathlib.Path(route).as_posix()
125126

126-
with Progress("Generating thumbnail metadata", "Thumbnail metadata has been generated") as progress:
127+
with Progress("Saving thumbnail metadata at '%s'" % self.metadata_path) as progress:
127128
for _, start, end, x, y in self.thumbnails():
128129
progress.update("Generating metadata for '%s'" % route)
129130
thumbnail_data = "%s --> %s\n%s#xywh=%d,%d,%d,%d\n\n" % (

src/thumbnails/video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, filepath, compress, interval):
4242
self.__frames_count = None
4343
self.__columns = None
4444

45-
with Progress("Parsing the video metadata ...", "Metadata has been parsed"):
45+
Remove useless `done_description` with Progress("Parsing metadata from the video"):
4646
_FFMpeg.__init__(self, filepath)
4747
_Frame.__init__(self, self.size)
4848

0 commit comments

Comments
 (0)