Aug-02-2017, 05:58 AM
Hi,
I have been learning python for about 4 months now and i'm stuck trying to extract errors/warnings after running an ant script.
I am running python 2.7 on a windows machine.
code snippet:
[gen-list] [DOTX008E][ERROR] File '..\topic\xyz\xyz.dita' does not exist or cannot be loaded.
[move-meta] File C:\Users\xyz\docs\temp\topic\xyz\xyz.xml does not exist
But my python script simply completes running the script without showing any warnings/errors.
I have been learning python for about 4 months now and i'm stuck trying to extract errors/warnings after running an ant script.
I am running python 2.7 on a windows machine.
code snippet:
cmd = (r'{6} -f build.xml "-DthisInput={4}" "-Dargs.filter={2}"' ' "-DthisDoc={5}" "-Ddita.temp.dir={0}"' ' "-Dout={1}" {3} "-Dgenerate.outer.copy=3"'.format( tempDir, outDir, userFilter, ','.join(targets), file, filename, ant)) pro = subprocess.Popen( cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) pro.wait() o, e = pro.communicate() print (e) print (o)An equivalent powershell script displays errors such as:
[gen-list] [DOTX008E][ERROR] File '..\topic\xyz\xyz.dita' does not exist or cannot be loaded.
[move-meta] File C:\Users\xyz\docs\temp\topic\xyz\xyz.xml does not exist
But my python script simply completes running the script without showing any warnings/errors.