~ubuntu-branches/debian/experimental/spyder/experimental

« back to all changes in this revision

Viewing changes to spyderlib/utils/inspector/sphinxify.py

  • Committer: Package Import Robot
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2013-02-27 09:51:28 UTC
  • mfrom: (1.1.18)
  • Revision ID: package-import@ubuntu.com-20130227095128-wtx1irpvf4vl79lj
Tags: 2.2.0~beta3+dfsg-1
* Imported Upstream version 2.2.0~beta3+dfsg
* debian /patches
  - 0002-feature-forwarded-add-icon-to-desktop-file.patch (deleted)
    this patch was integrated by the upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    warning = env.get_template("warning.html")
56
56
    return warning.render(css_path=CSS_PATH, text=message)
57
57
 
58
 
def generate_context(title, argspec, note, math):
 
58
def generate_context(name, argspec, note, math):
59
59
    """
60
60
    Generate the html_context dictionary for our Sphinx conf file.
61
61
    
65
65
 
66
66
    Parameters
67
67
    ----------
68
 
    title : str
69
 
        Docstring title.
 
68
    name : str
 
69
        Object's name.
70
70
    note : str
71
71
        A note describing what type has the function or method being
72
72
        introspected
93
93
    {
94
94
      # Arg dependent variables
95
95
      'math_on': 'true' if math else '',
96
 
      'Title': title, # title in lowercase seems to be used by Sphinx
 
96
      'name': name,
97
97
      'argspec': argspec,
98
98
      'note': note,
99
99
      
142
142
        suffix = '.txt'
143
143
    output_name = base_name + suffix
144
144
 
145
 
    # This is needed so users can type \\ on latex eqnarray envs inside of raw
 
145
    # This is needed so users can type \\ on latex eqnarray envs inside raw
146
146
    # docstrings
147
147
    if context['right_sphinx_version'] and context['math_on']:
148
148
        docstring = docstring.replace('\\\\', '\\\\\\\\')
149
149
    
150
150
    # Add a class to several characters on the argspec. This way we can
151
 
    # colorize them using css, in a similar way to what IPython does.
 
151
    # highlight them using css, in a similar way to what IPython does.
152
152
    argspec = context['argspec']
153
153
    for char in ['=', ',', '(', ')', '*', '**']:
154
154
        argspec = argspec.replace(char,