1414from time import sleep
1515
1616
17- __iid__ = "PythonInterface/v0.1"
18- __prettyname__ = "Api Test"
19- __version__ = "1.0"
20- __trigger__ = "test "
21- __author__ = "Manuel Schneider"
22- __dependencies__ = ["whatever" ]
17+ __title__ = "Api Test"
18+ __version__ = "0.4.2"
19+ __triggers__ = "test "
20+ __authors__ = "manuelschneid3r"
21+ #__exec_deps__ = ["whatever"]
2322
2423iconPath = iconLookup ("albert" )
2524
@@ -45,7 +44,7 @@ def handleQuery(query):
4544
4645 if query .string .startswith ("delay" ):
4746 sleep (2 )
48- return Item (id = __prettyname__ ,
47+ return Item (id = __title__ ,
4948 icon = os .path .dirname (__file__ )+ "/plugin.svg" ,
5049 text = "Delayed test item" ,
5150 subtext = "Query string: %s" % query .string )
@@ -71,7 +70,7 @@ def handleQuery(query):
7170 item .icon = iconPath
7271 item .text = 'Python item containing %s' % query .string
7372 item .subtext = 'Python description'
74- item .completion = __trigger__ + 'Completion Harharhar'
73+ item .completion = __triggers__ + 'Completion Harharhar'
7574 item .urgency = ItemBase .Notification # Alert, Normal
7675 info (item .icon )
7776 info (item .text )
@@ -83,11 +82,11 @@ def function(): info(query.string)
8382 item .addAction (FuncAction ("Print warning" , lambda : warning (query .string )))
8483 results .append (item )
8584
86- item = Item (id = __prettyname__ ,
85+ item = Item (id = __title__ ,
8786 icon = os .path .dirname (__file__ )+ "/plugin.svg" ,
8887 text = "This is the primary text" ,
8988 subtext = "This is the subtext, some kind of description" ,
90- completion = __trigger__ + 'Hellooohooo!' ,
89+ completion = __triggers__ + 'Hellooohooo!' ,
9190 urgency = ItemBase .Alert ,
9291 actions = [
9392 FuncAction (text = "FuncAction" ,
@@ -98,10 +97,14 @@ def function(): info(query.string)
9897 url = "https://www.google.de" ),
9998 ProcAction (text = "ProcAction" ,
10099 commandline = ["espeak" , "hello" ],
101- cwd = "~" ), # optional
100+ cwd = "~" ),
102101 TermAction (text = "TermAction" ,
103102 commandline = ["sleep" , "5" ],
104- cwd = "~/git" ) # optional
103+ cwd = "~/git" ),
104+ TermAction (text = "TermAction" ,
105+ script = "[ -e issue ] && cat issue | echo /etc/issue not found." ,
106+ behavior = TermAction .CloseBehavior .DoNotClose ,
107+ cwd = "/etc" )
105108 ])
106109 results .append (item )
107110
0 commit comments