Add available extractors dynamically from imports of extractors package
This commit is contained in:
parent
d0491d8dd0
commit
99d02c97f0
@ -32,7 +32,7 @@ class Controller(object):
|
|||||||
# Setting up the player object
|
# Setting up the player object
|
||||||
player.setup()
|
player.setup()
|
||||||
# Get main window
|
# Get main window
|
||||||
self.window = mainWindow.mainWindow()
|
self.window = mainWindow.mainWindow(extractors=[i.name for i in get_extractors()])
|
||||||
log.debug("Main window created")
|
log.debug("Main window created")
|
||||||
self.window.change_status(_(u"Ready"))
|
self.window.change_status(_(u"Ready"))
|
||||||
# Here we will save results for searches as song objects.
|
# Here we will save results for searches as song objects.
|
||||||
|
@ -15,7 +15,7 @@ YOUTUBE_API_VERSION = "v3"
|
|||||||
log = logging.getLogger("extractors.youtube.com")
|
log = logging.getLogger("extractors.youtube.com")
|
||||||
|
|
||||||
class interface(object):
|
class interface(object):
|
||||||
name = "youtube"
|
name = "YouTube"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.results = []
|
self.results = []
|
||||||
|
@ -32,7 +32,7 @@ class mainWindow(wx.Frame):
|
|||||||
mb.Append(help_, _(u"Help"))
|
mb.Append(help_, _(u"Help"))
|
||||||
self.SetMenuBar(mb)
|
self.SetMenuBar(mb)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, extractors=[]):
|
||||||
super(mainWindow, self).__init__(parent=None, id=wx.NewId(), title=application.name)
|
super(mainWindow, self).__init__(parent=None, id=wx.NewId(), title=application.name)
|
||||||
self.Maximize(True)
|
self.Maximize(True)
|
||||||
self.makeMenu()
|
self.makeMenu()
|
||||||
@ -45,7 +45,7 @@ class mainWindow(wx.Frame):
|
|||||||
box.Add(lbl2, 0, wx.GROW)
|
box.Add(lbl2, 0, wx.GROW)
|
||||||
box.Add(self.text, 1, wx.GROW)
|
box.Add(self.text, 1, wx.GROW)
|
||||||
box.Add(wx.StaticText(self.panel, wx.NewId(), _(u"Search in")), 0, wx.GROW)
|
box.Add(wx.StaticText(self.panel, wx.NewId(), _(u"Search in")), 0, wx.GROW)
|
||||||
self.extractor = wx.ComboBox(self.panel, wx.NewId(), choices=["youtube", "tidal", "mail.ru", "zaycev.net"], value="youtube", style=wx.CB_READONLY)
|
self.extractor = wx.ComboBox(self.panel, wx.NewId(), choices=extractors, value=extractors[0], style=wx.CB_READONLY)
|
||||||
box.Add(self.extractor, 1, wx.GROW)
|
box.Add(self.extractor, 1, wx.GROW)
|
||||||
self.search = wx.Button(self.panel, wx.NewId(), _(u"Search"))
|
self.search = wx.Button(self.panel, wx.NewId(), _(u"Search"))
|
||||||
self.search.SetDefault()
|
self.search.SetDefault()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user