jitenbot/bot/entries/factory.py

21 lines
731 B
Python
Raw Normal View History

2023-05-06 21:55:00 +00:00
from bot.targets import Targets
from bot.entries.jitenon import JitenonKokugoEntry
from bot.entries.jitenon import JitenonYojiEntry
from bot.entries.jitenon import JitenonKotowazaEntry
from bot.entries.smk8 import Smk8Entry
from bot.entries.daijirin2 import Daijirin2Entry
2023-07-18 05:43:38 +00:00
from bot.entries.sankoku8 import Sankoku8Entry
2023-05-06 21:55:00 +00:00
def new_entry(target, page_id):
entry_map = {
Targets.JITENON_KOKUGO: JitenonKokugoEntry,
Targets.JITENON_YOJI: JitenonYojiEntry,
Targets.JITENON_KOTOWAZA: JitenonKotowazaEntry,
Targets.SMK8: Smk8Entry,
Targets.DAIJIRIN2: Daijirin2Entry,
2023-07-18 05:43:38 +00:00
Targets.SANKOKU8: Sankoku8Entry,
2023-05-06 21:55:00 +00:00
}
return entry_map[target](target, page_id)