/* This is a template command */

CmdUtils.CreateCommand({
  name: "python",
  icon: "http://python.org/favicon.ico",
  author: { name: "Mikeal Rogers", email: "mikeal.rogers@gmail.com"},
  license: "GPL",
  description: "Searches docs.python.org for your words.",

  takes: {"search term": noun_arb_text},

  preview: function(pblock, directObject, modifiers) {
      var query = directObject.text;
      var content = "Performs a docs.python.org search";
      if(query.length > 0)
        content += " for <b>" + query + "</b>";
      pblock.innerHTML = content;
    },

  execute: function(directObject, modifiers) {
    var query = directObject.text.replace(' ', '+');
    var urlString = "http://docs.python.org/search?q="+query+"&check_keywords=yes&area=default";
    Utils.openUrlInBrowser(urlString);
    CmdUtils.setLastResult( urlString );
  },

  previewDelay: 10,
});
