Le 30/11/2010 18:43, Mike Orr a écrit :
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.
More information about this idea :
"""
2. use setup.py console_scripts entry points ? How can I load ".ini"
configuration file in my script
"""
In my setup.py :
entry_points="""
...
[console_scripts]
myprojectname-export = myprojectname.scripts.export:main
myprojectname-import = myprojectname.scripts.import_:main
myprojectname-check = myprojectname.scripts.check:main
"""
After that, I do :
$ python setup.py develop
After this installation, I can use "myprojectname-export",
"myprojectname-import", "myprojectname-check" scripts from everywhere.
To use this script I don't need "setup.py".
With this complement information, what is better ? this scripts or
custom paster commands ?
If I would like use paster command outside source project, I need to use
"[paste.global_paster_command]" entry points section.
Regards,
Stephane
--
Stéphane Klein <[email protected]> - French
blog: http://stephane-klein.info
twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com
--
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.