There was an extension made to create commands based on TurboGears, I don't know if it is will maintained or not.
I have to admit that I always relied on 'paster shell' for such requirements, running: echo "import my_script; my_script.run()" | paster shell development.ini always worked quite well for me. I think we can easily extend gearbox tg-shell for 2.3 to enable passing a python script to be executed in the contest of the application itself. On Wed, May 29, 2013 at 9:09 PM, alonn <[email protected]> wrote: > I have a turbogears 2.1.3 app, that does various administrative scheduled > jobs (fetching JSON fron here => writing it with sqlalchemy there) > I also have a couple of helper functions that use the app models, engines > and basic functions that I need to run from time to time. > currently - the way I do it Is: > paster shell file.ine > from package.lib.helpers import somefunc > somefunc('file.csv') > > how can I package it as a python shell script so I could just call: > > python custom_script.py file.csv > > I know the script part but I'm not sure how the app models and sqlalchemy > engine would be initialized I guess I should initialize the tg app from the > script, but I don't know hoe. > > HELP please! > > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" 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/turbogears?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

