Show More
@@ -76,7 +76,6 b' import os' | |||||
76 | import re |
|
76 | import re | |
77 | import shlex |
|
77 | import shlex | |
78 | import sys |
|
78 | import sys | |
79 | import StringIO |
|
|||
80 |
|
79 | |||
81 | from IPython.config.configurable import Configurable |
|
80 | from IPython.config.configurable import Configurable | |
82 | from IPython.core.error import TryNext |
|
81 | from IPython.core.error import TryNext | |
@@ -672,7 +671,7 b' class IPCompleter(Completer):' | |||||
672 | return matches |
|
671 | return matches | |
673 |
|
672 | |||
674 | def _default_arguments_from_docstring(self, doc): |
|
673 | def _default_arguments_from_docstring(self, doc): | |
675 | """Parse first line of docstring for call signature. |
|
674 | """Parse the first line of docstring for call signature. | |
676 |
|
675 | |||
677 | Docstring should be of the form 'min(iterable[, key=func])\n'. |
|
676 | Docstring should be of the form 'min(iterable[, key=func])\n'. | |
678 | It can also parse cython docstring of the form |
|
677 | It can also parse cython docstring of the form | |
@@ -680,10 +679,10 b' class IPCompleter(Completer):' | |||||
680 | """ |
|
679 | """ | |
681 | if doc is None: |
|
680 | if doc is None: | |
682 | return [] |
|
681 | return [] | |
683 | sio = StringIO.StringIO(doc.lstrip()) |
|
682 | ||
684 | #care only the firstline |
|
683 | #care only the firstline | |
685 | #docstring can be long |
|
684 | line = doc.lstrip().splitlines()[0] | |
686 | line = sio.readline() |
|
685 | ||
687 | #p = re.compile(r'^[\w|\s.]+\(([^)]*)\).*') |
|
686 | #p = re.compile(r'^[\w|\s.]+\(([^)]*)\).*') | |
688 | #'min(iterable[, key=func])\n' -> 'iterable[, key=func]' |
|
687 | #'min(iterable[, key=func])\n' -> 'iterable[, key=func]' | |
689 | sig = self.docstring_sig_re.search(line) |
|
688 | sig = self.docstring_sig_re.search(line) |
General Comments 0
You need to be logged in to leave comments.
Login now