daltonmatos / plugnplay

A Generic plug-in system for python applications
http://github.com/daltonmatos/plugnplay
GNU General Public License v2.0
56 stars 10 forks source link

Feature Request: recursive version of set_plugin_dirs #7

Open hugosenari opened 12 years ago

hugosenari commented 12 years ago

Another suggestion, One function to load plugin from dir module and submodules.

daltonmatos commented 12 years ago

Wouldn't this lead to a possible confusing loading proccess? Did you suggested this thinking about multi-file plugins ?

hugosenari commented 12 years ago

Here is my example https://github.com/hugosenari/pig

pig / pig pig / pig / core pig / pig / modules pig / pig / modules / maemo

Default version just add 'modules' and don't load plugins from 'maemo'. With this I can organize modules by target, with this users can create his 'meego' or 'android' submodules

daltonmatos commented 12 years ago

So you are saying that someone could create more folders like this?

pig/pig/modules/maemo
pig/pig/modules/android
pig/pig/modules/meego

If I understand correctly, loading all plugins from all three folders, for example adding pig/pig/modules with set_plugin_dirs(), would load the android implementation even when running on maemo/meego.

If this is correct, wouldn't this cause errors because some dependencies of one platform does not exist in the other?

hugosenari commented 12 years ago

Hi :)

This is more like pc client for cellphones, than phone app. One thing that I need to do, are split in two projects (or more), one for 'runner' and other for any else.

Remember my idea of a program that can launch python scripts, only to run in background for auxiliar porpouses?

Pig is this program. The idea is put anything that user want in /modules (implementing some of core interfaces). Future version can load /modules from userspace.

modules/maemo is one of scripts, current version read N900 dbus and notify new messages and calls in PC. Future version: new emails, and implement telepathy dbus client (chat, answer call request, etc), control media player, connections...

To control all, these are my alternativies: 1 - Create one big file /pig/pig/modules/maemo.py 2 - Create one litle file (/pig/pig/modules/maemo.py) that load dir (/pig/pig/modules/maemo_modules) 3 - Implement my own recursive version of set_plugindirs 4 - Create various files in /pig/pig/modules/maemo[feature_name].py