Skip to content

Commit

Permalink
refactor: compatible with Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaokang2022 committed Sep 16, 2024
1 parent 14ce0c0 commit bb8fc93
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,21 @@ Changelog / 更新日志
> * 🟠 **Deprecated / 弃用**
> * 🟤 **Refactored / 重构**
🔖 `1.0.4`
-----------

🕓 *Release Date / 发布日期 : 2024-09-16*

🟤 **Refactored / 重构**

- Modified the syntax of some of the code to be compatible with Python 3.10
修改部分代码的语法,以兼容 Python 3.10

🔖 `1.0.3`
-----------

🕓 *Release Date / 发布日期 : 2024-09-16*

🟢 **Added / 新增**

- Added a left-click function to pause
Expand Down Expand Up @@ -45,6 +57,8 @@ Changelog / 更新日志
🔖 `1.0.2`
-----------

🕓 *Release Date / 发布日期 : 2024-09-16*

🟢 **Added / 新增**

- The `VideoCanvas` class adds the initialization parameter `control` to enable the built-in UI
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = ["tkintertools==3.0.0rc2", "pillow>=10.0.0", "ffpyplayer>=4.5.0"]
dependencies = ["tkintertools>=3.0.0rc2", "pillow>=10.0.0", "ffpyplayer>=4.5.0"]
dynamic = ["version"]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion tkintertools/media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@

from .main import *

__version__ = "1.0.3"
__version__ = "1.0.4"
__author__ = "Xiaokang2022 <2951256653@qq.com>"
10 changes: 5 additions & 5 deletions tkintertools/media/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def _refresh(self) -> None:
self.itemconfigure(self._video, image=self.frame)
if self._control:
self.p.set(pts / self.metadata["duration"])
self.t.set(f"{self._tiem_convert(
pts)} / {self._tiem_convert(self.metadata["duration"])}")
self.t.set("%s / %s" % (self._tiem_convert(pts),
self._tiem_convert(self.metadata["duration"])))
elif val == 'eof' and self._control:
self.media.set_pause(True)
self.p.set(1)
Expand Down Expand Up @@ -107,9 +107,9 @@ def _control_ui(self) -> None:
self.bottom, (300, 15), (650, 30),
command=lambda p: (
self.media.seek(p*self.metadata["duration"], relative=False),
self.t.set(f"{self._tiem_convert(
p*self.metadata["duration"])} / {
self._tiem_convert(self.metadata["duration"])}")))
self.t.set("%s / %s" % (
self._tiem_convert(p*self.metadata["duration"]),
self._tiem_convert(self.metadata["duration"])))))
tkintertools.standard.widgets.Text(
self.bottom, (1000, 30), text="音量", anchor="center")
self.v = tkintertools.standard.widgets.Slider(
Expand Down

0 comments on commit bb8fc93

Please sign in to comment.