On Wed, Oct 21, 2009 at 2:50 PM, mdipierro <[email protected]> wrote:

>
> As far as I am concerned think there are the only rules we need to
> follow:
>
> 1) a naming convention:
>
>    models/plugin_[name].py
>    controllers/plugin_[name].py
>    */plugin_[name]/*
>

This convention is spaghetti source - it is crap; I do not like it in the
least, and see absolutely no reason to even consider it.

It will only lead to confusion, and novices learning to have to manage all
sorts of code they should not be looking at, knowing about the internal
details (modularity - remember?!) - and if this is a teaching system, even
the more.

I want to see you just DROP this convention.
I'll repeat.  It is crap.

As Thadeus points out (and I only vaguely remember - it may need more
discussion) - Mr. Freeze proposes something more appropriately structured.

Look at it again, more seriously.



>
> 2)  models/plugin_[name].py can assume ONLY db, auth, crud, T
>

auth, crud, T are gluon defined; that's ok.

db is an application level variable, so that seems potentially problematic,
an assumption - this either needs to be NOT shared, or a way for the
application to configure it for plugins is needed.


>
> 3)  models/plugin_[name].py should define only one global object
>
>    plugin_[name]=dict()
>

Ugh!

Well, this is ONE way to do plugin registration so the system know what is
there.  It's uglly, and brut force.  I don't even want to critique it
because, as I've said before, the IMPORTANT point is:

-  The running app needs a way to discover what plugins are available, and
there must be a way for the plugin to somehow registrer it's presence.

Now:  WHAT are the important things an app / web2py  instance must know
about the plugin?

- version?
- name?
- is it using / expecting app db connection?
- is it creating own db connecntion?

We should make a big list, and narrow it down to reasonable things later.

This has not been done, and is one reason why discovery (and associated
problems because of that) doesnt' yet exist.


>
> 4) plugin can only use one session variable
>
>   session.plugin_[name]=dict()
>

Ugh - this (again) is a solution.

STate the PROBLEM!


>
> I see some issues with plugins that want to define cron jobs but I
> would consider this an advanced topic.
>

Forget this now - you need to focus on getting the BASICS in place first!
@$%^&###

>
> Massimo
>

- Yarko


>
> On Oct 21, 2:35 pm, Thadeus Burgess <[email protected]> wrote:
> > Here is what I would want.
> >
> > Download a plugin...
> >
> > Install it on my app...
> >
> > Define default variables for the plugin to use (things like the database,
> > etc.. etc..)
> >
> > Expose it in my controllers, passing it optional parameters...
> >
> > Be happy.
> >
> > I volunteer to create and host web2py-plugincentral.com (or if anybody
> has a
> > better name) to manage and browse plugins.
> >
> > In fact, I have already started working on it. Do we still need a way to
> > package plugins? If so I could work on that as well while I am at it.
> >
> > Plugin installation should work just like app installation, either browse
> > and upload, or specify external location it could be downloaded from.
> >
> > Personally, I have been wracking my brain for the last 30 minutes to try
> to
> > find something that LOAD would not provide, and not seeing much wrong
> with
> > it.
> >
> > It would be nice to be able to access a plugins global vars, but see no
> > reason in this.
> >
> > Are plugins also able to take advantage of services? If I have a plugin
> that
> > returned json or html depending on what is returned from ajax.
> >
> > I think plugins should be responsible for refreshing themselves, form
> > trapping is nice, but it limits what could be done, easy, but limiting.
> >
> > -Thadeus
> >
> > On Wed, Oct 21, 2009 at 1:42 PM, mdipierro <[email protected]>
> wrote:
> > > ose of a plugin, as I intend it, is not to replace the concept
> > > of python modules (i.e. pieces of codes that you import once and are
> > > available everywhere), it is not to create
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to