Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Disabling a tralics module that broke the conversion
  • Loading branch information
Klaus Thoden committed Dec 5, 2017
1 parent 5bb2b0f commit 523ad23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
File renamed without changes.
21 changes: 5 additions & 16 deletions eoaconvert.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2017-10-30 13:12:19 (kthoden)>
# Time-stamp: <2017-12-05 14:41:09 (kthoden)>

# license?
__version__=""
Expand Down Expand Up @@ -69,15 +69,7 @@
numeric_level = getattr(logging, LOGLEVEL.upper(), None)
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % loglevel)
logging.basicConfig(filename=LOGFILE, level=numeric_level, format='%(asctime)s - %(levelname)s - %(message)s')

LOGFILE = CONFIG['General']['logfile']
LOGLEVEL = CONFIG['General']['loglevel']

numeric_level = getattr(logging, LOGLEVEL.upper(), None)
if not isinstance(numeric_level, int):
raise ValueError('Invalid log level: %s' % loglevel)
logging.basicConfig(filename=LOGFILE, level=numeric_level, format='%(asctime)s - %(levelname)s - %(message)s')
logging.basicConfig(filename=LOGFILE, level=LOGLEVEL, format='%(asctime)s - %(levelname)s - %(message)s')

########################
# Paths to executables #
Expand Down Expand Up @@ -329,7 +321,7 @@ def progress(count, total, status=''):
bar = '#' * filled_len + '-' * (bar_len - filled_len)

sys.stdout.write('[%s] %s%s ... %s\r' % (bar, percents, '%', status))
sys.stdout.flush()
sys.stdout.flush()
# def progress ends here

def cleanup():
Expand Down Expand Up @@ -399,7 +391,7 @@ def cleanup():
##############################################################

# Convert TeX to XML via Tralics
Kommando = "%s -confdir %s/tralics_conf -config %s/tralics.tcf -utf8 -utf8output %s.tex" % (TRALICS_PATH_EXEC, TRALICS_PATH_LIB, TRALICS_PATH_LIB, options.filename)
Kommando = "%s -log_file %s -confdir %s/tralics_conf -config %s/tralics.tcf -utf8 -utf8output %s.tex" % (TRALICS_PATH_EXEC, options.filename + "-tralics.log", TRALICS_PATH_LIB, TRALICS_PATH_LIB, options.filename)
Argumente = shlex.split(Kommando)
Prozess = subprocess.call(Argumente)

Expand Down Expand Up @@ -473,8 +465,6 @@ def cleanup():
dictChapters[Chapteruid] = str(Chapternumber)
Chapternumber += 1



# EOAequation, EOAsubequation and EOAequationarray Numbering per Chapter
intChapterNumber = 1
print("-----------------------------------------------------")
Expand All @@ -483,7 +473,6 @@ def cleanup():
intEquationnumber = 1
xmlDinge = xmlChapter.xpath(".//EOAequation | .//EOAequationarray | .//EOAsubequations")
print("Working on Chapter %d which contains %d formulæ." % (intChapterNumber, len(xmlDinge)))
# print ("Es wurden " + str(len(xmlDinge)) + " Formeln gefunden")
for xmlDing in xmlDinge:
if xmlDing.tag == "EOAequationarray":
# tmpNumberinArray is only being used for filename
Expand Down Expand Up @@ -747,7 +736,7 @@ def cleanup():
strSourceCode = xmlEOAineq.text

progress(intEOAineqnumber, len(xmlEOAineqs),"Processing EOAineq %s of %s." % (intEOAineqnumber, len(xmlEOAineqs)))

strSourceCode = os.linesep.join([s for s in strSourceCode.splitlines() if s])
strTeXEquations = strTeXEquations + "$" + strSourceCode + "$\n\\newpage\n"
# Add intEOAineqRunningOrder : Filename to dictionary
Expand Down

0 comments on commit 523ad23

Please sign in to comment.