Author: bugman Date: Sun May 13 17:57:25 2012 New Revision: 16293 URL: http://svn.gna.org/viewcvs/relax?rev=16293&view=rev Log: Renamed the 'doc_builder' module to 'relax_string'. This will be used to hold more string related functions used throughout relax. Added: branches/uf_redesign/relax_string.py - copied unchanged from r16256, branches/uf_redesign/doc_builder.py Removed: branches/uf_redesign/doc_builder.py Modified: branches/uf_redesign/auto_analyses/dauvergne_protocol.py branches/uf_redesign/gui/analyses/auto_model_free.py Modified: branches/uf_redesign/auto_analyses/dauvergne_protocol.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/auto_analyses/dauvergne_protocol.py?rev=16293&r1=16292&r2=16293&view=diff ============================================================================== --- branches/uf_redesign/auto_analyses/dauvergne_protocol.py (original) +++ branches/uf_redesign/auto_analyses/dauvergne_protocol.py Sun May 13 17:57:25 2012 @@ -27,7 +27,6 @@ from time import sleep # relax module imports. -from doc_builder import LIST, PARAGRAPH, SECTION, SUBSECTION, TITLE, to_docstring from float import floatAsByteArray from info import Info_box; info = Info_box() from generic_fns.mol_res_spin import exists_mol_res_spin_data, generate_spin_id, spin_index_loop, spin_loop @@ -36,6 +35,7 @@ from prompt.interpreter import Interpreter from relax_errors import RelaxError, RelaxNoSequenceError, RelaxNoValueError from relax_io import DummyFileObject +from relax_string import LIST, PARAGRAPH, SECTION, SUBSECTION, TITLE, to_docstring from status import Status; status = Status() Removed: branches/uf_redesign/doc_builder.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/doc_builder.py?rev=16292&view=auto ============================================================================== --- branches/uf_redesign/doc_builder.py (original) +++ branches/uf_redesign/doc_builder.py (removed) @@ -1,83 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2010 Edward d'Auvergne # -# # -# This file is part of the program relax. # -# # -# relax is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# relax is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with relax; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -############################################################################### - -# Module docstring. -"""Module for building documentation.""" - - -# Some constants. -TITLE = 3 -SECTION = 2 -SUBSECTION = 1 -PARAGRAPH = 0 -LIST = 10 - - -def to_docstring(data): - """Convert the text to that of a docstring, dependent on the text level. - - @param data: The lists of constants and text to convert into a properly formatted docstring. - @type data: list of lists of int and str - """ - - # Init. - doc = '' - for i in range(len(data)): - # The level and text. - level, text = data[i] - - # Title level. - if level == TITLE: - doc += text + '\n\n' - - # Section level. - if level == SECTION: - doc += '\n\n' + text + '\n' + '='*len(text) + '\n\n' - - # Subsection level. - if level == SUBSECTION: - doc += '\n\n' + text + '\n' + '-'*len(text) + '\n\n' - - # Paragraph level. - elif level == PARAGRAPH: - # Starting newline. - if i and data[i-1][0] == PARAGRAPH: - doc += '\n' - - # The text. - doc += text + '\n' - - # List level. - elif level == LIST: - # Start of list. - if i and data[i-1][0] != LIST: - doc += '\n' - - # The text. - doc += " - %s\n" % text - - # End of list. - if i < len(data) and data[i+1][0] == PARAGRAPH: - doc += '\n' - - # Return the docstring. - return doc Modified: branches/uf_redesign/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/analyses/auto_model_free.py?rev=16293&r1=16292&r2=16293&view=diff ============================================================================== --- branches/uf_redesign/gui/analyses/auto_model_free.py (original) +++ branches/uf_redesign/gui/analyses/auto_model_free.py Sun May 13 17:57:25 2012 @@ -34,9 +34,9 @@ # relax module imports. from auto_analyses import dauvergne_protocol from data import Relax_data_store; ds = Relax_data_store() -from doc_builder import LIST, PARAGRAPH, SECTION, SUBSECTION, TITLE from generic_fns.pipes import has_pipe from generic_fns.mol_res_spin import exists_mol_res_spin_data, spin_loop +from relax_string import LIST, PARAGRAPH, SECTION, SUBSECTION, TITLE from status import Status; status = Status() # relax GUI module imports.