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:
authorCampbell Barton <ideasman42@gmail.com>2011-06-29 14:47:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-29 14:47:43 +0400
commitd86d68d4e64f7af9c6675481bd96d998620a353f (patch)
tree6888dd3592fc4d563c39416f67ba02d389cd0838
parentd8eb704784f503c45b5b727c72249b70bf095d70 (diff)
console autocomp import now excludes '_' prefixed variables and the results are sorted.
-rw-r--r--release/scripts/modules/bpy/__init__.py29
-rw-r--r--release/scripts/modules/console/intellisense.py6
2 files changed, 23 insertions, 12 deletions
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py
index 1df8e9e5588..6dcc5d7b285 100644
--- a/release/scripts/modules/bpy/__init__.py
+++ b/release/scripts/modules/bpy/__init__.py
@@ -22,24 +22,29 @@
Give access to blender data and utility functions.
"""
-# internal blender C module
-import _bpy
-from _bpy import types, props, app
+__all__ = (
+ "app",
+ "context",
+ "data",
+ "ops",
+ "path",
+ "props",
+ "types",
+ "utils",
+)
+
-data = _bpy.data
-context = _bpy.context
+# internal blender C module
+from _bpy import types, props, app, data, context
# python modules
-from . import utils, path
-from . import ops as _ops_module
+from . import utils, path, ops
# fake operator module
-ops = _ops_module.ops_fake_module
-
-import sys as _sys
-
+ops = ops.ops_fake_module
def _main():
+ import sys as _sys
# Possibly temp. addons path
from os.path import join, dirname, normpath
@@ -59,3 +64,5 @@ def _main():
_main()
+
+del _main \ No newline at end of file
diff --git a/release/scripts/modules/console/intellisense.py b/release/scripts/modules/console/intellisense.py
index b6de0c6c6de..a4793e1a9b6 100644
--- a/release/scripts/modules/console/intellisense.py
+++ b/release/scripts/modules/console/intellisense.py
@@ -53,7 +53,7 @@ RE_UNQUOTED_WORD = re.compile(
re.UNICODE)
-def complete(line, cursor, namespace, private=True):
+def complete(line, cursor, namespace, private):
"""Returns a list of possible completions:
* name completion
@@ -82,6 +82,10 @@ def complete(line, cursor, namespace, private=True):
if RE_MODULE.match(line):
from . import complete_import
matches = complete_import.complete(line)
+ print(private)
+ if not private:
+ matches[:] = [m for m in matches if m[:1] != "_"]
+ matches.sort()
else:
from . import complete_namespace
matches = complete_namespace.complete(word, namespace, private)