Skip to content

Tarbell shell #444

@eyeseast

Description

@eyeseast

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions