From bb411e7bbcbd32266454e1ed54f2284a59c59873 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Fri, 21 Jun 2019 17:12:15 -0500 Subject: [PATCH] [zaycev.net]: Added settings GUI --- src/extractors/zaycev.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/extractors/zaycev.py b/src/extractors/zaycev.py index bbe2eaf..c3d5729 100644 --- a/src/extractors/zaycev.py +++ b/src/extractors/zaycev.py @@ -4,6 +4,7 @@ import re import json import requests import logging +import wx import config from bs4 import BeautifulSoup from . import base @@ -12,7 +13,8 @@ log = logging.getLogger("extractors.zaycev.net") class interface(base.baseInterface): name = "zaycev.net" - enabled = True + enabled = config.app["services"]["zaycev"].get("enabled") + print(enabled) def search(self, text, page=1): if text == "" or text == None: @@ -45,4 +47,16 @@ class interface(base.baseInterface): return data["url"] def format_track(self, item): - return "{0}. {1}. {2}".format(item.title, item.duration, item.size) \ No newline at end of file + return "{0}. {1}. {2}".format(item.title, item.duration, item.size) + +class settings(base.baseSettings): + name = _("zaycev.net") + config_section = "zaycev" + + def __init__(self, parent): + super(settings, self).__init__(parent=parent) + sizer = wx.BoxSizer(wx.VERTICAL) + self.enabled = wx.CheckBox(self, wx.NewId(), _("Enable this service (it only works in the Russian Federation)")) + self.map.append(("enabled", self.enabled)) + sizer.Add(self.enabled, 0, wx.ALL, 5) + self.SetSizer(sizer) \ No newline at end of file