Popular recipes tagged "plugin" but not "descriptor"http://code.activestate.com/recipes/tags/plugin-descriptor/2014-03-25T10:17:07-07:00ActiveState Code RecipesGimp Paperwhite Scriptfu (Python)
2014-03-25T10:17:07-07:00Alfehttp://code.activestate.com/recipes/users/4182236/http://code.activestate.com/recipes/578857-gimp-paperwhite-scriptfu/
<p style="color: grey">
Python
recipe 578857
by <a href="/recipes/users/4182236/">Alfe</a>
(<a href="/recipes/tags/gimp/">gimp</a>, <a href="/recipes/tags/image_processing/">image_processing</a>, <a href="/recipes/tags/paperwhite/">paperwhite</a>, <a href="/recipes/tags/plugin/">plugin</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/scriptfu/">scriptfu</a>).
</p>
<p>This Gimp-plugin (written in Python) changes a photograph of a paper document so that the paper background appears white again without overly lighting the text.</p>
PluginManager - Extending Project Functionality By Using Custom Modules/Plugins On The Fly. (Python)
2010-05-07T15:32:10-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577216-pluginmanager-extending-project-functionality-by-u/
<p style="color: grey">
Python
recipe 577216
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/extending/">extending</a>, <a href="/recipes/tags/extensible/">extensible</a>, <a href="/recipes/tags/modules/">modules</a>, <a href="/recipes/tags/plugin/">plugin</a>).
Revision 4.
</p>
<p>This demo shows how you can create and manage your own custom plugins for extending functionality in your Python projects. There are no safety wrappers in this demo for restricting plugins aside from that fact that plugins are run as an extention of a management class which is run in its own instance only receiving data passed to it by the RumModules method, that said security should ideally be applied to the ModuleAPI class, by restricting __builtins__ on eval calls and/or validating plugin content and parameters which can be done by extending the Prepaser Class. For a great recipe/demo of restricting eval call see <a href="http://code.activestate.com/recipes/496746" rel="nofollow">http://code.activestate.com/recipes/496746</a>. </p>
<p>That aside it was alot of fun to write and use. Enjoy</p>
<p>PS: you will need <a href="http://code.activestate.com/recipes/577144/" rel="nofollow">http://code.activestate.com/recipes/577144/</a> to import Xceptions</p>
Find all subclasses of a given class (Python)
2009-11-04T20:26:08-08:00Gabriel Genellinahttp://code.activestate.com/recipes/users/924636/http://code.activestate.com/recipes/576949-find-all-subclasses-of-a-given-class/
<p style="color: grey">
Python
recipe 576949
by <a href="/recipes/users/924636/">Gabriel Genellina</a>
(<a href="/recipes/tags/class/">class</a>, <a href="/recipes/tags/extending/">extending</a>, <a href="/recipes/tags/inheritance/">inheritance</a>, <a href="/recipes/tags/plugin/">plugin</a>, <a href="/recipes/tags/subclass/">subclass</a>, <a href="/recipes/tags/subclasses/">subclasses</a>, <a href="/recipes/tags/type/">type</a>).
Revision 3.
</p>
<p>itersubclasses(cls) returns a generator over all subclasses of cls, in depth first order. cls must be a new-style class; old-style classes are <em>not</em> supported.</p>
Component architecture through data descriptors and function decorators (Python)
2009-07-23T11:13:48-07:00Danny Ghttp://code.activestate.com/recipes/users/4164396/http://code.activestate.com/recipes/576852-component-architecture-through-data-descriptors-an/
<p style="color: grey">
Python
recipe 576852
by <a href="/recipes/users/4164396/">Danny G</a>
(<a href="/recipes/tags/abc/">abc</a>, <a href="/recipes/tags/abstract_base_class/">abstract_base_class</a>, <a href="/recipes/tags/component/">component</a>, <a href="/recipes/tags/interface/">interface</a>, <a href="/recipes/tags/plugin/">plugin</a>).
Revision 5.
</p>
<p>My desire was to design a class with defined attributes that when assigned on instances, would expand the instance's functionality. In other words if I create an instance of class A, then assign a 'component' attribute upon that instance, I should be able to call methods of the component object through the original instance. I believe this is somewhat similar to interfaces and abstract base classes (and I read up on both a bit), but I want to rely more on introspection of the object to see what it can do versus confining it to a set interface.</p>