Hello, <div><br></div><div>Thank you both, I'll look at this in more depth !</div><div><br></div><div>Regards,</div><div>Gaëtan</div><div><br><div class="gmail_quote">2010/11/27 Marc-Andre Belzile <span dir="ltr"><<a href="mailto:Marc-Andre.Belzile@autodesk.com">Marc-Andre.Belzile@autodesk.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I guess you could just define an entry-point in your source provider files that would return a specific instance of an InformationProvider class. This entry-point would be called by your main app (maybe at startup time or during an update phase).<br>


<br>
There are plenty of articles on the web about python plugins that could help you out, such as this one:<br>
<br>
 <a href="http://wehart.blogspot.com/2009/01/python-plugin-frameworks.html" target="_blank">http://wehart.blogspot.com/2009/01/python-plugin-frameworks.html</a><br>
<br>
-mab<br>
<br>
<br>
<br>
From: python-list-bounces+marc-andre.belzile=<a href="http://autodesk.com" target="_blank">autodesk.com</a>@<a href="http://python.org" target="_blank">python.org</a> [mailto:<a href="mailto:python-list-bounces%2Bmarc-andre.belzile">python-list-bounces+marc-andre.belzile</a>=<a href="http://autodesk.com" target="_blank">autodesk.com</a>@<a href="http://python.org" target="_blank">python.org</a>] On Behalf Of Gaëtan Podevijn<br>


Sent: Friday, November 26, 2010 12:46 PM<br>
To: <a href="mailto:python-list@python.org">python-list@python.org</a><br>
Subject: Kind of plugin system<br>
<div><div></div><div class="h5"><br>
Hello,<br>
<br>
Here is my problem.<br>
<br>
I need to get some informations from files stored on my filesystem, Flickr and Picasa. So the idea is to create a class (for instance, "InformationsProvider") that provides common methods for those three sources, then, for each source, I create a class that inherits from "InformationsProvider" such as "InformationsLocalProvider", "InformationsFlickrProvider" and "InformationPicasaProvider". It is clearly needed because the method to get the informations is totally different for each source (the connection with flickr or picasa for exemple).<br>


<br>
However, I'd like, in the future, to be able to add new source and thus, just add a new class that implements the methods from Provider. The thing is, I'd like to add only one class, and that the rest of the application is able to use that class without really knowing how many class there are.<br>


<br>
I'd have something like :<br>
for each provider that exists: get the informations file<br>
<br>
and if I add a new .py that implements a new provider (say Delicious of GMail), the code above takes account of the new class. It must be "dynamic".<br>
<br>
Could you help me with that ? I hope I was clear enough.<br>
<br>
Thanks a lot,<br>
<br>
Gaëtan<br>
<br>
<br>
</div></div></blockquote></div><br></div>