On 12/16/2014 04:39 PM, pyramidX wrote:
What is the difference between component vs application in the way you
define it just wondering?
This might provide a concrete example:
<https://github.com/Pylons/substanced/blob/master/substanced/__init__.py#L4?
config.include('.evolution') for example includes something that
initializes the "evolution" machinery, which makes it possible to define
organized steps to upgrade the database from one state to another. It's
a "component" inasmuch as it's not really required for the rest of the
stuff to work. Most of the includes of stuff in that package are the
same. A person could choose to not use the "main" includeme and create
their own includeme which omitted some components as necessary.
On Tuesday, December 16, 2014 6:09:51 PM UTC+1, Randall Leeds wrote:
I've tried to make the distinction between what is my package as a
component and what is my package as an application.
So most of my stuff is in includeme, but my root factory config, a
status check route, and a favicon route are in main.
On Tue, Dec 16, 2014, 07:51 Michael Merickel <[email protected]
<javascript:>> wrote:
On Tue, Dec 16, 2014 at 5:48 AM, pyramidX <[email protected]
<javascript:>> wrote:
> I've seen includeme used in some examples of writing pyramid
tests, but I'm
> still not sure. If the idea is to allow tests to have a lot
of the context
> of the regular app, then shouldn't I instead move most of the
lines from
> main to includeme and allow tests to call
"config.include('myapp')"? In this
> case main would just basically return config.make_wsgi_app()
after calling
> includeme?
Yep, this is the approach that I take in my apps. The majority
of your
app's configuration should go into includeme functions as this
is a probably
the best point of modularity within your pyramid structure. You
can include certain features and not include others in tests
based on
things like this.
--
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from
it, send an email to pylons-discus...@__googlegroups.com
<javascript:>.
To post to this group, send email to
pylons-...@googlegroups.__com <javascript:>.
Visit this group at
http://groups.google.com/__group/pylons-discuss
<http://groups.google.com/group/pylons-discuss>.
For more options, visit https://groups.google.com/d/__optout
<https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google
Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.