Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dc7b4f2

Browse filesBrowse files
authored
Merge pull request #24482 from QuLogic/html-relative-frames
Use relative frame path in HTMLWriter
2 parents b9f2adf + c19fdc3 commit dc7b4f2
Copy full SHA for dc7b4f2

File tree

1 file changed

+9
-8
lines changed
Filter options

1 file changed

+9
-8
lines changed

‎lib/matplotlib/animation.py

Copy file name to clipboardExpand all lines: lib/matplotlib/animation.py
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,9 @@ class ImageMagickFileWriter(ImageMagickBase, FileMovieWriter):
686686

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

695694

@@ -783,11 +782,13 @@ def finish(self):
783782
if self.embed_frames:
784783
fill_frames = _embedded_frames(self._saved_frames,
785784
self.frame_format)
786-
Nframes = len(self._saved_frames)
785+
frame_count = len(self._saved_frames)
787786
else:
788787
# temp names is filled by FileMovieWriter
789-
fill_frames = _included_frames(self._temp_paths, self.frame_format)
790-
Nframes = len(self._temp_paths)
788+
frame_count = len(self._temp_paths)
789+
fill_frames = _included_frames(
790+
frame_count, self.frame_format,
791+
self._temp_paths[0].parent.relative_to(self.outfile.parent))
791792
mode_dict = dict(once_checked='',
792793
loop_checked='',
793794
reflect_checked='')
@@ -798,7 +799,7 @@ def finish(self):
798799
with open(self.outfile, 'w') as of:
799800
of.write(JS_INCLUDE + STYLE_INCLUDE)
800801
of.write(DISPLAY_TEMPLATE.format(id=uuid.uuid4().hex,
801-
Nframes=Nframes,
802+
Nframes=frame_count,
802803
fill_frames=fill_frames,
803804
interval=interval,
804805
**mode_dict))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.