The Artima Developer Community
Sponsored Link

Python Buzz Forum
TracPaste & CherryPaste

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
TracPaste & CherryPaste Posted: Feb 13, 2006 9:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: TracPaste & CherryPaste
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

As a kind of first-experiment both in appropriating another package and in poking Paste (and setuptools) conventions into a package, I have Trac now working with Paste, both the WSGI side (using their WSGI branch) and the installation. It works like this:

easy_install 'PasteScript[Cheetah]==dev' 'PasteDeploy==dev' 'Paste>=0.4.1'
paster make-config TracPaste mypackage
# You can edit mypackage/conf/trac.ini now
paster setup-app mypackage/conf/trac.ini
paster serve mypackage/conf/trac.ini

And that's all you need to setup a project. Now, you might say that this is not really much easier than Trac is normally. Except, of course, you now can run it with Paste. You are probably not impressed.

But it does use a clever easy_install hack. TracPaste is in the Cheese Shop, but has no packages yet -- purely svn. The WSGI branch of Trac isn't in the Cheese Shop, but I can link to it from the TracPaste page, and get easy_install to automatically install it by using the requirement Trac==wsgi,==1.0dev -- the branch itself is labelled 1.0dev, but I put a link to the branch with #egg=Trac-wsgi appended. You have to give both versions because easy_install will download based on that link (guessing that ==wsgi will match), but the result installation does not satisfy the ==wsgi requirement since it is marked upstream as 1.0dev.

Paste Script also uses two-phase install. trac-admin uses an interactive installation, where it asks you questions. I find this very annoying, because I don't know what questions are coming up, and I don't know the answers without doing ^Z a bunch of times. This version installs the config file, but doesn't set anything up until you call setup-app (which writes the database and some files). The config file is still just a randomly-ordered set of sections (blame ConfigParser), but in a better setup it would be a nice config file with helpful comments and with commonly-changed things at the top.

In related news, here's a quick setup for a Catwalk SQLObject model browser:

easy_install http://svn.cherrypy.org/trunk/
easy_install -f http://turbogears.org/download/ TurboGears==dev CherryPaste

I don't have a make-config setup for it, and I'm not sure I'll make one. You just make your own config like:

[app:main]
use = egg:CherryPaste#catwalk
model = mypackage.mymodel
# If you need to configure a db connection:
database = mysql://...

[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8080

Then do paster serve catwalk.ini and you'll be set. Now you don't have to be using TurboGears to use Catwalk -- you can even embed Catwalk into your own (WSGI/Paste) application with relative ease, because that configuration file just maps (exactly) to this Python:

# egg:CherryPaste#catwalk is defined as this import in 
# CherryPaste/setup.py:
from cherrypaste.tg import make_catwalk
app = make_catwalk({}, model='mypackage.mymodel',
                   database='mysql://...')

Being able to do exactly this was actually one of my primary motivations for CherryPaste.

Read: TracPaste & CherryPaste

Topic: Extending overlays Previous Topic   Next Topic Topic: Pastifying CherryPy

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use