Skip to content

Commit

Permalink
Merge pull request #147 from georgePadolsey/patch-1
Browse files Browse the repository at this point in the history
Update it to make example plugin code work with python 3
  • Loading branch information
guillermooo committed Apr 5, 2015
2 parents 86b1e49 + ec7ae96 commit aec54af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/extensibility/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ for plugins go, this a very bad one.
import sublime, sublime_plugin

from xml.etree import ElementTree as ET
from urllib import urlopen
import urllib

GOOGLE_AC = r"http://google.com/complete/search?output=toolbar&q=%s"

class GoogleAutocomplete(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
elements = ET.parse(
urlopen(GOOGLE_AC % prefix)
urllib.request.urlopen(GOOGLE_AC % prefix)
).getroot().findall("./CompleteSuggestion/suggestion")

sugs = [(x.attrib["data"],) * 2 for x in elements]
Expand Down

0 comments on commit aec54af

Please sign in to comment.