From 308990d00b83a3518683e72120011ed6b06a8abf Mon Sep 17 00:00:00 2001 From: Martyn Gigg Date: Wed, 11 Jun 2014 09:37:24 +0100 Subject: [PATCH] Disable doctest while debugging. Refs #9573 --- .../algorithms/FixGSASInstrumentFile-v1.rst | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/Code/Mantid/docs/source/algorithms/FixGSASInstrumentFile-v1.rst b/Code/Mantid/docs/source/algorithms/FixGSASInstrumentFile-v1.rst index 9a853f6ee507..d8f03234aa26 100644 --- a/Code/Mantid/docs/source/algorithms/FixGSASInstrumentFile-v1.rst +++ b/Code/Mantid/docs/source/algorithms/FixGSASInstrumentFile-v1.rst @@ -20,45 +20,47 @@ Usage **Example - simple rebin of a histogram workspace:** -.. testcode:: ExHistSimple - - # Load original file and check each line - rfile = open("PG3HR60_FmPython.iparm", "r") - lines = rfile.readlines() - rfile.close() - - numlinefewer80 = 0 - for line in lines: - if len(line) != 80: - numlinefewer80 += 1 - - # Run algorithm to fix the instrument file - FixGSASInstrumentFile(InputFilename="PG3HR60_FmPython.iparm", OutputFilename="/tmp/Fixed.iparm") - - # Load new file and check each line - wfile = open("/tmp/Fixed.iparm", "r") - lines = wfile.readlines() - numlinefewer80b = 0 - for line in lines: - if len(line) > 0: - line = line.split("\n")[0] +:: + + .. testcode:: ExHistSimple + + # Load original file and check each line + rfile = open("PG3HR60_FmPython.iparm", "r") + lines = rfile.readlines() + rfile.close() + + numlinefewer80 = 0 + for line in lines: if len(line) != 80: - numlinefewer80b += 1 + numlinefewer80 += 1 + + # Run algorithm to fix the instrument file + FixGSASInstrumentFile(InputFilename="PG3HR60_FmPython.iparm", OutputFilename="/tmp/Fixed.iparm") + + # Load new file and check each line + wfile = open("/tmp/Fixed.iparm", "r") + lines = wfile.readlines() + numlinefewer80b = 0 + for line in lines: + if len(line) > 0: + line = line.split("\n")[0] + if len(line) != 80: + numlinefewer80b += 1 - # Print out result - print "Original File: Number of lines that are not equal to 80 characters = ", numlinefewer80 - print "Corrected File: Number of lines that are not equal to 80 characters = ", numlinefewer80b + # Print out result + print "Original File: Number of lines that are not equal to 80 characters = ", numlinefewer80 + print "Corrected File: Number of lines that are not equal to 80 characters = ", numlinefewer80b -.. testcleanup:: ExHistSimple + .. testcleanup:: ExHistSimple - import os - os.remove("/tmp/Fixed.iparm") + import os + os.remove("/tmp/Fixed.iparm") -Output: + Output: -.. testoutput:: ExHistSimple + .. testoutput:: ExHistSimple - Original File: Number of lines that are not equal to 80 characters = 1510 - Corrected File: Number of lines that are not equal to 80 characters = 0 + Original File: Number of lines that are not equal to 80 characters = 1510 + Corrected File: Number of lines that are not equal to 80 characters = 0 .. categories::