Auto detect LDOCE6 path
This commit is contained in:
parent
44c6244154
commit
cbc89f4910
@ -21,7 +21,6 @@ from anki.hooks import addHook
|
|||||||
|
|
||||||
############## other config here ##################
|
############## other config here ##################
|
||||||
shortcut = 'Ctrl+Q'
|
shortcut = 'Ctrl+Q'
|
||||||
LDOCE6_PATH = u'D:\\mdx_server\\mdx\\LDOCE6.mdx'
|
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
def start_here():
|
def start_here():
|
||||||
@ -34,7 +33,6 @@ def start_here():
|
|||||||
import fastwq
|
import fastwq
|
||||||
|
|
||||||
fastwq.config.read()
|
fastwq.config.read()
|
||||||
fastwq.config.LDOCE6_PATH = LDOCE6_PATH
|
|
||||||
fastwq.my_shortcut = shortcut
|
fastwq.my_shortcut = shortcut
|
||||||
if not fastwq.have_setup:
|
if not fastwq.have_setup:
|
||||||
fastwq.have_setup = True
|
fastwq.have_setup = True
|
||||||
|
|||||||
@ -37,7 +37,6 @@ class Config(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
_CONFIG_FILENAME = u'fastwqcfg.json' #Config File Path
|
_CONFIG_FILENAME = u'fastwqcfg.json' #Config File Path
|
||||||
LDOCE6_PATH = u''
|
|
||||||
|
|
||||||
def __init__(self, window):
|
def __init__(self, window):
|
||||||
self.path = u'_' + self._CONFIG_FILENAME
|
self.path = u'_' + self._CONFIG_FILENAME
|
||||||
|
|||||||
@ -75,14 +75,22 @@ class OptionsDialog(Dialog):
|
|||||||
'local': [], #本地词典
|
'local': [], #本地词典
|
||||||
'web': [] #网络词典
|
'web': [] #网络词典
|
||||||
}
|
}
|
||||||
for cls in service_manager.local_services:
|
for clazz in service_manager.local_services:
|
||||||
service = service_pool.get(cls.__unique__)
|
service = service_pool.get(clazz.__unique__)
|
||||||
if service and service.support:
|
if service and service.support:
|
||||||
self.dict_services['local'].append(service)
|
self.dict_services['local'].append({
|
||||||
for cls in service_manager.web_services:
|
'title': service.title,
|
||||||
service = service_pool.get(cls.__unique__)
|
'unique': service.unique
|
||||||
|
})
|
||||||
|
service_pool.put(service)
|
||||||
|
for clazz in service_manager.web_services:
|
||||||
|
service = service_pool.get(clazz.__unique__)
|
||||||
if service and service.support:
|
if service and service.support:
|
||||||
self.dict_services['web'].append(service)
|
self.dict_services['web'].append({
|
||||||
|
'title': service.title,
|
||||||
|
'unique': service.unique
|
||||||
|
})
|
||||||
|
service_pool.put(service)
|
||||||
# emit finished
|
# emit finished
|
||||||
self._signal.emit('after_build')
|
self._signal.emit('after_build')
|
||||||
|
|
||||||
@ -474,7 +482,7 @@ class TabContent(QWidget):
|
|||||||
|
|
||||||
# local dict service
|
# local dict service
|
||||||
for service in services['local']:
|
for service in services['local']:
|
||||||
dict_combo.addItem(service.title, userData=service.unique)
|
dict_combo.addItem(service['title'], userData=service['unique'])
|
||||||
|
|
||||||
# hr
|
# hr
|
||||||
if len(services['local']) > 0:
|
if len(services['local']) > 0:
|
||||||
@ -482,7 +490,7 @@ class TabContent(QWidget):
|
|||||||
|
|
||||||
# web dict service
|
# web dict service
|
||||||
for service in services['web']:
|
for service in services['web']:
|
||||||
dict_combo.addItem(service.title, userData=service.unique)
|
dict_combo.addItem(service['title'], userData=service['unique'])
|
||||||
|
|
||||||
def set_dict_combo_index():
|
def set_dict_combo_index():
|
||||||
#dict_combo.setCurrentIndex(-1)
|
#dict_combo.setCurrentIndex(-1)
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#-*- coding:utf-8 -*-
|
#-*- coding:utf-8 -*-
|
||||||
import re
|
import re
|
||||||
from ..base import *
|
from ..base import *
|
||||||
from ...context import config
|
|
||||||
|
|
||||||
VOICE_PATTERN = r'<a href="sound://([\w/]+\w*\.mp3)"><img src="img/spkr_%s.png"></a>'
|
VOICE_PATTERN = r'<a href="sound://([\w/]+\w*\.mp3)"><img src="img/spkr_%s.png"></a>'
|
||||||
MAPPINGS = [
|
MAPPINGS = [
|
||||||
@ -15,7 +14,16 @@ LANG_TO_REGEXPS = {lang: regexps for lang, regexps in MAPPINGS}
|
|||||||
class Ldoce6(MdxService):
|
class Ldoce6(MdxService):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Ldoce6, self).__init__(config.LDOCE6_PATH)
|
from ...service import service_manager, service_pool
|
||||||
|
dict_path = ''
|
||||||
|
for clazz in service_manager.mdx_services:
|
||||||
|
service = service_pool.get(clazz.__unique__)
|
||||||
|
title = service.builder._title if service and service.support else u''
|
||||||
|
service_pool.put(service)
|
||||||
|
if title.startswith(u'LDOCE6'):
|
||||||
|
dict_path = service.dict_path
|
||||||
|
break
|
||||||
|
super(Ldoce6, self).__init__(dict_path)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|||||||
@ -43,35 +43,21 @@ class ServiceManager(object):
|
|||||||
def services(self):
|
def services(self):
|
||||||
return self.web_services + self.local_services
|
return self.web_services + self.local_services
|
||||||
|
|
||||||
# def start_all(self):
|
|
||||||
# self.fetch_headers()
|
|
||||||
# make all local services available
|
|
||||||
# for service in self.local_services:
|
|
||||||
# if not service.index(only_header=True):
|
|
||||||
# self.local_services.remove(service)
|
|
||||||
|
|
||||||
def update_services(self):
|
def update_services(self):
|
||||||
|
self.mdx_services, self.star_dict_services = self._get_available_local_services()
|
||||||
self.web_services, self.local_custom_services = self._get_services_from_files()
|
self.web_services, self.local_custom_services = self._get_services_from_files()
|
||||||
self.local_services = self._get_available_local_services()
|
|
||||||
# self.fetch_headers()
|
|
||||||
# combine the customized local services into local services
|
# combine the customized local services into local services
|
||||||
self.local_services = self.local_services + self.local_custom_services
|
self.local_services = self.mdx_services + self.star_dict_services + self.local_custom_services
|
||||||
|
|
||||||
def get_service(self, unique):
|
def get_service(self, unique):
|
||||||
# webservice unique: class name
|
# webservice unique: class name
|
||||||
# mdxservice unique: dict filepath
|
# mdxservice unique: md5 of dict filepath
|
||||||
for each in self.services:
|
for each in self.services:
|
||||||
if each.__unique__ == unique:
|
if each.__unique__ == unique:
|
||||||
#cls = getattr(each,"__class__")
|
|
||||||
service = each()
|
service = each()
|
||||||
service.unique = unique
|
service.unique = unique
|
||||||
return service
|
return service
|
||||||
|
|
||||||
def get_service_action(self, service, label):
|
|
||||||
for each in service.fields:
|
|
||||||
if each.label == label:
|
|
||||||
return each
|
|
||||||
|
|
||||||
def _get_services_from_files(self, *args):
|
def _get_services_from_files(self, *args):
|
||||||
"""
|
"""
|
||||||
get service from service packages, available type is
|
get service from service packages, available type is
|
||||||
@ -80,41 +66,42 @@ class ServiceManager(object):
|
|||||||
service_path = u'dict'
|
service_path = u'dict'
|
||||||
web_services, local_custom_services = list(), list()
|
web_services, local_custom_services = list(), list()
|
||||||
mypath = os.path.join(os.path.dirname(os.path.realpath(__file__)), service_path)
|
mypath = os.path.join(os.path.dirname(os.path.realpath(__file__)), service_path)
|
||||||
files = [f for f in os.listdir(mypath)
|
files = [
|
||||||
if f not in ('__init__.py') and not f.endswith('.pyc') and not os.path.isdir(mypath+os.sep+f)]
|
f for f in os.listdir(mypath) \
|
||||||
base_class = (WebService, LocalService,
|
if f not in ('__init__.py') and \
|
||||||
MdxService, StardictService)
|
not f.endswith('.pyc') and \
|
||||||
|
not os.path.isdir(mypath+os.sep+f)
|
||||||
|
]
|
||||||
|
base_class = (
|
||||||
|
WebService,
|
||||||
|
LocalService,
|
||||||
|
MdxService,
|
||||||
|
StardictService
|
||||||
|
)
|
||||||
for f in files:
|
for f in files:
|
||||||
#try:
|
#try:
|
||||||
module = importlib.import_module(
|
module = importlib.import_module(
|
||||||
u'.%s.%s' % (service_path, os.path.splitext(f)[0]),
|
u'.%s.%s' % (service_path, os.path.splitext(f)[0]),
|
||||||
__package__
|
__package__
|
||||||
)
|
)
|
||||||
for name, cls in inspect.getmembers(module, predicate=inspect.isclass):
|
for name, clazz in inspect.getmembers(module, predicate=inspect.isclass):
|
||||||
if cls in base_class:
|
if clazz in base_class:
|
||||||
continue
|
continue
|
||||||
#try:
|
service = service_wrap(clazz, *args)
|
||||||
#service = cls(*args)
|
|
||||||
service = service_wrap(cls, *args)
|
|
||||||
service.__unique__ = name
|
service.__unique__ = name
|
||||||
if issubclass(cls, WebService):
|
if issubclass(clazz, WebService):
|
||||||
web_services.append(service)
|
web_services.append(service)
|
||||||
# get the customized local services
|
# get the customized local services
|
||||||
if issubclass(cls, LocalService):
|
if issubclass(clazz, LocalService):
|
||||||
local_custom_services.append(service)
|
local_custom_services.append(service)
|
||||||
#except Exception:
|
|
||||||
# exclude the local service whose path has error.
|
|
||||||
# pass
|
|
||||||
#except ImportError:
|
|
||||||
# continue
|
|
||||||
return web_services, local_custom_services
|
return web_services, local_custom_services
|
||||||
|
|
||||||
def _get_available_local_services(self):
|
def _get_available_local_services(self):
|
||||||
'''
|
'''
|
||||||
available local dictionary services
|
available local dictionary services
|
||||||
'''
|
'''
|
||||||
local_services = list()
|
mdx_services = list()
|
||||||
|
star_dict_services = list()
|
||||||
for each in config.dirs:
|
for each in config.dirs:
|
||||||
for dirpath, dirnames, filenames in os.walk(each):
|
for dirpath, dirnames, filenames in os.walk(each):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
@ -124,11 +111,11 @@ class ServiceManager(object):
|
|||||||
if MdxService.check(dict_path):
|
if MdxService.check(dict_path):
|
||||||
service = service_wrap(MdxService, dict_path)
|
service = service_wrap(MdxService, dict_path)
|
||||||
service.__unique__ = md5(dict_path).hexdigest()
|
service.__unique__ = md5(dict_path).hexdigest()
|
||||||
local_services.append(service)
|
mdx_services.append(service)
|
||||||
#Stardict
|
#Stardict
|
||||||
if StardictService.check(dict_path):
|
if StardictService.check(dict_path):
|
||||||
service = service_wrap(StardictService, dict_path)
|
service = service_wrap(StardictService, dict_path)
|
||||||
service.__unique__ = md5(dict_path).hexdigest()
|
service.__unique__ = md5(dict_path).hexdigest()
|
||||||
local_services.append(service)
|
star_dict_services.append(service)
|
||||||
# support mdx dictionary and stardict format dictionary
|
# support mdx dictionary and stardict format dictionary
|
||||||
return local_services
|
return mdx_services, star_dict_services
|
||||||
|
|||||||
@ -18,19 +18,17 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from anki.hooks import addHook
|
from anki.hooks import addHook
|
||||||
from . import common as fastwq
|
|
||||||
from .context import config
|
|
||||||
|
|
||||||
|
|
||||||
############## other config here ##################
|
############## other config here ##################
|
||||||
shortcut = 'Ctrl+Q'
|
shortcut = 'Ctrl+Q'
|
||||||
LDOCE6_PATH = u'D:\\mdx_server\\mdx\\LDOCE6.mdx'
|
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
|
|
||||||
def start_here():
|
def start_here():
|
||||||
|
from . import common as fastwq
|
||||||
|
from .context import config
|
||||||
config.read()
|
config.read()
|
||||||
config.LDOCE6_PATH = LDOCE6_PATH
|
|
||||||
fastwq.my_shortcut = shortcut
|
fastwq.my_shortcut = shortcut
|
||||||
if not fastwq.have_setup:
|
if not fastwq.have_setup:
|
||||||
fastwq.have_setup = True
|
fastwq.have_setup = True
|
||||||
|
|||||||
@ -37,7 +37,6 @@ class Config(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
_CONFIG_FILENAME = 'fastwqcfg.json' #Config File Path
|
_CONFIG_FILENAME = 'fastwqcfg.json' #Config File Path
|
||||||
LDOCE6_PATH = ''
|
|
||||||
|
|
||||||
def __init__(self, window):
|
def __init__(self, window):
|
||||||
self.path = u'_' + self._CONFIG_FILENAME
|
self.path = u'_' + self._CONFIG_FILENAME
|
||||||
|
|||||||
@ -75,14 +75,22 @@ class OptionsDialog(Dialog):
|
|||||||
'local': [], #本地词典
|
'local': [], #本地词典
|
||||||
'web': [] #网络词典
|
'web': [] #网络词典
|
||||||
}
|
}
|
||||||
for cls in service_manager.local_services:
|
for clazz in service_manager.local_services:
|
||||||
service = service_pool.get(cls.__unique__)
|
service = service_pool.get(clazz.__unique__)
|
||||||
if service and service.support:
|
if service and service.support:
|
||||||
self.dict_services['local'].append(service)
|
self.dict_services['local'].append({
|
||||||
for cls in service_manager.web_services:
|
'title': service.title,
|
||||||
service = service_pool.get(cls.__unique__)
|
'unique': service.unique
|
||||||
|
})
|
||||||
|
service_pool.put(service)
|
||||||
|
for clazz in service_manager.web_services:
|
||||||
|
service = service_pool.get(clazz.__unique__)
|
||||||
if service and service.support:
|
if service and service.support:
|
||||||
self.dict_services['web'].append(service)
|
self.dict_services['web'].append({
|
||||||
|
'title': service.title,
|
||||||
|
'unique': service.unique
|
||||||
|
})
|
||||||
|
service_pool.put(service)
|
||||||
# emit finished
|
# emit finished
|
||||||
self._signal.emit('after_build')
|
self._signal.emit('after_build')
|
||||||
|
|
||||||
@ -474,7 +482,7 @@ class TabContent(QWidget):
|
|||||||
|
|
||||||
# local dict service
|
# local dict service
|
||||||
for service in services['local']:
|
for service in services['local']:
|
||||||
dict_combo.addItem(service.title, userData=service.unique)
|
dict_combo.addItem(service['title'], userData=service['unique'])
|
||||||
|
|
||||||
# hr
|
# hr
|
||||||
if len(services['local']) > 0:
|
if len(services['local']) > 0:
|
||||||
@ -482,7 +490,7 @@ class TabContent(QWidget):
|
|||||||
|
|
||||||
# web dict service
|
# web dict service
|
||||||
for service in services['web']:
|
for service in services['web']:
|
||||||
dict_combo.addItem(service.title, userData=service.unique)
|
dict_combo.addItem(service['title'], userData=service['unique'])
|
||||||
|
|
||||||
def set_dict_combo_index():
|
def set_dict_combo_index():
|
||||||
#dict_combo.setCurrentIndex(-1)
|
#dict_combo.setCurrentIndex(-1)
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
#-*- coding:utf-8 -*-
|
#-*- coding:utf-8 -*-
|
||||||
import re
|
import re
|
||||||
from ..base import *
|
from ..base import *
|
||||||
from ...context import config
|
|
||||||
|
|
||||||
|
|
||||||
VOICE_PATTERN = r'<a href="sound://([\w/]+\w*\.mp3)"><img src="img/spkr_%s.png"></a>'
|
VOICE_PATTERN = r'<a href="sound://([\w/]+\w*\.mp3)"><img src="img/spkr_%s.png"></a>'
|
||||||
@ -16,7 +15,16 @@ LANG_TO_REGEXPS = {lang: regexps for lang, regexps in MAPPINGS}
|
|||||||
class Ldoce6(MdxService):
|
class Ldoce6(MdxService):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Ldoce6, self).__init__(config.LDOCE6_PATH)
|
from ...service import service_manager, service_pool
|
||||||
|
dict_path = ''
|
||||||
|
for clazz in service_manager.mdx_services:
|
||||||
|
service = service_pool.get(clazz.__unique__)
|
||||||
|
title = service.builder._title if service and service.support else u''
|
||||||
|
service_pool.put(service)
|
||||||
|
if title.startswith(u'LDOCE6'):
|
||||||
|
dict_path = service.dict_path
|
||||||
|
break
|
||||||
|
super(Ldoce6, self).__init__(dict_path)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
from hashlib import md5
|
from hashlib import md5
|
||||||
@ -39,35 +38,21 @@ class ServiceManager(object):
|
|||||||
def services(self):
|
def services(self):
|
||||||
return self.web_services + self.local_services
|
return self.web_services + self.local_services
|
||||||
|
|
||||||
# def start_all(self):
|
|
||||||
# self.fetch_headers()
|
|
||||||
# make all local services available
|
|
||||||
# for service in self.local_services:
|
|
||||||
# if not service.index(only_header=True):
|
|
||||||
# self.local_services.remove(service)
|
|
||||||
|
|
||||||
def update_services(self):
|
def update_services(self):
|
||||||
|
self.mdx_services, self.star_dict_services = self._get_available_local_services()
|
||||||
self.web_services, self.local_custom_services = self._get_services_from_files()
|
self.web_services, self.local_custom_services = self._get_services_from_files()
|
||||||
self.local_services = self._get_available_local_services()
|
|
||||||
# self.fetch_headers()
|
|
||||||
# combine the customized local services into local services
|
# combine the customized local services into local services
|
||||||
self.local_services = self.local_services + self.local_custom_services
|
self.local_services = self.mdx_services + self.star_dict_services + self.local_custom_services
|
||||||
|
|
||||||
def get_service(self, unique):
|
def get_service(self, unique):
|
||||||
# webservice unique: class name
|
# webservice unique: class name
|
||||||
# mdxservice unique: dict filepath
|
# mdxservice unique: md5 of dict filepath
|
||||||
for each in self.services:
|
for each in self.services:
|
||||||
if each.__unique__ == unique:
|
if each.__unique__ == unique:
|
||||||
#cls = getattr(each,"__class__")
|
|
||||||
service = each()
|
service = each()
|
||||||
service.unique = unique
|
service.unique = unique
|
||||||
return service
|
return service
|
||||||
|
|
||||||
def get_service_action(self, service, label):
|
|
||||||
for each in service.fields:
|
|
||||||
if each.label == label:
|
|
||||||
return each
|
|
||||||
|
|
||||||
def _get_services_from_files(self, *args):
|
def _get_services_from_files(self, *args):
|
||||||
"""
|
"""
|
||||||
get service from service packages, available type is
|
get service from service packages, available type is
|
||||||
@ -76,41 +61,42 @@ class ServiceManager(object):
|
|||||||
service_path = u'dict'
|
service_path = u'dict'
|
||||||
web_services, local_custom_services = list(), list()
|
web_services, local_custom_services = list(), list()
|
||||||
mypath = os.path.join(os.path.dirname(os.path.realpath(__file__)), service_path)
|
mypath = os.path.join(os.path.dirname(os.path.realpath(__file__)), service_path)
|
||||||
files = [f for f in os.listdir(mypath)
|
files = [
|
||||||
if f not in ('__init__.py') and not f.endswith('.pyc') and not os.path.isdir(mypath+os.sep+f)]
|
f for f in os.listdir(mypath) \
|
||||||
base_class = (WebService, LocalService,
|
if f not in ('__init__.py') and \
|
||||||
MdxService, StardictService)
|
not f.endswith('.pyc') and \
|
||||||
|
not os.path.isdir(mypath+os.sep+f)
|
||||||
|
]
|
||||||
|
base_class = (
|
||||||
|
WebService,
|
||||||
|
LocalService,
|
||||||
|
MdxService,
|
||||||
|
StardictService
|
||||||
|
)
|
||||||
for f in files:
|
for f in files:
|
||||||
#try:
|
#try:
|
||||||
module = importlib.import_module(
|
module = importlib.import_module(
|
||||||
u'.%s.%s' % (service_path, os.path.splitext(f)[0]),
|
u'.%s.%s' % (service_path, os.path.splitext(f)[0]),
|
||||||
__package__
|
__package__
|
||||||
)
|
)
|
||||||
for name, cls in inspect.getmembers(module, predicate=inspect.isclass):
|
for name, clazz in inspect.getmembers(module, predicate=inspect.isclass):
|
||||||
if cls in base_class:
|
if clazz in base_class:
|
||||||
continue
|
continue
|
||||||
#try:
|
service = service_wrap(clazz, *args)
|
||||||
#service = cls(*args)
|
|
||||||
service = service_wrap(cls, *args)
|
|
||||||
service.__unique__ = name
|
service.__unique__ = name
|
||||||
if issubclass(cls, WebService):
|
if issubclass(clazz, WebService):
|
||||||
web_services.append(service)
|
web_services.append(service)
|
||||||
# get the customized local services
|
# get the customized local services
|
||||||
if issubclass(cls, LocalService):
|
if issubclass(clazz, LocalService):
|
||||||
local_custom_services.append(service)
|
local_custom_services.append(service)
|
||||||
#except Exception:
|
|
||||||
# exclude the local service whose path has error.
|
|
||||||
# pass
|
|
||||||
#except ImportError:
|
|
||||||
# continue
|
|
||||||
return web_services, local_custom_services
|
return web_services, local_custom_services
|
||||||
|
|
||||||
def _get_available_local_services(self):
|
def _get_available_local_services(self):
|
||||||
'''
|
'''
|
||||||
available local dictionary services
|
available local dictionary services
|
||||||
'''
|
'''
|
||||||
local_services = list()
|
mdx_services = list()
|
||||||
|
star_dict_services = list()
|
||||||
for each in config.dirs:
|
for each in config.dirs:
|
||||||
for dirpath, dirnames, filenames in os.walk(each):
|
for dirpath, dirnames, filenames in os.walk(each):
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
@ -120,11 +106,11 @@ class ServiceManager(object):
|
|||||||
if MdxService.check(dict_path):
|
if MdxService.check(dict_path):
|
||||||
service = service_wrap(MdxService, dict_path)
|
service = service_wrap(MdxService, dict_path)
|
||||||
service.__unique__ = md5(str(dict_path).encode('utf-8')).hexdigest()
|
service.__unique__ = md5(str(dict_path).encode('utf-8')).hexdigest()
|
||||||
local_services.append(service)
|
mdx_services.append(service)
|
||||||
#Stardict
|
#Stardict
|
||||||
if StardictService.check(dict_path):
|
if StardictService.check(dict_path):
|
||||||
service = service_wrap(StardictService, dict_path)
|
service = service_wrap(StardictService, dict_path)
|
||||||
service.__unique__ = md5(str(dict_path).encode('utf-8')).hexdigest()
|
service.__unique__ = md5(str(dict_path).encode('utf-8')).hexdigest()
|
||||||
local_services.append(service)
|
star_dict_services.append(service)
|
||||||
# support mdx dictionary and stardict format dictionary
|
# support mdx dictionary and stardict format dictionary
|
||||||
return local_services
|
return mdx_services, star_dict_services
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user