Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tarbell shell #444

Open
eyeseast opened this issue Mar 27, 2017 · 0 comments
Open

Tarbell shell #444

eyeseast opened this issue Mar 27, 2017 · 0 comments
Milestone

Comments

@eyeseast
Copy link
Contributor

Here's a thing I do a lot:

>>> from tarbell.site import TarbellApp

# create a site
>>> site = TarbellApp('.')

# get a request context
>>> ctx = site.app.test_request_context()
>>> ctx.push()

# run through the pre-request hooks, so g.current_site works
>>> site.app.preprocess_request()

# now I can do things with site data
>>> context = site.get_context()
>>> print(context['title'])

It would be really nice to package all those steps into a little shell script, so I could run something like:

tarbell shell

And get:

>>> site
<tarbell.app.TarbellSite instance at 0x...>
@eyeseast eyeseast added this to the 2.0 milestone Mar 27, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant