We have not fully agreed on the spec of PluginManager, it has been
added as a proof of concept, however no plugins to date have been
implemented with it. There are hundreds of posts debated what it
should do.

Currently the spec for plugins is you can do anything you want as long
as it has the word plugin_ in front of it.

PluginManager is an attempt to clean up the global namespace, so you
don't have tons of plugins littering with their own variables and
such.

Not sure if you have seen this...
http://static.thadeusb.com/Web2py%20Plugin%20Specification.pdf

--
Thadeus





On Wed, Jun 9, 2010 at 5:08 AM, AsmanCom <d.as...@web.de> wrote:
> env(a, import_models=False, c=1, f=1, dir='', extra_request={})
>
> Return web2py execution environment for application (a), controller
> (c), function (f). If import_models is True the exec all application
> models into the environment.
> extra_request allows you to pass along any extra variables to the
> request object before your models get executed. This was mainly done
> to support web2py_utils.test_runner, however you can use it with any
> wrapper scripts that need access to the web2py environment.
>
> On 8 Jun., 05:42, Doug Warren <doug.war...@gmail.com> wrote:
>> So I'm writing a plugin to handle scheduling of tasks with a dynamic
>> granularity of a second or less, and I went to use PluginManger per
>> it's definition in tools.py:
>> class PluginManager(dict):
>>     """
>>     This object stored parameters to configure plugins (if they need
>> configuration)
>>     In models/db.py instantiate the PluginManager
>>
>>     plugins=PluginManager()
>>
>>     then set the parameters required plugins, for example
>>
>>     plugins.comments.db=db
>>
>>     (each plugin should have a documented set of required parameters)
>>     """
>>
>> My code:
>> plugins = PluginManager()
>> db = plugins.plugin_scheduler.db or None
>>
>> if db is not None:
>>     db.define_table(plugins.plugin_scheduler.table_name or
>> 'plugin_scheduler_table',
>>                 db.Field('execution_time', 'datetime', default=request.now),
>>                 db.Field('controller', 'string'),
>>                 db.Field('function', 'string')
>>                 )
>>
>> Only problem...
>>     def __init__(self,env):
>>         self['globals'] = env
>>
>> What's that env?  Has anyone written a plugin that uses PluginManager?
>>  I checked on the official site and none seem to be using it...  If
>> it's request.env shouldn't it have a default arg of None?  Am I using
>> it as it was expected to be used?
>

Reply via email to