[spp] [PATCH 06/13] controller: add filter for py to compl_common
ogawa.yasufumi at lab.ntt.co.jp
ogawa.yasufumi at lab.ntt.co.jp
Tue Mar 6 11:50:48 CET 2018
From: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
To filter python code with comple_common() method, add a case for
matching '.py' source files.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi at lab.ntt.co.jp>
---
src/controller/shell_lib/common.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/controller/shell_lib/common.py b/src/controller/shell_lib/common.py
index d011684..b4e8fb9 100644
--- a/src/controller/shell_lib/common.py
+++ b/src/controller/shell_lib/common.py
@@ -66,6 +66,10 @@ def compl_common(text, line, ftype=None):
for fn in res:
if fn[-1] == '/':
completions.append(fn)
+ elif ftype == 'py' or ftype == 'python':
+ for fn in res:
+ if fn[-3:] == '.py':
+ completions.append(fn)
elif ftype == 'file':
for fn in res:
if fn[-1] != '/':
--
2.13.1
More information about the spp
mailing list