On Tue, Nov 30, 2010 at 6:26 AM, Stéphane Klein <[email protected]> wrote:
> Hi,
>
> in my project Pyramid project, I would like some commands to :
>
> * setup my database
> * inject demo datas
> * update xapian indexation
> * …
>
> to execute this command, I need to use a ".ini" configuration file.
>
> What is the better solution to do that ?
>
> 1. use something like "$ paster inject-demo-data development.ini" command ?
> how can I develop my "inject-demo-data" (use this information
> http://pythonpaste.org/script/developer.html#what-do-commands-look-like ?)
> 2. use setup.py console_scripts entry points ? How can I load ".ini"
> configuration file in my script
>
> What is the better and more "standard" solution ? 1. or 2. ?

'paster'. 'paster' is for application development and production.
'setup.py' is for installation tasks. 'setup.py' is not installed, so
it's not available on systems where you (or pip) delete the source
directory after installation.

To instantiate an application from an INI file, use
paste.deploy.loadwsgi.loadapp("config:" + PATH,
relative_to="DIRECTORY_CONTAINING_INI_FILE")

-- 
Mike Orr <[email protected]>

-- 
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.

Reply via email to