On 7/14/09 2:29 PM, Ian Bicking wrote: > On Mon, Jul 13, 2009 at 8:51 PM, Chris McDonough <[email protected] > <mailto:[email protected]>> wrote: > > # cd pypes/pypes > $ virtualenv --no-site-packages env > $ env/bin/python setup.py develop > > To run the bfgish app: > > $ env/bin/python run.py > > > I think you need repoze.profile to run this. > > OK... looking at pypes/bfgish/sampleapp/configure.yml... I am at first > rather put off by all the "--- !". I don't know what it means, and a > quick read of the YAML spec isn't very helpful. i assume the empty > sections could actually be left out, but they are kept in for > documentation purposes.
"---" means "new YAML document" (a yaml file is actually a "stream" that can be composed of multiple documents), "!something" means "look out, here comes a something", meaning the stuff underneath it until the next document is of some type. Setuptools entry points (e.g. under [repoze.configuration.directive] in http://bitbucket.org/chrism/pypes/src/660040d86a81/pypes/setup.py) define the handlers for those "somethings". Sorry, I don't know the actual YAML terminology for those somethings, it might be "type". I don't have any particular love for this; it was the easiest thing to implement. The code is here: http://svn.repoze.org/repoze.configuration/trunk/repoze/configuration/loader.py As far as I can tell, it basically all sucks when hierarchy gets involved, particularly if you want to make the configuration syntax pluggable (which is essentially the only offering here). > The whole BFG sample app is confusing to me. A wiki BFG sample app was added late last night: http://bitbucket.org/chrism/pypes/src/tip/pypes/pypes/bfgish/wiki/ It follows the spirit (only minor spelling variations) of the tutorial outlined at: http://docs.repoze.org/bfg/current/tutorials/bfgwiki/index.html Understanding it probably doesn't matter much though. This is sort of the point of the effort; we can maybe all get a little closer to being able to share more than libraries without buying in to any particular worldview. > Looking at quickwiki I understand it a bit better, familiarity with the > framework I suppose (but then it also does something, which is always > helpful ;). The use of !include bothers me, though I can't articulate > exactly why. Maybe because I've had bad experiences, e.g., gigantic > Apache configuration boilerplate files that get included. I think it's > how the configuration develops over time that bothers me. If there was > room for persistent documentation that could be held in the > configuration, and the ability to view the configuration with all > includes resolved, that would make me more comfortable. I think > debugging configuration troubles me, and this configuration definitely > is something that can have hard bugs. Some form of !include (or the spirit of such a thing) isn't strictly required to be used, but because the configuration basically names the "flavor(s)" of the application(s) being configured, it can be helpful. In the case of quickwiki, the line: --- !include package: pypes.pylonsish Tells it to include the "configure.yml" file from the pypes.pylonsish package. This file looks like so: --- !responder responder: .responder:pylonsish_responder name: pylons You can *always* remove all includes in a particular application's file. If you did this to quickwiki's configure.yml, you'd remove this: --- !include package: pypes.pylonsish .. and add this: --- !responder responder: pypes.pylonsish.responder:pylonsish_responder name: pylons Lots of times, however, it's useful to just !include some other file because you don't really "own" its composition (much like a Python import), and often included files do low-level registrations (like this responder one) that grow over time. - C --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
