From 0d70b59b3cffdc04eef6f70b0e7efaa6046a9012 Mon Sep 17 00:00:00 2001 From: neikei Date: Sun, 24 Nov 2019 12:23:14 +0100 Subject: [PATCH] Modifications for api version 2.0 --- main.py | 8 ++------ manifest.json | 3 +-- version.json | 4 ++++ 3 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 version.json diff --git a/main.py b/main.py index 118cd33..aeb00de 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ import logging -import urllib +import urllib.request, urllib.parse, urllib.error from ulauncher.api.client.Extension import Extension from ulauncher.api.client.EventListener import EventListener @@ -12,11 +12,8 @@ LOGGER = logging.getLogger(__name__) # to encode URL - - def urlencode(qp): - return urllib.urlencode(qp) - + return urllib.parse.urlencode(qp) class DUCKExtension(Extension): @@ -24,7 +21,6 @@ def __init__(self): super(DUCKExtension, self).__init__() self.subscribe(KeywordQueryEvent, KeywordQueryEventListener()) - class KeywordQueryEventListener(EventListener): def on_event(self, event, extension): diff --git a/manifest.json b/manifest.json index f5dd4fd..96a5023 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,5 @@ { - "manifest_version": "2", - "api_version": "1", + "required_api_version": "^2.0.0", "name": "Duckduckgo extension", "description": "To use duckduckgo search engine", "developer_name": "Akash Reddy", diff --git a/version.json b/version.json new file mode 100644 index 0000000..c9a4237 --- /dev/null +++ b/version.json @@ -0,0 +1,4 @@ +[ + {"required_api_version": "^2.0.0", "commit": "master"} +] + \ No newline at end of file