Something like:
turbogears-admin shell <filename to execute>
I've implemented this in mine - just by changing the last part of
command.Shell.run to be:
if len(sys.argv) == 2:
# execute the initial data file
datafile = sys.argv[1]
execfile(datafile, globals(), locals)
else:
import code
code.interact(local=locals)
And the initial data file would have something like:
fred = Author(name="fred", email="fr...@fred.com")
first = Item(title="First post!", slug='first_post', body='This is my
first blog entry', author=fred)
.. to create all your base data without requiring any trickiness or
imports to get the right context.
Does this seem like something other people could use? I guess more
thought could go into tying this into application deployment and such,
as well as whether that's the best way to indicate the data file to
use.
Cheers,
xtian