Skip to content

Commit

Permalink
Merge pull request #28 from ThanatosDi/refactor/3.0
Browse files Browse the repository at this point in the history
重構 3.0 版本
  • Loading branch information
ThanatosDi authored Sep 3, 2024
2 parents 30ce6cb + c535351 commit 9935dd2
Show file tree
Hide file tree
Showing 66 changed files with 2,709 additions and 61,380 deletions.
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

0 comments on commit 9935dd2

Please sign in to comment.