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

« back to all changes in this revision

Viewing changes to spyderlib/rope_patch.py

  • Committer: Package Import Robot
  • Author(s): Picca Frédéric-Emmanuel
  • Date: 2014-05-29 09:06:26 UTC
  • mfrom: (1.1.21) (18.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20140529090626-f58t82g0n5iewaxu
Tags: 2.3.0~rc+dfsg-1~experimental2
* Add spyder-common binary package for all the python2,3 common files
* debian/path
  - 0001-fix-documentation-installation.patch (deleted)
  + 0001-fix-spyderlib-path.patch (new)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
"""
8
8
Patching rope:
9
9
 
10
 
[1] For compatibility with Spyder's standalone version, build with py2exe or
 
10
[1] For compatibility with Spyder's standalone version, built with py2exe or
11
11
    cx_Freeze
12
12
 
13
 
[2] For better performances, see this thread:
14
 
http://groups.google.com/group/rope-dev/browse_thread/thread/57de5731f202537a
 
13
[2] For better performance, see this thread:
 
14
    http://groups.google.com/group/rope-dev/browse_thread/thread/57de5731f202537a
15
15
 
16
16
[3] To avoid considering folders without __init__.py as Python packages, thus
17
 
avoiding side effects as non-working introspection features on a Python module
18
 
or package when a folder in current directory has the same name.
19
 
See this thread:
20
 
http://groups.google.com/group/rope-dev/browse_thread/thread/924c4b5a6268e618
 
17
    avoiding side effects as non-working introspection features on a Python
 
18
    module or package when a folder in current directory has the same name.
 
19
    See this thread:
 
20
    http://groups.google.com/group/rope-dev/browse_thread/thread/924c4b5a6268e618
21
21
 
22
22
[4] To avoid rope adding a 2 spaces indent to every docstring it gets, because
23
 
it breaks the work of Sphinx on the Object Inspector. Also, to better control
24
 
how to get calltips and docstrings of forced builtin objects.
 
23
    it breaks the work of Sphinx on the Object Inspector. Also, to better
 
24
    control how to get calltips and docstrings of forced builtin objects.
 
25
 
 
26
[5] To make matplotlib return its docstrings in proper rst, instead of a mix
 
27
    of rst and plain text.
25
28
"""
26
29
 
27
30
def apply():
28
31
    """Monkey patching rope
29
32
    
30
 
    See [1], [2] and [3] in module docstring."""
 
33
    See [1], [2], [3], [4] and [5] in module docstring."""
31
34
    import rope
32
35
    if rope.VERSION not in ('0.9.4', '0.9.3', '0.9.2'):
33
 
        raise ImportError, "rope %s can't be patched" % rope.VERSION
34
 
 
 
36
        raise ImportError("rope %s can't be patched" % rope.VERSION)
 
37
    
35
38
    # [1] Patching project.Project for compatibility with py2exe/cx_Freeze
36
39
    #     distributions
37
40
    from spyderlib.baseconfig import is_py2exe_or_cx_Freeze
196
199
            docs = pyfunction.get_doc()
197
200
            docs = self._trim_docstring(docs, indents=0)
198
201
            return docs
199
 
    codeassist.PyDocExtractor = PatchedPyDocExtractor 
 
202
    codeassist.PyDocExtractor = PatchedPyDocExtractor
 
203
 
 
204
 
 
205
    # [5] Get the right matplotlib docstrings for our Object Inspector
 
206
    try:
 
207
        import matplotlib as mpl
 
208
        mpl.rcParams['docstring.hardcopy'] = True
 
209
    except ImportError:
 
210
        pass