On Mon, 2012-02-06 at 10:51 -0800, Jonathan Vanasco wrote:
> yep, know all that.
>
> I meant i wanted to know if anyone has automated this for production ,
> as part of a pyramid/deform integration package
>
> essentially the following:
>
> ---------------
>
> myapp/__init__.py
> from pyramid.events import ApplicationCreated
> from pyramid.events import subscriber
>
> config.add_subscriber('myapp.subscribers.deform_static_prep',
> 'pyramid.events.ApplicationCreated')
>
>
> myapp/subscribers/deform_static_prep.py
>
> import deform
> import os
>
> def deform_static_prep(event):
>
> static_subdir=
> event.request.registry.settings['deform.static_subdir']
>
> deform_dir= os.path.dirname(deform.__file__)
> deform_dir_static= os.path.join( deform_dir , 'static' )
>
> app_dir= os.path.dirname( myapp.__file__ )
> app_dir_static= os.path.join( app_dir , 'static' )
> app_dir_static_deform= os.path.join( app_dir_static ,
> static_subdir )
>
> if os.path.lexists(app_dir_static_deform):
> os.unlink(app_dir_static_deform)
>
> os.symlink( deform_dir_static, app_dir_static_deform )
>
No.. I'd never do that as part of an app. I might cause a build script
to do it, but I'd never make the app itself responsible.
- C
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.