Skip to content

Commit

Permalink
fix broken scripts/view-glossary-plaintext
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 29, 2024
1 parent 1891f98 commit 08dc8c0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/view-glossary-plaintext
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
#!/usr/bin/env python

import sys
import os
from os.path import abspath, dirname, join
import sys
from os.path import abspath, dirname

rootDir = dirname(dirname(abspath(__file__)))
sys.path.insert(0, rootDir)

from pyglossary.ui.tools.view_glossary import viewGlossary
from pyglossary.glossary_v2 import Glossary
from pyglossary.ui.tools.view_glossary import viewGlossary


def main() -> None:
filename = sys.argv[1]
format = None
formatName = None
if len(sys.argv) > 2:
format = sys.argv[2]
formatName = sys.argv[2]

glos = Glossary(ui=None)
glos.updateEntryFilters()
glos.removeHtmlTagsAll()

filename = os.path.expanduser(filename)
viewGlossary(filename, format=format, glos=glos)
viewGlossary(filename, formatName=formatName, glos=glos)


if __name__ == "__main__":
Expand Down

0 comments on commit 08dc8c0

Please sign in to comment.