FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backport PR #24482 on branch v3.6.x (Use relative frame path in HTMLWriter) by meeseeksmachine · Pull Request #24505 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
17 changes: 9 additions & 8 deletions lib/matplotlib/animation.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,9 @@ class ImageMagickFileWriter(ImageMagickBase, FileMovieWriter):

# Taken directly from jakevdp's JSAnimation package at
# http://github.com/jakevdp/JSAnimation
def _included_frames(paths, frame_format):
"""paths should be a list of Paths"""
return INCLUDED_FRAMES.format(Nframes=len(paths),
frame_dir=paths[0].parent,
def _included_frames(frame_count, frame_format, frame_dir):
return INCLUDED_FRAMES.format(Nframes=frame_count,
frame_dir=frame_dir,
frame_format=frame_format)


Expand Down Expand Up @@ -783,11 +782,13 @@ def finish(self):
if self.embed_frames:
fill_frames = _embedded_frames(self._saved_frames,
self.frame_format)
Nframes = len(self._saved_frames)
frame_count = len(self._saved_frames)
else:
# temp names is filled by FileMovieWriter
fill_frames = _included_frames(self._temp_paths, self.frame_format)
Nframes = len(self._temp_paths)
frame_count = len(self._temp_paths)
fill_frames = _included_frames(
frame_count, self.frame_format,
self._temp_paths[0].parent.relative_to(self.outfile.parent))
mode_dict = dict(once_checked='',
loop_checked='',
reflect_checked='')
Expand All @@ -798,7 +799,7 @@ def finish(self):
with open(self.outfile, 'w') as of:
of.write(JS_INCLUDE + STYLE_INCLUDE)
of.write(DISPLAY_TEMPLATE.format(id=uuid.uuid4().hex,
Nframes=Nframes,
Nframes=frame_count,
fill_frames=fill_frames,
interval=interval,
**mode_dict))
Expand Down

Back | FazBrowse Home | New Git URL