MonsterMagnet wrote:Wie hast Du Dir eigentlich die Plugin Installation vorgestellt?
Per Installer oder soll der User selber einen Ordner anlegen und
die Plugin Dateien einfügen ?
Ich würde ja die Installer Methode bevorzugen.
Wie und wo könnte man die Plugins dann hochladen ?
import win32api
import _winreg
import eg
fnList = (
('Play', 'Simulate a press on the play button', "/play"),
('Pause', 'Simulate a press on the pause button', "/pause"),
('Stop', 'Simulate a press on the stop button', "/stop"),
('PreviousTrack', 'Simulate a press on the previous track button', "/prev"),
('NextTrack', 'Simulate a press on the next track button', "/next"),
('Random', 'Simulate a press on the random button', "/rand"),
('Exit', 'Quits foobar', "/exit"),
('PlayPause', 'Simulate a press on the PlayPause button', "/playpause"),
('Show', 'Shows foobar', "/show"),
('Hide', 'Hides foobar', "/hide"),
('Run', 'Run foobar with its default settings', None),
)
class Foobar2000(eg.PluginClass):
name = 'Foobar2000'
description = "Adds support functions to control Foobar2000"
def __init__(self):
path = None
try:
fb = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,"Software\\foobar2000")
path,k =_winreg.QueryValueEx(fb,"InstallDir")
_winreg.CloseKey(fb)
except:
eg.PrintError("Foobar2000 installdir not found!")
group = self.AddGroup(self.name)
for tmp_name, tmp_description, tmp_value in fnList:
class tmp_action(eg.ActionClass):
name = tmp_name
description = tmp_description
value = tmp_value
def __call__(self):
try:
return win32api.ShellExecute(0, None,
"foobar2000.exe", self.value, path, 0)
except:
eg.PrintError("Foobar2000 installdir not found!")
tmp_action.__name__ = tmp_name
group.AddAction(tmp_action)
Users browsing this forum: No registered users and 1 guest