def run( self ): JFileTemple.moduleInit( __name__ ) try: self.__tlist = temple.getTempleList() except Exception, e: sublime.error_message( LOC["GET_TEMPLE_LIST_FAIL"] ) message( "REALY_ERROR:" + str(e), c = DEBUG )
def run( self, temp = None, dirs = None ): JFileTemple.moduleInit( __name__ ) self.__view = self.window.new_file() if dirs and len(dirs) > 0: self.__view.settings().set( "default_dir", dirs[0] ) message( LOC["CREATE_NEW_FILE"] ) try: self.__tlist = temple.getTempleList() if not temp: temple.showTempleList( self.__tlist, self.__getTempleIndex ) else: for item in self.__tlist: if os.path.basename( item ) == temp: self.__insertTempleContent( item ) break except Exception, e: sublime.error_message( LOC["CREATE_NEW_FILE_FAIL"] ) message( "REALY_ERROR:" + str(e), c = DEBUG )