MCPcopy
hub / github.com/skywind3000/ECDICT / compile_mdx

Method compile_mdx

dictutils.py:979–997  ·  view source on GitHub ↗
(self, db, name1, name2)

Source from the content-addressed store, hash-verified

977 return '\n'.join(html)
978
979 def compile_mdx (self, db, name1, name2):
980 mdx1 = {}
981 mdx2 = {}
982 pc = stardict.tools.progress(len(db))
983 for _, word in db:
984 pc.next()
985 data = db[word]
986 mdx1[word] = self.generate_front(data)
987 mdx2[word] = self.generate_back(data)
988 pc.done()
989 if os.path.splitext(name1)[-1].lower() == '.mdx':
990 stardict.tools.export_mdx(mdx1, name1, 'anki-front')
991 else:
992 stardict.tools.export_mdict(mdx1, name1)
993 if os.path.splitext(name2)[-1].lower() == '.mdx':
994 stardict.tools.export_mdx(mdx2, name2, 'anki-back')
995 else:
996 stardict.tools.export_mdict(mdx2, name2)
997 return 0
998
999
1000

Callers

nothing calls this directly

Calls 7

generate_frontMethod · 0.95
generate_backMethod · 0.95
progressMethod · 0.80
nextMethod · 0.80
doneMethod · 0.80
export_mdxMethod · 0.80
export_mdictMethod · 0.80

Tested by

no test coverage detected