mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-07-04 15:37:58 +08:00
chore(deps): remove pkg_resources in favor to importlib (#153)
* feat(convert): PowerPoint conversion You can now convert your presentations to PowerPoint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * chore(convert): autoplay media * chore(deps): remove pkg_resources in favor to importlib This is what pkg_resources' team recommends * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(deps): if case for Python 3.8 (<3.9) * fix(convert): use correct pkg path * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(deps): remove duplicate deps * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(lib): add __init__.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,21 +1,23 @@
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import webbrowser
|
||||
from enum import Enum
|
||||
from importlib import resources
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, Generator, List, Optional, Type, Union
|
||||
|
||||
import click
|
||||
import cv2
|
||||
import pkg_resources
|
||||
import pptx
|
||||
from click import Context, Parameter
|
||||
from lxml import etree
|
||||
from pydantic import BaseModel, FilePath, PositiveInt, ValidationError
|
||||
from tqdm import tqdm
|
||||
|
||||
from . import data
|
||||
from .commons import folder_path_option, verbosity_option
|
||||
from .config import PresentationConfig
|
||||
from .logger import logger
|
||||
@ -328,9 +330,11 @@ class RevealJS(Converter):
|
||||
if isinstance(self.template, str):
|
||||
with open(self.template, "r") as f:
|
||||
return f.read()
|
||||
return pkg_resources.resource_string(
|
||||
__name__, "data/revealjs_template.html"
|
||||
).decode()
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
return resources.read_text(data, "revealjs_template.html")
|
||||
|
||||
return resources.files(data).joinpath("revealjs_template.html").read_text()
|
||||
|
||||
def open(self, file: Path) -> bool:
|
||||
return webbrowser.open(file.absolute().as_uri())
|
||||
|
0
manim_slides/data/__init__.py
Normal file
0
manim_slides/data/__init__.py
Normal file
Reference in New Issue
Block a user