(self, db, name1, name2)
| 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 |
nothing calls this directly
no test coverage detected