Skip to content

Commit

Permalink
Refs #3867: make wiki docs for python easier for me
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Dec 27, 2011
1 parent ea4ac05 commit a83c789
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion Code/Mantid/Build/sip_strip_docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def process_sip(filename):

root = os.path.split(os.path.abspath(filename))[0]
# Read and split into a buncha lines
lines = open(filename, 'r').read().split('\n')
lines = open(filename, 'r').read().splitlines()
in_docstring = False
outlines = []
wikilines = []
Expand All @@ -36,10 +36,18 @@ def process_sip(filename):
else:
# Save the docstring
wikilines.append(" " + lines[i])
# Class-separator line = this is the second line of a new class docstring
if line.startswith("==="):
# Make a wiki-markup header
wikilines[-1] = " "
wikilines[-2] = "=== %s ===" % (wikilines[-2].strip())
else:
# Not in a docstring.
if line.startswith("%docstring"):
in_docstring = True
# Add a blank line separating doc strings if not present
if len(wikilines) > 0 and wikilines[-1].strip() != "":
wikilines.append(" ")
# Copy to output
if not in_docstring:
outlines.append(lines[i])
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/MantidQt/mantidqt.rhel5.sip
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,3 @@ private:
}; // end namespace
}; // end namespace


0 comments on commit a83c789

Please sign in to comment.