From 84410ad7a8452a2d569313da689447c8d46ae910 Mon Sep 17 00:00:00 2001 From: belerico Date: Tue, 7 Apr 2020 13:03:04 +0200 Subject: [PATCH] Fix __version__ import --- py_asciimath-cli.py | 2 +- py_asciimath/__init__.py | 2 +- py_asciimath/py_asciimath.py | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/py_asciimath-cli.py b/py_asciimath-cli.py index 9e4c279..8653a4b 100755 --- a/py_asciimath-cli.py +++ b/py_asciimath-cli.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from py_asciimath.py_asciimath import main +from py_asciimath.__main__ import main if __name__ == "__main__": main() diff --git a/py_asciimath/__init__.py b/py_asciimath/__init__.py index 2418e6b..a68927d 100644 --- a/py_asciimath/__init__.py +++ b/py_asciimath/__init__.py @@ -1 +1 @@ -__version__ = "0.0.9" \ No newline at end of file +__version__ = "0.1.0" \ No newline at end of file diff --git a/py_asciimath/py_asciimath.py b/py_asciimath/py_asciimath.py index d67f827..ef0bc21 100644 --- a/py_asciimath/py_asciimath.py +++ b/py_asciimath/py_asciimath.py @@ -11,22 +11,18 @@ --log Log the transformation process. --version Show version. """ -import re import sys from docopt import docopt +from . import __version__ from .parser.parser import ASCIIMath2Tex from .transformer.const import asciimath_grammar from .transformer.transformer import LatexTransformer -version = re.search( - r'^__version__\s*=\s*"(.*)"', open("py_asciimath/__init__.py").read() -).group(1) - def main(): - arguments = docopt(__doc__, version="py_asciimath " + version) + arguments = docopt(__doc__, version="py_asciimath " + __version__) if arguments["--output"]: if arguments["--output"].lower() == "latex": print("Translating ...")