Seulement dans pytone-2.1.0.mine/src: .config.py.swp Seulement dans pytone-2.1.0.mine/src: .hub.py.swp Seulement dans pytone-2.1.0.mine/src: .pytone.py.swp Seulement dans pytone-2.1.0.mine/src: PyTone.prof diff -rub --exclude='*pyc' pytone-2.1.0/src/config.py pytone-2.1.0.mine/src/config.py --- pytone-2.1.0/src/config.py 2004-07-28 22:04:37.000000000 +0200 +++ pytone-2.1.0.mine/src/config.py 2004-11-26 00:57:02.000000000 +0100 @@ -120,7 +120,16 @@ def _convert(self, s): return float(s) +class configlist(configitem): + def _check(self, s): + try: + items = s.split(',') + except: + raise ConfigError("Expecting list, got '%s'" % s) + + def _convert(self, s): + return s.split(',') class configcolor(configitem): @@ -616,13 +625,16 @@ rescan = configkeys("u U") shuffle = configkeys("r R") +class plugins(configsection): + torun = configlist('') + # # register known configuration sections # sections = ['mixerwindow', 'helpwindow', 'filelistwindow', 'database', 'iteminfowindow', 'logwindow', 'mixer', 'colors', 'playerwindow', 'playlistwindow', 'general', - 'inputwindow', 'network', 'player', 'keybindings'] + 'inputwindow', 'network', 'player', 'keybindings', 'plugins'] ############################################################################## # end configuration tree diff -rub --exclude='*pyc' pytone-2.1.0/src/events.py pytone-2.1.0.mine/src/events.py --- pytone-2.1.0/src/events.py 2004-07-25 14:10:36.000000000 +0200 +++ pytone-2.1.0.mine/src/events.py 2004-11-17 04:01:14.000000000 +0100 @@ -62,7 +62,6 @@ class activatefilelist(event): pass - class sendeventat(event): """ send event at alarmtime and every repeat seconds after (if diff -rub --exclude='*pyc' pytone-2.1.0/src/hub.py pytone-2.1.0.mine/src/hub.py --- pytone-2.1.0/src/hub.py 2004-07-19 19:58:06.000000000 +0200 +++ pytone-2.1.0.mine/src/hub.py 2004-11-26 01:00:14.000000000 +0100 @@ -151,7 +151,6 @@ If blocking is set, we wait for incoming events and requests """ - while not self.queue.empty() or blocking: item = self.queue.get() blocking = 0 Seulement dans pytone-2.1.0.mine/src: network.py~ diff -rub --exclude='*pyc' pytone-2.1.0/src/pytone.py pytone-2.1.0.mine/src/pytone.py --- pytone-2.1.0/src/pytone.py 2004-07-19 19:58:07.000000000 +0200 +++ pytone-2.1.0.mine/src/pytone.py 2004-11-26 00:46:39.000000000 +0100 @@ -109,6 +109,7 @@ import network network.unixserver(os.path.expanduser(config.network.socketfile)).start() + # Now that everything is setup, we can initialize the players. This has # to be done after all other services have been setup because # the players immediately start requesting a new song @@ -119,6 +120,33 @@ hub.hub.notify(events.quit(), 100) raise + +############################################################################## +# Plugins initialization +############################################################################## +initializedPlugins = [] + +# Adding the plugin to sys.path +sys.path.insert(0, os.path.expanduser('~/.pytone/plugins')) + +# Initializing the plugins determined in the config file +plugins = config.plugins.torun +for name in plugins: + plugin = __import__(name) + initializedPlugins.append(plugin.initialize()) + +# Now we put sys.path back to normal +del sys.path[0] + +# And now the plugins are all started +for plugin in initializedPlugins: + try: + plugin.start() + except: + # If a plugin cannot be started it's not really annoying + # TODO We should warn the user + pass + ############################################################################## # basic curses library setup... ##############################################################################