@@ -114,6 +114,49 @@ def wrapper():
114114 # Send the results to Alfred as XML
115115 self .wf .send_feedback ()
116116
117+ def handle_lib_list (self ):
118+
119+ # def wrapper():
120+ # return run_command("lib list")
121+
122+ libs = run_command ("lib list" )
123+
124+ if self .args .query :
125+ libs = self .wf .filter (self .args .query ,
126+ libs ,
127+ key = search_key_for_lib ,
128+ min_score = 20 )
129+
130+ for lib in libs :
131+ library = lib ["library" ]
132+ self .wf .add_item (title = library ['name' ] + "@" + library ['version' ],
133+ subtitle = library ['sentence' ],
134+ icon = ICON_WEB )
135+
136+ # Send the results to Alfred as XML
137+ self .wf .send_feedback ()
138+
139+ def handle_lib_search (self ):
140+
141+ def wrapper ():
142+ return run_command ("lib search" ).get ("libraries" , [])
143+
144+ libs = self .wf .cached_data ('libs' , wrapper , max_age = 300 )
145+
146+ if self .args .query :
147+ libs = self .wf .filter (self .args .query ,
148+ libs ,
149+ key = search_key_for_lib2 ,
150+ min_score = 20 )
151+
152+ for lib in libs :
153+ # library = lib["library"]
154+ self .wf .add_item (title = lib ['name' ] + "@" + lib ['latest' ]['version' ],
155+ subtitle = lib ['latest' ]['sentence' ])
156+
157+ # Send the results to Alfred as XML
158+ self .wf .send_feedback ()
159+
117160 def handle_version_none (self ):
118161
119162 version = run_command ("version" )
0 commit comments