Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/modules/console/complete_calltip.py')
-rw-r--r--release/scripts/modules/console/complete_calltip.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/release/scripts/modules/console/complete_calltip.py b/release/scripts/modules/console/complete_calltip.py
index 87fac9f4c07..29187297707 100644
--- a/release/scripts/modules/console/complete_calltip.py
+++ b/release/scripts/modules/console/complete_calltip.py
@@ -1,17 +1,22 @@
# Copyright (c) 2009 www.stani.be (GPL license)
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# ##### BEGIN GPL LICENSE BLOCK #####
#
-# This program 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 Lesser General Public License for more details.
+# This program 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.
#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# This program 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 this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
# <pep8-80 compliant>
@@ -168,7 +173,10 @@ def complete(line, cursor, namespace):
'abs(number) -> number\\nReturn the absolute value of the argument.'
"""
matches = []
+ word = ''
+ scrollback = ''
match = RE_DEF_COMPLETE.search(line[:cursor])
+
if match:
word = match.group(1)
func_word = match.group(2)
@@ -176,7 +184,7 @@ def complete(line, cursor, namespace):
func = eval(func_word, namespace)
except Exception:
func = None
- scrollback = ''
+
if func:
doc = get_doc(func)
argspec = get_argspec(func, doc=doc)
@@ -186,7 +194,5 @@ def complete(line, cursor, namespace):
elif doc:
scrollback += '\n' + doc
scrollback = reduce_newlines(scrollback)
- else:
- word = ''
- scrollback = ''
+
return matches, word, scrollback