Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning during batch processing #87

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sphinxcontrib/plantuml.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive

from sphinx import util
import sphinx
from sphinx.errors import SphinxError
from sphinx.util import (
i18n,
Expand Down Expand Up @@ -327,11 +327,17 @@ def collect_nodes(self, doctree):
self._pending_keys.append(key)

def render_batches(self):
if sphinx.version_info[:2] >= (6, 1):
from sphinx.util.display import progress_message
else:
from sphinx.util import progress_message

pending_keys = sorted(self._pending_keys)
for fileformat in self.image_formats:
for i in range(0, len(pending_keys), self.batch_size):
keys = pending_keys[i : i + self.batch_size]
with util.progress_message(

with progress_message(
'rendering plantuml diagrams [%d..%d/%d]'
% (i, i + len(keys), len(pending_keys))
):
Expand Down
Loading