Skip to content

Commit 4a65184

Browse files
authored
Merge pull request #140 from jrom99/patch-1
Add tab-completion to findseq
2 parents fe17d0c + 9edfe38 commit 4a65184

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

findseq.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@
7070

7171

7272
def findseq(needle, haystack, selName=None, het=0, firstOnly=0):
73+
"""USAGE:
74+
findseq needle, haystack[, selName[, het[, firstOnly]]]
75+
"""
7376
# set the name of the selection to return.
7477
if selName == None:
7578
rSelName = "foundSeq" + str(random.randint(0, 32000))
@@ -374,8 +377,12 @@ def findseq(needle, haystack, selName=None, het=0, firstOnly=0):
374377
break
375378
cmd.delete("__h")
376379
return rSelName
377-
cmd.extend("findseq", findseq)
378380

381+
cmd.extend("findseq", findseq)
382+
cmd.findseq = findseq
383+
cmd.auto_arg[1]['findseq'] = [ cmd.object_sc, 'object', '']
384+
cmd.auto_arg[2]['findseq'] = [lambda: cmd.Shortcut(['het=1','firstOnly=1']), 'params', '']
385+
cmd.auto_arg[3]['findseq'] = [lambda: cmd.Shortcut(['het=1','firstOnly=1']), 'params', '']
379386

380387
def checkParams(needle, haystack, selName, het, firstOnly):
381388
"""

0 commit comments

Comments
 (0)