def on_input(self, value): if value != "": out, err = runcmd(["haxelib", "install", value]) outlines = out.splitlines() sublime.status_message(str(outlines)) self.window.show_quick_panel(outlines, None, sublime.MONOSPACE_FONT) else: self.window.show_quick_panel( [["Invalid library name", "Hit return to try again, escape to cancel"]], self.on_invalid )
def do_update(self, library): sublime.status_message("Please wait, updating haxelib " + library) settings = self.window.active_view().settings() haxelib_path = settings.get("haxelib_path", "haxelib") out, err = runcmd([haxelib_path, "update", library]) sublime.status_message(str(out)) show_quick_panel(self.window, out.splitlines(), None)
def do_update(self,library): sublime.status_message("Please wait, updating haxelib " + library); settings = self.window.active_view().settings() haxelib_path = settings.get("haxelib_path","haxelib") out,err = runcmd([haxelib_path , "update", library]); sublime.status_message(str(out)) show_quick_panel(self.window, out.splitlines(), None)
def on_input(self, value): settings = self.window.active_view().settings() haxelib_path = settings.get("haxelib_path","haxelib") if(value != ""): out,err = runcmd([haxelib_path , "install", value]); outlines = out.splitlines() sublime.status_message(str(outlines)); self.window.show_quick_panel(outlines, None, sublime.MONOSPACE_FONT) else: self.window.show_quick_panel( [["Invalid library name","Hit return to try again, escape to cancel"]], self.on_invalid )
def run(self): out,err = runcmd(["haxelib" , "search"], " \n \n \n"); lines = out.splitlines() #remove the initial prompt lines[0] = lines[0].replace("Search word : ","") #sort alphabetically lines = sorted( lines, cmp=lambda x,y: cmp(x.lower(), y.lower()) ) #store for later self.libs = lines #show list show_quick_panel(self.window,lines,self.on_lib_select)
def run(self, paths = [] , t = "list"): self.action = t out,err = runcmd(["haxelib" , "list"]); libs = out.splitlines() self.libs = [] menu = [] for _lib in libs : libname,libcurrent,libversions = self.haxelib_parse_libversions(_lib) menu.append([ libname + " " + libcurrent , libversions ]) self.libs.append(libname) self.window.show_quick_panel( menu, self.on_select )
def do_action(self,action,library): settings = self.window.active_view().settings() haxelib_path = settings.get("haxelib_path","haxelib") out,err = runcmd([ haxelib_path , action, self.selected]); lines = out.splitlines() # the description can be rather long, # so we just split it up some if action == "install": show_quick_panel(self.window,lines,None) return if action == "info": max_length = 60 #store the desc desc = lines[2] #remove it from the list del lines[2] #wrap it neatly descsplit = textwrap.wrap(desc,max_length) #now replace the Desc: into it's own line descsplit[0] = descsplit[0].replace('Desc: ','') descsplit.append('') descsplit.reverse() #reinsert for d in descsplit: lines.insert(2,"\t\t"+d) #and the desc header lines.insert(2, 'Desc: ') for index, line in enumerate(lines): length = len(line) if(length > max_length): split_lines = textwrap.wrap(line,max_length) lines[index] = split_lines[0] + ' ...' show_quick_panel(self.window,lines,None)
def run(self, paths=[], t="list"): self.action = t settings = self.window.active_view().settings() haxelib_path = settings.get("haxelib_path", "haxelib") out, err = runcmd([haxelib_path, "list"]) libs = out.splitlines() self.libs = [] menu = [] for _lib in libs: libname, libcurrent, libversions = self.haxelib_parse_libversions( _lib) menu.append([libname + " " + libcurrent, libversions]) self.libs.append(libname) self.window.show_quick_panel(menu, self.on_select)
def run(self): settings = self.window.active_view().settings() haxelib_path = settings.get("haxelib_path","haxelib") out,err = runcmd([ haxelib_path , "search"], " \n \n \n"); lines = out.splitlines() if len(lines) > 0 : #remove the initial prompt lines[0] = lines[0].replace("Search word : ","") #sort alphabetically lines = sorted( lines , key = str.lower ) #store for later self.libs = lines #show list show_quick_panel(self.window,lines,self.on_lib_select)
def run(self): out,err = runcmd(["haxelib" , "upgrade"]); self.window.show_quick_panel(out.splitlines(), None)
def do_update(self,library): sublime.status_message("Please wait, updating haxelib " + library); out,err = runcmd(["haxelib" , "update", library]); sublime.status_message(str(out)) show_quick_panel(self.window, out.splitlines(), None)