Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ui: added apikey getters and setters

Added the methods apikey_get and apikey_set in order to manage
the apikey of the backend using its D-Bus interface.

Signed-off-by: Antonio Arias <antonio.arias@gmail.com>
  • Loading branch information...
commit f0a4de55670dde483e537698d6b28ae851a64851 1 parent 4d42abb
@antonioarlo authored ceyusa committed
Showing with 23 additions and 0 deletions.
  1. +23 −0 ui/gtk/traktor/feed_server.py
View
23 ui/gtk/traktor/feed_server.py
@@ -25,6 +25,21 @@ def __init__(self):
self.last_result = None
self.error = None
+ def apikey_get(self):
+ try:
+ apikey= self.iface.Apikey_get()
+ except dbus.exceptions.DBusException:
+ print("ERROR: Unable to connect")
+ raise
+ return apikey
+
+ def apikey_set(self, apikey):
+ try:
+ self.iface.Apikey_set(apikey)
+ except dbus.exceptions.DBusException:
+ print("ERROR: Unable to connect")
+ raise
+
def search(self, query, callback=None, query_type=SEARCH_MOVIES_TYPE):
self._callback = callback
try:
@@ -70,6 +85,14 @@ def on_reply(self):
if self._callback != None:
self._callback(self.last_result)
+def test_feed_change_apikey():
+ feed_server = FeedServer()
+ old_apikey = feed_server.apikey_get();
+ print("old apikey: " + old_apikey)
+ feed_server.apikey_set("1234")
+ print("new apikey: " + feed_server.apikey_get())
+ feed_server.apikey_set(old_apikey)
+ print(" apikey: " + feed_server.apikey_get())
def test_feed_server_movie():
feed_server = FeedServer()
Please sign in to comment.
Something went wrong with that request. Please try again.