 
     #根据关键字搜索包
     searchPackage: (keyword, done)->
-
       return done @serverPackages, keyword if @serverPackages
 
-      return if @isFetching
-      @isFetching = yes
-      @fetchAllPackageFormServer().then (result)=>
-        console.log "fetch all packages info finished,total:#{result.length}"
-        @isFetching = no
-        @serverPackages = result
-        done @serverPackages, keyword
-      .catch (error)=>
-        @showTip "Sorry, can not connect to chameleon puzzle's server temporary."
 
     #从服务器拉取所有安装包信息
     fetchAllPackageFormServer:() ->
         Q.promise (resolve, reject, notify) =>
-          r = request.get "#{PuzzleServer}/api/packages?access_token=#{PuzzleAccessToken}&sequence=1", (err, res, body) =>
+          r = request.get "#{PuzzleServer}/api/packages?access_token=#{PuzzleAccessToken}&sequence=rating", (err, res, body) =>
             reject err if err
             data = JSON.parse(body)
             resolve data.packages

      @editor.on 'keyup', => @onSearchEnter()
      @installPathEditor.on 'click', => @choosePath()
      @installPathEditor.setText options.path if options.path

    attach: ->
      aPane = atom.workspaceView.getActivePane()


        @packageList.append cell

    showPopularPackage: (packages)->
      if !packages or packages.length is 0
        @showTip "No package on the server!"
      else
        @hideTip()
        packages = packages.slice 0, 10

      _.each packages, (pack, index)=>
        cell = new PackageListCell(
          info: pack
          callback: (view, repo)=>
            iPath = @installPathEditor.getText()
            return @choosePath() if !iPath
            view.setInstalling yes
            @installPackage iPath, pack.name, repo, ->
              view.setInstalling no
          )

        @popularList.append cell

    showTip: (text)->
      @searchTip.text text
      @searchTip.css 'display', 'block'
