10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-07-22 18:57:38 +02:00

Add debug flag instead of DEBUG variable

This commit is contained in:
Mickaël Véril 2020-02-19 11:47:58 +01:00
parent cff3119df5
commit c657307b2a

View File

@ -9,11 +9,12 @@ from lib.Format import Format
from TexSoup import TexSoup
from lib.data import dataFileBase,dataType
import argparse
DEBUG=True
parser = argparse.ArgumentParser()
parser.add_argument('--file', type=argparse.FileType('r'))
parser.add_argument('--defaultType', type=str, choices=[t.name for t in list(dataType)])
parser.add_argument('--format',type=str, choices=[t.name for t in list(Format)],default=Format.LINE.name)
parser.add_argument('--debug', action='store_true', help='Debug mode'
)
args = parser.parse_args()
print(args)
lines=args.file.readlines()
@ -22,7 +23,7 @@ commands=[LaTeX.newCommand(cmd) for cmd in soup.find_all("newcommand")]
dat=LaTeX.tabularToData(soup.tabular,commands)
scriptpath=Path(sys.argv[0]).resolve()
datapath=scriptpath.parents[1]/"static"/"data"
if DEBUG:
if args.debug:
datapath=datapath/"test"
if not datapath.exists():
datapath.mkdir()