代码拉取完成,页面将自动刷新
# -*- coding: UTF-8 -*-
from alistmodule import AlistModule
from aria2module import Aria2Module
# 应用工厂
class AppFactory:
__instance = None
@staticmethod
def getInstance():
if AppFactory.__instance is None:
AppFactory()
return AppFactory.__instance
def __init__(self):
self.applist = {}
if AppFactory.__instance is not None:
raise Exception("This class is a singleton!")
else:
AppFactory.__instance = self
def createAppModule(self, apptype, config):
app_types = {
config.AppType.ALIST_TYPE: AlistModule,
config.AppType.ARIA2_TYPE: Aria2Module
}
appobj = app_types.get(apptype)
if appobj:
appobj = appobj(config)
self.applist[apptype] = appobj
return appobj
def getAppModule(self, apptype):
if apptype is not None:
return self.applist[apptype]
else:
return self.applist.values()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。