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

重構 3.0 版本 #28

Merged
merged 75 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
2d83ed0
feat: 初始化 engine 的抽象類別
ThanatosDi Aug 4, 2022
f0ad205
feat: logger 模組
ThanatosDi Aug 4, 2022
47eed3a
feat: 調整取得設定功能
ThanatosDi Aug 4, 2022
a78ef15
feat: 調整版號 3.0.0
ThanatosDi Aug 4, 2022
e87f0a3
chore: 升級 python 版本、調整 dev 套件
ThanatosDi Aug 4, 2022
1f27de3
chore: 新增 git 忽略檔案
ThanatosDi Aug 11, 2022
b6a91b7
delete: 移除舊版本套件清單
ThanatosDi Aug 11, 2022
570760d
feat: 初始化 engine
ThanatosDi Aug 11, 2022
90d7bc7
feat: 實作繁化姬轉換引擎
ThanatosDi Aug 11, 2022
8e33871
feat: 實作 OpenCC 轉換引擎
ThanatosDi Aug 11, 2022
917cc43
delete: 移除舊版本程式碼
ThanatosDi Aug 11, 2022
2714b1f
建立測試案例
ThanatosDi Aug 11, 2022
0b34408
feat: 建立繁化姬測試案例
ThanatosDi Aug 11, 2022
01224c6
feat: 建立 OpenCC 測試案例
ThanatosDi Aug 11, 2022
69b2b52
feat: 增加允許的轉換器
ThanatosDi Aug 12, 2022
3e1bfe4
fix: 調整回傳格式
ThanatosDi Aug 12, 2022
cfc8194
feat: 壓縮及解壓縮模組
ThanatosDi Aug 12, 2022
a85ebd9
refactor: 調整邏輯程式位置
ThanatosDi Aug 13, 2022
979aed7
delete: 移除舊 opencc 字典檔,改直接使用 opencc 官方提供的字典檔
ThanatosDi Aug 13, 2022
056d534
refactor: 調整變數命名
ThanatosDi Aug 13, 2022
2531297
移除 pipenv 使用 poetry
ThanatosDi Jan 3, 2023
fa1173a
feat: 添加 async 請求限制
ThanatosDi Jan 3, 2023
c1080cd
feat: 使用 Enum
ThanatosDi Jan 3, 2023
d6d4a7e
feat: 建立 Converter Enum
ThanatosDi Jan 3, 2023
83ad9ca
feat: 建立 engine enum
ThanatosDi Jan 3, 2023
f3821c2
feat: 建立 format enum
ThanatosDi Jan 3, 2023
d4b37e7
搬移 config 位置
ThanatosDi Jan 3, 2023
998c7d2
test: 建立引擎翻譯測試
ThanatosDi Jan 3, 2023
d06bb4d
feat: 使用 engine enum 來判斷 config.engine
ThanatosDi Jan 3, 2023
7510ee5
移除無用註解
ThanatosDi Jan 3, 2023
bc129bf
chore: 忽略不必要檔案目錄
ThanatosDi Jun 3, 2023
c410b55
建立 logs 目錄
ThanatosDi Jun 3, 2023
c3c8706
chore: 移除從 pypi 安裝 opencc 直接從原始碼編譯最新版本
ThanatosDi Jun 3, 2023
e34ad60
feat: 轉換使用的預設 config
ThanatosDi Jun 3, 2023
164635e
style: 調整 function 命名規則
ThanatosDi Jun 4, 2023
08b1c41
fix: 修正匯入 config 模組
ThanatosDi Jun 4, 2023
ae64094
feat: 實作 renamer 模組
ThanatosDi Jun 4, 2023
c0f5dec
style: 調整參數命名規則
ThanatosDi Jun 4, 2023
0fbf0bc
docs: 修正排版
ThanatosDi Jun 13, 2023
b3f6e61
chore: 增加套件 loguru, opencc, chardet
ThanatosDi Apr 28, 2024
1fa3894
feat: 增加版號
ThanatosDi Apr 28, 2024
91c6a3a
feat: 實作繁化姬 async 請求
ThanatosDi Apr 28, 2024
eeb41ce
feat: 實作 opencc 轉換功能
ThanatosDi Apr 28, 2024
a1282ec
refactor: 增加註解
ThanatosDi Apr 28, 2024
61ec2a4
fix: 調整註解及變數命名
ThanatosDi Apr 28, 2024
fd9b03f
remove: 移除 logger 模組 由 loguru 替代
ThanatosDi Apr 28, 2024
f1b9034
fix: 調整 config 路徑
ThanatosDi Apr 28, 2024
a0a1403
refactor: 替代 log 紀錄方法
ThanatosDi Apr 28, 2024
ba475b4
feat: 實作多項方法
ThanatosDi Apr 28, 2024
690aaeb
feat: 調整多個方法
ThanatosDi Apr 28, 2024
6dfe8f9
refactor: 重構 config
ThanatosDi Apr 28, 2024
9b619d5
remove: 移除 v2.x.x 主程式
ThanatosDi Apr 28, 2024
88d891a
feat: 新增參數
ThanatosDi Apr 28, 2024
b8fb4f0
feat: 範例 config 設定
ThanatosDi Aug 26, 2024
e6c9581
format: 移除空白
ThanatosDi Aug 26, 2024
fce185e
chore: 增加 pyinstaller 套件
ThanatosDi Aug 26, 2024
f7652b8
feat: 限制繁化姬異步請求頻率 zhconvert Request error. status code: 429 #25
ThanatosDi Aug 26, 2024
b6cf912
feat: 實作取得檔案編碼、dict 轉 CSS
ThanatosDi Aug 26, 2024
e1af7c1
chore: 增加 debug 訊息
ThanatosDi Aug 26, 2024
8bcf3f8
feat: 讀取 config.ini 之前切換工作目錄、增加是否後輟詞設定
ThanatosDi Aug 26, 2024
3a5770e
test: 繁化姬翻譯測試
ThanatosDi Aug 26, 2024
3834a21
test: opencc 翻譯測試
ThanatosDi Aug 26, 2024
14592dc
feat: 增加橫直轉換功能
ThanatosDi Aug 26, 2024
11e4b71
feat: main
ThanatosDi Aug 26, 2024
82978d8
ignore warning
ThanatosDi Aug 26, 2024
12ba82c
test: 調整轉換引擎測試案例位置
ThanatosDi Aug 26, 2024
d962692
chore: 增加開發套件
ThanatosDi Aug 26, 2024
1bd77d1
feat: 移除引入 Config 設定
ThanatosDi Aug 26, 2024
57d8ba4
feat: 移除無用函數、增加註解
ThanatosDi Aug 26, 2024
3317f62
docs: 增加註解
ThanatosDi Aug 26, 2024
54a19e4
feat: 增加轉換結束後暫停功能
ThanatosDi Sep 3, 2024
2f329cd
feat: 將繁化姬異步請求限制參數化
ThanatosDi Sep 3, 2024
c829c5d
feat: 新增轉換後檔案增加後輟功能
ThanatosDi Sep 3, 2024
acbc274
feat: 增加 engine, converter 預設值
ThanatosDi Sep 3, 2024
c535351
chore: v3.0.0 requirements.txt
ThanatosDi Sep 3, 2024
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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,11 @@ venv.bak/
.vscode/settings.json
.modules/*

# custom
*.epub
*.xhtml
*.xhtml
modules.bak/
test.py
OpenCC/
storages/logs/*
!.gitkeep
19 changes: 0 additions & 19 deletions Pipfile

This file was deleted.

339 changes: 0 additions & 339 deletions Pipfile.lock

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![GitHub release](https://img.shields.io/github/release/Kutinging/EpubConv_Python.svg?style=plastic)](https://github.com/Kutinging/EpubConv_Python/releases)
[![GitHub release](https://img.shields.io/github/v/release/ThanatosDi/EpubConv_Python?include_prereleases&style=plastic)](https://github.com/Kutinging/EpubConv_Python/releases)
[![HitCount](http://hits.dwyl.io/ThanatosDi/EpubConv_Python.svg)](http://hits.dwyl.io/ThanatosDi/EpubConv_Python)

# EPubConv_Python EPub簡繁橫直互轉 Refactor
<!--[![GitHub release](https://img.shields.io/github/release/ThanatosDi/EpubConv_Python.svg?style=plastic)](https://github.com/ThanatosDi/EpubConv_Python/releases) -->
Expand All @@ -25,9 +24,9 @@ https://github.com/ThanatosDi/EpubConv_Python/releases
# Notice 注意
本程式使用了繁化姬的 API 服務,如有商業使用([何謂商業使用?](https://docs.zhconvert.org/commercial/#%E4%BD%95%E8%AC%82%E5%95%86%E6%A5%AD%E4%BD%BF%E7%94%A8))請依照繁化姬[說明文件](https://docs.zhconvert.org/commercial/)付費使用

# 贊助我
# Donate 贊助我
只要少喝一杯飲料就可以給我大大的鼓勵
[![QR](https://payment.ecpay.com.tw/Upload/QRCode/201908/QRCode_c3efe2f9-5367-4db4-8440-b6592d9c9e0c.png)](https://p.ecpay.com.tw/7D0E7)

## 感謝贊助 Thank you for Donate
## Thank you for Donate 感謝贊助
* 2019/10/24 蕭先生/小姐
56 changes: 56 additions & 0 deletions app/Enums/ConverterEnum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from enum import Enum


class OpenccConverter(Enum):
s2t = 's2t'
s2tw = 's2tw'
s2twp = 's2twp'
t2s = 't2s'
tw2s = 'tw2s'
tw2sp = 'tw2sp'

@classmethod
def has_value(cls, value):
return value in cls._value2member_map_


class FilenameConverter(Enum):
s2t = 's2t'
s2tw = 's2t'
s2twp = 's2t'
t2s = 't2s'
tw2s = 't2s'
tw2sp = 't2s'


class FanhuajiConverter(Enum):
s2t = 'Traditional'
t2s = 'Simplified'
s2tw = 'Traditional'
s2twp = 'Taiwan'
tw2s = 'Simplified'
tw2sp = 'China'

@classmethod
def has_value(cls, value):
return value in cls._value2member_map_


class Converter(Enum):
s2t = 's2t'
s2tw = 's2tw'
s2twp = 's2twp'
t2s = 't2s'
tw2s = 'tw2s'
tw2sp = 'tw2sp'

@classmethod
def has_name(cls, name):
return name in cls._member_names_


class ConverterEnum(Enum):
opencc = OpenccConverter
fanhuaji = FanhuajiConverter
filename = FilenameConverter
converter = Converter
11 changes: 11 additions & 0 deletions app/Enums/EngineEnum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from enum import Enum


class EngineEnum(Enum):
fanhuaji = 'fanhuaji'
fanhuaji_async = 'fanhuaji_async'
opencc = 'opencc'

@classmethod
def has_value(cls, value):
return value in cls._value2member_map_
10 changes: 10 additions & 0 deletions app/Enums/FormatEnum.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from enum import Enum


class FormatEnum(Enum):
vertical = 'vertical' # 直書
horizontal = 'horizontal' # 橫書

@classmethod
def has_value(cls, value):
return value in cls._value2member_map_
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__VERSION__ = '3.0.0'
File renamed without changes.
6 changes: 6 additions & 0 deletions app/engines/engineABC.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import abc


class Engine(abc.ABC):
@abc.abstractmethod
def convert(self, text, **kwargs): ...
Loading