Re: [pylons-discuss] config in config files?

2017-08-07 Thread Michael Merickel
You need to write a loader for plaster that can handle yaml files and the
loader needs to satisfy the plaster.interfaces.IWSGIProtocol. No one has
stepped up quite yet to write any alternate file format loaders so you're
on your own there. The ability to do so is what's supported now.

That loader defines everything from how to parse the yaml file for settings
all the way up to how to invoke the main function of the app. For example,
the main(global_config, **settings) spec is defined by pastedeploy and is
not required by any other loaders. If you want to keep that same spec then
you probably have a fair amount of code you need to rip out of pastedeploy
(montague already did this work).

On Mon, Aug 7, 2017 at 2:01 AM, Chris Withers  wrote:

> On 03/08/2017 22:20, Bert JW Regeer wrote:
>
>>
>> I guess it is not entirely clear, but here’s docs for the two
> methods:
> https://docs.pylonsproject.org/projects/pyramid/en/latest/
> narr/environment.html#using-pastedeploy
>
>
> **settings is provided by your launcher, pserve will use plaster and
> call main() on your application that is registered with setup tools and
> provide the settings dictionary to do with as you please.
>

 With Steve's pointer to plaster, this sounds great, but how do I tell
 pserve to use plaster?

>>>
>>> Sorry, also forgot to ask: I can see how the config.include(...) call
>>> can be triggered from settings, but how would I do the same for the
>>> ldap* methods?
>>>
>>
>>
>> You’d have to write some custom code to automatically make those calls,
>> but you can use the settings dictionary to pull out the values you need.
>>
>
> Okay, stepping back, if I wanted to replace my production.ini with a
> production.yaml, what do I need to change and where?
>
> cheers,
>
> Chris
>
> --
> 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-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pylons-discuss/f6d70888-ca0e-5c7b-02a1-85c2e59e5b77%40withers.org.
>
> 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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwEi3dvH_BeC1c4B3nLkCGeL5qq0wL_28e66dTC-dBfdDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-07 Thread Chris Withers

On 03/08/2017 22:20, Bert JW Regeer wrote:



I guess it is not entirely clear, but here’s docs for the two
methods:
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy


**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


With Steve's pointer to plaster, this sounds great, but how do I tell
pserve to use plaster?


Sorry, also forgot to ask: I can see how the config.include(...) call
can be triggered from settings, but how would I do the same for the
ldap* methods?



You’d have to write some custom code to automatically make those calls,
but you can use the settings dictionary to pull out the values you need.


Okay, stepping back, if I wanted to replace my production.ini with a 
production.yaml, what do I need to change and where?


cheers,

Chris

--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/f6d70888-ca0e-5c7b-02a1-85c2e59e5b77%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Bert JW Regeer

> On Aug 3, 2017, at 15:07, Chris Withers  > wrote:
> 
> 
> 
> On 03/08/2017 22:04, Chris Withers wrote:
>> On 03/08/2017 19:12, Bert JW Regeer wrote:
>>> You can grab it from a .ini or wherever when using the latest Pyramid
>>> with plaster support (write your own loader to load it from yaml files
>>> for example).
>>> 
>>> I guess it is not entirely clear, but here’s docs for the two
>>> methods:
>>> https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy
>>>  
>>> 
>>> 
>>> 
>>> **settings is provided by your launcher, pserve will use plaster and
>>> call main() on your application that is registered with setup tools and
>>> provide the settings dictionary to do with as you please.
>> 
>> With Steve's pointer to plaster, this sounds great, but how do I tell
>> pserve to use plaster?
> 
> Sorry, also forgot to ask: I can see how the config.include(...) call can be 
> triggered from settings, but how would I do the same for the ldap* methods?


You’d have to write some custom code to automatically make those calls, but you 
can use the settings dictionary to pull out the values you need.

> 
> cheers,
> 
> Chris
> 
> -- 
> 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-discuss+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to pylons-discuss@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/117c5e87-7148-0d1f-f781-2dcff35a86a6%40withers.org
>  
> .
> 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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/825F6BC4-EC65-47F3-8BCC-A290C6F0821D%400x58.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Michael Merickel
pserve and all pyramid tools use plaster under the hood as of 1.9.

plaster was a significant enough redesign from montague that it felt like
it warranted being a new library.

- Michael

On Thu, Aug 3, 2017 at 4:06 PM, Chris Withers  wrote:

> Hey Steve,
>
> Hope it's all going well too :-)
>
> On 03/08/2017 20:27, Steve Piercy wrote:
>
>> On 8/3/17 at 8:12 PM, ch...@withers.org (Chris Withers) pronounced:
>>
>> What's plaster?
>>>
>>
>> https://docs.pylonsproject.org/projects/plaster/en/latest/
>>
>
> Cool, more out of curiosity than anything: how came montague had to be
> re-implemented as plaster rather than just being polished up to 1.0?
>
> cheers,
>
> Chris
>
> --
> 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-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/pylons-discuss/e339c944-7a62-d6cc-bf86-0a707cb68a15%40withers.org.
>
> 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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwFXRJ42qBpOGZDrCm3JsEUgM882kiFbC9p11aNEVFicjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers



On 03/08/2017 22:04, Chris Withers wrote:

On 03/08/2017 19:12, Bert JW Regeer wrote:

You can grab it from a .ini or wherever when using the latest Pyramid
with plaster support (write your own loader to load it from yaml files
for example).

I guess it is not entirely clear, but here’s docs for the two
methods:
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy


**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


With Steve's pointer to plaster, this sounds great, but how do I tell
pserve to use plaster?


Sorry, also forgot to ask: I can see how the config.include(...) call 
can be triggered from settings, but how would I do the same for the 
ldap* methods?


cheers,

Chris

--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/117c5e87-7148-0d1f-f781-2dcff35a86a6%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

Hey Steve,

Hope it's all going well too :-)

On 03/08/2017 20:27, Steve Piercy wrote:

On 8/3/17 at 8:12 PM, ch...@withers.org (Chris Withers) pronounced:


What's plaster?


https://docs.pylonsproject.org/projects/plaster/en/latest/


Cool, more out of curiosity than anything: how came montague had to be 
re-implemented as plaster rather than just being polished up to 1.0?


cheers,

Chris

--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/e339c944-7a62-d6cc-bf86-0a707cb68a15%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

On 03/08/2017 19:12, Bert JW Regeer wrote:

You can grab it from a .ini or wherever when using the latest Pyramid
with plaster support (write your own loader to load it from yaml files
for example).

I guess it is not entirely clear, but here’s docs for the two
methods: 
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy

**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


With Steve's pointer to plaster, this sounds great, but how do I tell 
pserve to use plaster?


cheers,

Chris

--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/7f3fcdb8-655c-33bc-c516-b1a38488ea8d%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Steve Piercy

On 8/3/17 at 8:12 PM, ch...@withers.org (Chris Withers) pronounced:


What's plaster?


https://docs.pylonsproject.org/projects/plaster/en/latest/

--steve


Steve Piercy, Soquel, CA

--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/r473Ps-10126i-942AA119C1544537A5F7B8254AC172B4%40Steves-iMac.local.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

Hi Bert,

Long time no speak, hope you're well!

On 03/08/2017 19:12, Bert JW Regeer wrote:

You can grab it from a .ini or wherever


"or wherever" preferable ;-)


when using the latest Pyramid
with plaster support (write your own loader to load it from yaml files
for example).


What's plaster?



I guess it is not entirely clear, but here’s docs for the two
methods: 
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy

**settings is provided by your launcher, pserve will use plaster and
call main() on your application that is registered with setup tools and
provide the settings dictionary to do with as you please.


Hoping plaster is something cool, not a typo...

cheers,

Chris


On Aug 3, 2017, at 12:08, Chris Withers > wrote:

Hi All,

Once more determined to actually build something in pyramid, going to
settle on a REST server to feed a web front end and likely a cli tool too.
Looking for advice on best bits to use, but in the meantime, looking at:

https://docs.pylonsproject.org/projects/pyramid_ldap/en/latest/#usage

...I see a bunch of config in a python file, which is what I hate most
about Django.

I would expect to see AuthTktAuthenticationPolicy's secret and ldap
queries and password all coming from a config file.
What's the pattern for this with Pyramid? Also curious what the best
way is to structure an app beyond a trivial one-file-r like that ;-)
In my head, I'm surprised to see the configurator growing ldap_*
methods (I guess added by the config.include('pyramid_ldap')?)

My ageing memory has something in it about .ini format files, but I
know there was some talk of making the config file format pluggable,
how did that pan out?

Excitedly yours,

Chris


--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/fd1d91f4-8e6b-cf46-232d-4b9e05f0ac9f%40withers.org.
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 pylons-discuss+unsubscr...@googlegroups.com
.
To post to this group, send email to pylons-discuss@googlegroups.com
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/A70D0947-EE8B-4254-869F-5B123509C1F4%400x58.com
.
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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/f64259b8-323e-4aec-db45-dd448683b6ee%40withers.org.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] config in config files?

2017-08-03 Thread Bert JW Regeer
You can grab it from a .ini or wherever when using the latest Pyramid with 
plaster support (write your own loader to load it from yaml files for example).


I guess it is not entirely clear, but here’s docs for the two methods: 
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#using-pastedeploy
 


**settings is provided by your launcher, pserve will use plaster and call 
main() on your application that is registered with setup tools and provide the 
settings dictionary to do with as you please.

Bert

> On Aug 3, 2017, at 12:08, Chris Withers  wrote:
> 
> Hi All,
> 
> Once more determined to actually build something in pyramid, going to settle 
> on a REST server to feed a web front end and likely a cli tool too.
> Looking for advice on best bits to use, but in the meantime, looking at:
> 
> https://docs.pylonsproject.org/projects/pyramid_ldap/en/latest/#usage
> 
> ...I see a bunch of config in a python file, which is what I hate most about 
> Django.
> 
> I would expect to see AuthTktAuthenticationPolicy's secret and ldap queries 
> and password all coming from a config file.
> What's the pattern for this with Pyramid? Also curious what the best way is 
> to structure an app beyond a trivial one-file-r like that ;-)
> In my head, I'm surprised to see the configurator growing ldap_* methods (I 
> guess added by the config.include('pyramid_ldap')?)
> 
> My ageing memory has something in it about .ini format files, but I know 
> there was some talk of making the config file format pluggable, how did that 
> pan out?
> 
> Excitedly yours,
> 
> Chris
> 
> 
> -- 
> 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-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/fd1d91f4-8e6b-cf46-232d-4b9e05f0ac9f%40withers.org.
> 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 pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/A70D0947-EE8B-4254-869F-5B123509C1F4%400x58.com.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] config in config files?

2017-08-03 Thread Chris Withers

Hi All,

Once more determined to actually build something in pyramid, going to 
settle on a REST server to feed a web front end and likely a cli tool too.

Looking for advice on best bits to use, but in the meantime, looking at:

https://docs.pylonsproject.org/projects/pyramid_ldap/en/latest/#usage

...I see a bunch of config in a python file, which is what I hate most 
about Django.


I would expect to see AuthTktAuthenticationPolicy's secret and ldap 
queries and password all coming from a config file.
What's the pattern for this with Pyramid? Also curious what the best way 
is to structure an app beyond a trivial one-file-r like that ;-)
In my head, I'm surprised to see the configurator growing ldap_* methods 
(I guess added by the config.include('pyramid_ldap')?)


My ageing memory has something in it about .ini format files, but I know 
there was some talk of making the config file format pluggable, how did 
that pan out?


Excitedly yours,

Chris


--
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-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/fd1d91f4-8e6b-cf46-232d-4b9e05f0ac9f%40withers.org.
For more options, visit https://groups.google.com/d/optout.