[12:01] <mdz> jblack: what about gcc?
[12:01] <SteveA> I was in favour of keeping gcc out of desktop
[12:01] <SteveA> but, I'm against splitting the python standard library
[12:01] <jblack> mdz: iirc, gcc didn't come in desktop.
[12:01] <mdz> different issue, to my mind
[12:01] <jblack> I'll buy that.
[12:13] <sabdfl> i'm happy to discuss distutils again
[12:33] <mdz> sabdfl: it's 600k of .py files
[12:33] <mdz> no sensible reason to split it from the main python package that I see
[12:33] <mdz> it seems historical, since they had previously been distributed separately
[12:33] <sabdfl> main concern to me is its function
[12:34] <sabdfl> given that i want python to be a first class citizen on ubuntu
[12:34] <sabdfl> let's switch to -devel
[12:34] <sabdfl> mdz:^
[02:16] <BradB> kiko: dude, panther ROCKS
[02:16] <kiko> BradB, tla speed pr0n ?
[02:16] <BradB> not yet
[02:16] <BradB> installing other stuff, but there will be much porn soon
[02:16] <BradB> got a new powerbook today
[02:17] <BradB> 15", 1.5 GHz w/ superdrive, uNF
[02:17] <BradB> i keep saying to myself "sheesh, it feels like i got a new computer", then i'm like "oh yeah, i did"
[02:18] <kiko> BradB, how much did it cost?
[02:18] <BradB> $4K CAD
[02:18] <BradB> i doubled my hardware specs
[02:19] <kiko> hmmm
[02:19] <kiko> how much is that US$?
[02:19] <BradB> 1.5 GHz G4, 80 G, 512 MB RAM, Panther, built-in bluetooth.
[02:19] <BradB> these days? $4K. :)
[02:20] <kiko> hah!
[02:20] <kiko> you know
[02:20] <BradB> about 3250
[02:20] <kiko> I've been wanting to buy a powerbook for a long time now
[02:20] <kiko> but they are so damn expensive!
[02:20] <BradB> this one was worth it
[02:20] <kiko> I wonder
[02:20] <BradB> dude, this thing adjusts to ambient lighting
[02:21] <kiko> can you get a cheap one down there?
[02:21] <kiko> ack
[02:21] <BradB> if you turn of the lights, the screen dims
[02:21] <kiko> that's killer
[02:21] <BradB> turn em back on, goes brighter again
[02:21] <kiko> heh
[02:21] <BradB> it's insane
[02:21] <BradB> cheap one down where?
[02:21] <kiko> up in canada I guess. :)
[02:22] <BradB> heh
[02:22] <BradB> i can get one for the price i got one, that's about it
[02:22] <BradB> this was the souped up 15" though
[02:22] <BradB> the other 15" is like 600 cheaper
[02:25] <BradB> kiko: several of the apps are way, way better now too
[02:25] <BradB> both at the good ole unix level, and os x's apps
[02:26] <BradB> e.g. i hated that ls -h or df -h didn't work in jaguar. tar didn't even have --exclude
[02:26] <BradB> now they're all sane again
[02:26] <BradB> Mail.app is actually looking like a reasonable (eye-candy) replacement for mutt.
[02:27] <BradB> it does cool little things too, like when i make a new rule, and i choose a header on which to make that rule, it auto-fills it with the value from the email i'm looking at
[02:27] <BradB> and does what appears to be good threading finally
[02:27] <kiko> heh
[02:28] <kiko> neat that the unix apps are coming forward
[02:28] <kiko> so 
[02:28] <kiko> how much is a cheap PB up there?
[02:28] <BradB> the hardware's way better too. i don't have to knock over my beer anymore trying to finagle my iPod's firewire into the back of the machine, because all the ports are along the sides.
[02:28] <BradB> kiko: are you trying to get the newest model?
[02:28] <kiko> nop
[02:28] <kiko> the cheapest model that is still decent
[02:29] <BradB> hm
[02:29] <BradB> that'd probably be the other pb i have. i'm not looking to sell that one though. not sure.
[02:29] <kiko> it can be 12-13i
[02:29] <BradB> k, you mean? :)
[02:30] <BradB> er, no
[02:30] <kiko> heh
[02:30] <kiko> i for inches :)
[02:30] <BradB> aye
[02:30] <BradB> there's only a 12, i guess
[02:30] <kiko> yeah.
[02:30] <kiko> there's a sony 13i wide-screen that runs at 1280 which rocks
[02:30] <BradB> you can get a brand new 12-inch for 2099 CAD
[02:30] <kiko> but since I need something powerpc..
[02:30] <kiko> really?
[02:31] <BradB> http://store.apple.com/1-800-MY-APPLE/WebObjects/canadastore.woa/71303/wo/3F3HnbOzBIKq3mjqmqCHqCxYROp/0.0.9.1.0.6.21.1.1.1.1.0.0.1.0
[02:31] <BradB> somehow i paid $50 less than that page advertises for my pb
[02:32] <BradB> "Free Shipping", heh.
[02:33] <kiko> heh
[02:37] <kiko> that's not too expensive, is it?
[02:38] <BradB> nope
[02:38] <BradB> no point getting used
[02:38] <kiko> hey, if used is half-price, there is :)
[02:38] <BradB> well, yeah :)
[02:39] <kiko> are there such good deals?
[02:40] <BradB> there might be, but none that i know of offhand, mainly because waiting until a good deal comes along was not really an option for me
[02:40] <BradB> (because having exactly one machine on which to work was hectic)
[02:40] <kiko> yeah.
[02:41] <sabdfl> BradB: drool
[02:42] <sabdfl> sounds awesome
[02:42] <BradB> heh heh
[02:42] <sabdfl> is the fs better in panther?
[02:42] <BradB> it's the same one
[02:42] <BradB> i'm benchmarking running z3 unit tests right now
[02:42] <sabdfl> what's the diff between hfs+ and ufs?
[02:44] <sabdfl> for a new Z3 context object, should I subclass anything other than (object)?
[02:44] <BradB> there are several: what you call the thing that you mount, the path separator, case sensitivity, etc.
[02:45] <BradB> "context object"?
[02:45] <BradB> context is just something; something is a fairly vague thing
[02:45] <BradB> you mean a content class?
[02:47] -dmwaters(dmwaters@dmwaters-gentoo.staff.freenode)- {global notice} Hi all! We appologize for that uh interuption. a script was ran that accidently restarted several of the ircds. Blame alindeman :) Thank you for your patience, and thank you for using freenode!
[02:48] <sabdfl> yes, a content class
[02:48] <sabdfl> i've got a content class that works fine, except that I can't use set_schema
[02:48] <sabdfl> it doesn't work
[02:48] <sabdfl> but it works fine if i use set_attributes
[02:48] <BradB> it needs to implement a schema
[02:48] <BradB> or, maybe it doesn't
[02:49] <sabdfl> it does
[02:49] <BradB> what's the error?
[02:52] <sabdfl> forbidden attribute
[02:52] <sabdfl> 'sbizarre
[02:52] <BradB> are you sure the things you mention in set_schema are in the schema?
[02:52] <sabdfl> works just fine with set_attrbutes="x y z"
[02:53] <sabdfl> yes, as Attribute()'s
[02:55] <BradB> mm
[02:56] <BradB> http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/contentobject.html explains it in more detail. Maybe you need to inherit from IContained.
[02:56] <BradB> we probably want to be using set_schema consistently
[02:59] <BradB> but hm, SQLBase is ultimately just inheriting from SQLObject.
[03:09] <sabdfl> i think this is an egg-man bug
[03:11] <BradB> heh
[04:33] <jblack> I'm trying to do that blasted zope3 tutorial again. I've got an import problem on the buddydemo. Any zope guys conversant with it? 
[05:30] <jblack> Ok. figured it out. the programmer tutorial is wrong. It shouldn't go in src/buddydemo, it should go in lib/python/buddydemo
[05:31] <BradB> jblack: sounds like you're using a release. perhaps it was assuming an svn checkout.
[05:45] <jblack> BradB: You know zope3? 
[05:45] <BradB> I know how to do some things in Zope 3.
[05:47] <jblack> Possibly enough to tell me what went wrong in the programmer tutorial this time? 
[05:47] <jblack> I'm getting a gripe in buddyemo/configure.zcml, line 6.0 "NameError: name 'zope' is not defined
[05:48] <jblack> I just did slides 11-20
[05:48] <jblack> (and I'm more than happy to scp up the instance to your machine for you to look at
[05:49] <sabdfl> BradB: figured out a little bit of the zope3 widget machinery
[05:49] <BradB> sabdfl: Able to use things that inherit from object, hopefully.
[05:49] <BradB> (with set_schema)
[05:50] <BradB> jblack: it'd be easier if you just paste your buddydemo/configure.zcml at paste.husk.org
[05:50] <sabdfl> BradB: no, didn't get that right
[05:51] <BradB> jblack: I bought a new powerbook btw. It's shiny.
[05:51] <sabdfl> i do suspect a zope3 issue there
[05:51] <jblack> http://paste.husk.org/1848
[05:51] <BradB> sabdfl: What things did you learn about widgets?
[05:51] <sabdfl> basically, how to subclass Text, and the TextAreaWidget, so that the bug edit form is a bit neater
[05:52] <sabdfl> it's a shitload of work for a very small bit of neater
[05:52] <BradB> ah, from the chapters in the Z3DG?
[05:52] <jblack> bradb: Yeah
[05:52] <sabdfl> but i suppose once it's done it's done
[05:53] <BradB> yep
[05:53] <sabdfl> i'm trying to figure out how we make the generated forms look as good as the handcrafted ones
[05:53] <sabdfl> if it can be done, then i'll buy into the autogenerated thing
[05:54] <BradB> sabdfl: I think it's very, very doable. Afterall, for 80-90% if the add/edit forms we haven't, there probably isn't a need for them to look really customized (uniformity and consistency are, afterall, Good Things)...it's just a matter of figuring out what visual knobs can be turned with CSS and the like.
[05:54] <BradB> s/we haven't/we have/
[05:55] <sabdfl> same is probably true of the forms we haven't :-)
[05:55] <sabdfl> i've figured out the actual widget bit
[05:55] <BradB> heh
[05:55] <sabdfl> now need to figure out the wrapper
[05:55] <sabdfl> the bit that puts the summary etc there
[05:55] <sabdfl> the text
[05:55] <sabdfl> right now it uses the title
[05:55] <BradB> jblack: it's one of two problems. either your pythonpath isn't correct or you need to import that module specifically in zcml.
[05:56] <sabdfl> but the hand crafted fields look a lot better, present more info
[05:56] <BradB> jblack: (probably the latter)
[05:56] <sabdfl> i'm going to try to figure out the rest tomorrow
[05:56] <jblack> Yeah. Odds are that ubuntu has a sane importpath.
[05:56] <jblack> pardon. sane pythonpath.
[05:56] <BradB> sabdfl: sounds promising though
[05:57] <jblack> it would be odd that a zope instance doesn't import zope though, wouldn't it? 
[05:57] <sabdfl> night all
[05:57] <BradB> night sabdfl 
[05:58] <jblack> sleep well boss.
[05:58] <BradB> jblack: there are easy ways of testing this though
[05:59] <BradB> mm, no, scratch that (there are, but scratch that)
[05:59] <jblack> I haven't gotten the unit testing working yet either.
[05:59] <jblack> Ohhh, yes I have.
[06:01] <jblack> Though something still ain't right there. 
[06:01] <jblack>   >>> bud = Buddy('Bob', 'Smith')
[06:01] <jblack>   >>> bud.name()
[06:01] <BradB> jblack: how are you starting z3?
[06:02] <jblack> I was trying bin/runzope
[06:04] <jblack> btw, before I added the interface stuff, I was able to add buddies in the web interface.
[06:05] <BradB> can you paste the whole traceback? i'm learning here too, because i've never seen an error like that, but it's almost surely something really straightforward, given enough context.
[06:07] <jblack> http://paste.husk.org/1849
[06:08] <dilys> Merge to rocketfuel@canonical.com/launchpad--devel--0: a basic widget for bug summaries (patch-678)
[06:11] <BradB> jblack: for one, you've got a syntax error in the zcml
[06:11] <BradB> for ".interfaces.IBuddy"
[06:12] <jblack> I believe you, but that's a straight paste from the tutorial
[06:13] <BradB> through an = sign in there and see if that changes anything
[06:13] <BradB> after than, try commenting out that require and see what happens
[06:13] <BradB> s/than/that/
[06:13] <jblack> http://paste.husk.org/1850
[06:15] <jblack> (thats slide 16)
[06:15] <jblack> There's nothing in the name method. Maybe the slide cut it.
[06:16] <BradB> nope, it's an interface
[06:16] <BradB> but there's either a syntax error in that python code as well (indentation error), or a mix of tabs and spaces.
[06:18] <jblack> I did find the missing = in configure.zcml though
[06:21] <jblack> oh. found a missing import
[06:21] <jblack> and a missing import re, and it works. 
[06:23] <jblack> Now if I could just figure out why it stopped listening on port 8081...
[06:27] <BradB> hehe
[06:28] <jblack> Thanks for the help bradb. I'm back on track
[06:29] <BradB> cool, no prob
[06:37] <jblack> WHoo! 
[05:12] <sabdfl> SteveA: around?
[09:01] <SteveA> hey sabdfl
[09:01] <sabdfl> hiya SteveA
[09:02] <sabdfl> well it's been an interesting tour of zope3 form autogeneration this weekend :-)
[09:02] <SteveA> is it hot or not?
[09:02] <sabdfl> i'm trying to establish if i can get some of our autogenerated forms to looks as god as the hand-crafted ones
[09:02] <sabdfl> wel...
[09:02] <sabdfl> large amounts of effort for little return so far
[09:02] <sabdfl> skimpy docs, the usual
[09:03] <sabdfl> wanted to lob a few eggs in your direction but didn't want to disturb the w/e
[09:03] <SteveA> when I used it on a project a while ago, I ended up nor using the standard "edit form" stuff, but using a custom variant on it.
[09:03] <sabdfl> seems that stub knows a bit about it and has been laying the foundations in malone
[09:03] <SteveA> I haven't kept up with changes to it, though
[09:04] <sabdfl> you would be better placed than me to do custom variants on machinery that's a little outside my immediate ken :-)
[09:04] <sabdfl> anyhow, i'm slowly coming to grips with it
[09:04] <sabdfl> slowly
[09:05] <SteveA> the thing I found was that is was very easy to waste a lot of time making a particular form work, if that form goes outside one of the assumptions behind the autogenerated form machinery.
[09:05] <SteveA> if you notice these soon enough, and do them manually, it's okay
[09:05] <SteveA> if you don't... lots of painful and non-obvious coding around things
[09:06] <sabdfl> well, limi has set the bar quite high in terms of the look we should expect from our forms
[09:06] <sabdfl> i think we are going to have to produce a set of custom field and widget classes
[09:06] <sabdfl> i want to hammer on this a while and then we can discuss a general system for the team
[09:07] <sabdfl> i am thinking at the moment that we might produce a mixin class for widget and field
[09:07] <sabdfl> because mainly i want to put the same decoration on any kind of field
[09:07] <sabdfl> but there are also potentially custom requirements for context-aware fields
[09:07] <SteveA> not sure we'd need new fields, except where we've got a truely new kind of thing
[09:08] <SteveA> I think pov have done a lot of work on these
[09:08] <SteveA> certainly marius has been filing and fixing bugs in it recently
[09:08] <sabdfl> current fields allow for title, description, required
[09:08] <sabdfl> yes, found him on a couple of proposals related to this
[09:09] <sabdfl> which sounded rather sane
[09:10] <sabdfl> you have a good weekend?
[09:10] <SteveA> not bad.  more of a lazy weekend, catching up on sleep and generally hanging out
[09:10] <SteveA> yours?
[09:11] <sabdfl> tried to sleep but had total insomnia
[09:12] <SteveA> try more exercise?
[09:13] <SteveA> then again, I find if I exercise too much, it stops me from sleeping
[09:14] <sabdfl> yes i think i'm the latter stage
[09:14] <sabdfl> too much to think about at the moment
[09:14] <sabdfl> ok, so i'm using the normal addform machinery
[09:15] <sabdfl> with a custom pt
[09:16] <sabdfl> there's this sort of useful-looking hook:
[09:16] <sabdfl>         <div metal:define-slot="extra_info" tal:replace="nothing">
[09:16] <sabdfl>         </div>
[09:16] <sabdfl> how do i pass information to that?
[09:16] <SteveA> do you know about METAL ?
[09:16] <SteveA> If not, I should explain just a little about that first.
[09:17] <SteveA> we use two namespaces in page templates: tal: and metal:
[09:17] <SteveA> the metal: is for "macro processing".  The metal directives get processed first, and then the resulting template is treated as a whole for tal: expressions.
[09:18] <SteveA> think of it like #includes.
[09:18] <sabdfl> yes
[09:19] <SteveA> The div above defines a slot called "extra_info".  You can fill it from your template with <div metal:fill-slot="extra_info">
[09:20] <sabdfl> This is at the top of the pt:
[09:20] <sabdfl>       metal:use-macro="context/@@malone_template/master"
[09:20] <SteveA> where is that hook that you pasted?
[09:21] <sabdfl> about halfway into the page
[09:21] <SteveA> in which page?
[09:21] <sabdfl> lib/canonical/launchpad/templates/default-addform.pt
[09:22] <sabdfl> i've actually copied it to bug-addform and started to use that
[09:23] <sabdfl> i'm adding some of the plone-style widget decoration
[09:23] <sabdfl> fieldset etc
[09:25] <sabdfl> also, i'll want to figure out this line:
[09:25] <sabdfl>         <div metal:use-macro="context/@@form_macros/widget_rows" />
[09:25] <sabdfl> where is widget_rows defined?
[09:26] <sabdfl> hey it's sunday don't boil too many eggs on my account
[09:27] <sabdfl> ok, i found widget_macros.pt
[09:28] <sabdfl> in lib/zope/app/form/browser
[09:28] <sabdfl> i'll want to customise that, how do i do that?
[09:28] <sabdfl> workrave
[09:29] <SteveA> in the zcml directive for addforms, there's a 'template' attribute, and a 'default_template' attribute
[09:33] <sabdfl> the template is what i'm customising already
[09:33] <sabdfl> what's the default template?
[09:33] <SteveA> oh, red-herring
[09:34] <sabdfl> :-)
[09:35] <SteveA> as far as I can tell, the extra_info slot is for when you're using the standard zope template, and you want to be able to do certain customizations without coming up with a new template of your own.
[09:35] <sabdfl> can the view push data into the slots at all?
[09:35] <sabdfl> oh, so the standard rendering of this uses another template and fills that slot?
[09:36] <SteveA> I think the way you're supposed to provide your own template for this is that you write a minmal template that uses macros from the default template
[09:36] <sabdfl> how about the second question, about customising widget_macros.pt
[09:36] <sabdfl> oh right
[09:36] <SteveA> so, you don't end up copy-pasting the code from zope, but just including the bits you want
[09:36] <sabdfl> so instead of copying it
[09:36] <SteveA> wish there were docs on this, though
[09:37] <sabdfl> just write a really small one that pushes in heading and extra info etc
[09:37] <sabdfl> ok, that's quite nice
[09:37] <sabdfl> because we can do a single master addform template for launchpad
[09:37] <SteveA> yeah, I guess so.  I think you'd need some way of specifying that you want to use macros from the standard add form
[09:37] <SteveA> yeah, that would work
[09:37] <SteveA> in fact, we'd need a StandardMacros object then
[09:37] <sabdfl> now, about the second questions
[09:38] <sabdfl> widget_macros
[09:38] <sabdfl> how do i override that to be something else?
[09:38] <SteveA> that's what we did in zope3 -- rather than have to remember which template exactly has the macros you want, you have an object that collects macros from a bunch of useful "basic" template
[09:38] <SteveA> s
[09:39] <sabdfl> i want to redefine widget_rows
[09:39] <SteveA> in the configure.zcml of that package, I see that you can get the widget_macros.pt template as a view on anything, called widget_macros
[09:40] <SteveA> well, there are two ways to do this
[09:40] <SteveA> you can redefine the widget_macros view for the launchpad layer
[09:41] <SteveA> most straightforward way is to make your own copy-paste-altered version of widget_macros.py
[09:41] <sabdfl> right, just copy it and customise it and make it available under a different name
[09:41] <SteveA> er .pt
[09:41] <SteveA> yes
[09:41] <SteveA> but, make it available under the *same name*
[09:41] <SteveA> but in the launchpad layer
[09:41] <sabdfl> o.....k....
[09:42] <SteveA> by using the launchpad layer, we're saying "we can override the defaults in zope in the context of the launchpad application"
[09:42] <SteveA> rosetta and malone layers extend the launchpad layer
[09:42] <sabdfl> how do i register it for the launchpad layer?
[09:43] <SteveA>   <browser:page
[09:43] <SteveA>       for="*"
[09:43] <SteveA>       name="widget_macros"
[09:43] <SteveA>       layer="canonical.launchpad.layers/LaunchpadLayer"
[09:43] <SteveA>       permission="zope.Public"
[09:43] <SteveA>       template="widget_macros.pt"
[09:43] <SteveA>       />
[09:43] <sabdfl> i'm going to put the registration into zcml/bug.zcml for the moment, because those are the add/edit forms i want to fix first
[09:43] <SteveA> with the template in the correct place, of course
[09:43] <SteveA> so, whatever is currently using widget_macros will get it as context/@@widget_macros
[09:43] <sabdfl> is there a more appropriate zcml file for this?
[09:44] <SteveA> and, it will automatically get your version inside launchpad
[09:44] <SteveA> launchpadlayer-stuff.zcml ?
[09:44] <SteveA> launchpad-widgets.zcml ?  launchpad-forms.zcml ?
[09:44] <SteveA> the latter, I suppose
[09:45] <SteveA> this is all about how we want forms to look in launchpad
[09:46] <sabdfl> let me get it right in the bug stuff, then we can move it
[09:46] <SteveA> k
[09:46] <sabdfl> can i replace * with something more localised?
[09:47] <sabdfl> canonical.launchpad.layers/LaunchpadLayer
[09:47] <sabdfl> is the / intentional?
[09:47] <SteveA> no, it is wrong
[09:47] <SteveA> should be a .
[09:47] <SteveA> you could replace * with IMaloneBugThing or whatever you're working on
[09:47] <SteveA> if the change is meant only for that one thing
[09:48] <sabdfl> is it the interface of the context?
[09:48] <SteveA> yes, exactly
[09:48] <sabdfl> or the container that has the addform?
[09:48] <SteveA> I expect this will be looked up as context/@@widget_macros
[09:48] <SteveA> oh, that could get a bit more complex
[09:48] <SteveA> there's IAddings involved there -- views on views
[09:48] <SteveA> erm -- maybe stick with "*"
[09:49] <SteveA> I should go make food, and then watch donnie darko on dvd.
[09:50] <sabdfl> weird movie
[09:52] <SteveA> picked up the dvd at the airport for three quid
[09:52] <SteveA> as the director's cut was out for about 20
[09:53] <SteveA> and being heavily advertised
[09:55] <sabdfl> directors cut might be interesting
[10:05] <sabdfl> SteveA: can't seem to access my custom copy of the widget
[10:05] <sabdfl> it's not being used, the old one is
[10:49] <SteveA> As a debugging measure, try declaring it not in the launchpad layer, but without a layer attribute, and declare it for zope.interface.Interface, not for *
[10:50] <SteveA> that's a crappy way of getting it registered, but if it works, it shows that you're not doing anything wrong, and for some reason the layer isn't being used.
[10:50] <SteveA> (it was too late at night to watch a full film after eating, so we've settled for an episode or two of futurama instead)
[11:22] <sabdfl> still around?
[11:22] <sabdfl> stevea: ^?
[11:24] <SteveA> yeah, just about
[11:26] <sabdfl> yo
[11:26] <sabdfl> so i'm now crafting the actual template
[11:26] <sabdfl> the one which will fill the slots of the default_template
[11:27] <sabdfl> and i've no idea what that one's header should look like

[11:27] <sabdfl> ?
[11:27] <sabdfl> should it refer explicitly to the launchpad-addform.pt?
[11:27] <sabdfl> or is that all handled by the machinery?
[11:27] <sabdfl> and here's where it gets interesting
[11:27] <sabdfl> the addform template itself is clearly referring to a master template
[11:28] <SteveA> is launchpad-addform.pt registered as a view on anything?
[11:28] <sabdfl> so can these templates be layered in a stack?
[11:28] <sabdfl> yes, it works as the view on a bug add
[11:28] <sabdfl> i' now trying to generalise it
[11:28] <sabdfl> so that for new add forms we just make a tiny template
[11:28] <sabdfl> that has the appropriate document description, headings etc
[11:28] <SteveA> provided each template is registered as a view on something, sure, you can use many of them using bits of each other
[11:29] <sabdfl> ok, so let's assume there are three of them
[11:29] <sabdfl> master
[11:29] <SteveA> the general model is using a macro, which has slots in it
[11:29] <sabdfl> default-addform
[11:29] <sabdfl> table-addform
[11:29] <sabdfl> in the default-addform, when there is a fill-slot, that would fill a slot in the master?
[11:30] <sabdfl> and when there's a define-slot, that's something the table-addform can fill?
[11:30] <SteveA> assuming default-addform has a use-macro refering to a macro of the master template
[11:31] <SteveA> you're filling a slot of whatever macro you're inside of, in the code of the template the fill-slot is in
[11:32] <sabdfl> so for the table-addform do i need a use-macro?
[11:33] <sabdfl> or does the addform machinery automatically do that
[11:33] <sabdfl> given that it has default_template for the default-addform
[11:34] <SteveA> from the code I saw, the default_template is what is used if you don't supply a "template"
[11:35] <sabdfl> erm that doesn't make sense to me
[11:35] <SteveA> you don't need to supply a 'template' in your zcml
[11:35] <sabdfl> why have both "template" and "default_template" attributes
[11:35] <SteveA> there is a default 'template' that is used instead
[11:35] <SteveA> 'default_template' isn't meant to be used in zcml
[11:35] <sabdfl> ah.
[11:35] <SteveA> it can be used if you subclass the class, I think
[11:35] <sabdfl> that's not what i understood previously
[11:36] <sabdfl> it seems as if this addform, which is copied from the zope dir, is designed to be used as an "intermediate" template
[11:36] <SteveA> I'm still not sure I understand -- I only skimmed throught the code.
[11:36] <sabdfl> as i described above
[11:36] <sabdfl> in any event, say i want to refer to the template directly, from another template
[11:36] <sabdfl> how do i do that?
[11:36] <SteveA> I suppose it would use the macros and slots of the master template
[11:37] <SteveA> if you want to use macros from a template
[11:37] <SteveA> then first you need to get to the template.  usually, they are registered as views on an object.  so, context/@@view_name
[11:37] <sabdfl> what would be the name?
[11:38] <SteveA> for widget_macros.pt it was widget_macros
[11:38] <SteveA> it is whatever it is registered in zcml as
[11:38] <sabdfl> hmm.. this is getting murky again
[11:38] <sabdfl> ok, here's what i understood
[11:38] <sabdfl> and what makes some sense
[11:39] <sabdfl> that it's pssible to define a general site-wide template
[11:39] <SteveA> where you want to use a particular macro, you put  metal:use-macro="context/@@view_name/macro_name"
[11:39] <sabdfl> and then a custom template will use that one
[11:39] <SteveA> if you explicitly use the site-wide template's macros in your custom template, yes
[11:40] <SteveA> the building blocks you have are metal:use-macro="context/@@view_name_of_template_with_macros/macro_name"
[11:40] <SteveA> and filling slots in that macro inside the element you chose to use the macro from
[11:40] <SteveA> usually, we suse the macro on the whole template (the html element)
[11:41] <SteveA> and fill the "body" slot, (or "page" slot or "content" slot) and perhaps others
[11:41] <SteveA> that's the most basic way to use macros
[11:41] <sabdfl> ok, this will take some fiddling
[11:41] <SteveA> you can also use macros to include any parts of another template where you can 1. get at the template and 2. that template has defined appropriate macros around the parts of it you want to reuse elsewhere
[11:41] <sabdfl> do the attributes of the macro override the attributes of the element in the calling document?
[11:42] <SteveA> you mean the element where you say "metal:use-macro" ?
[11:42] <sabdfl> yes
[11:42] <SteveA> note that this isn't "calling" at all.  it will become very confusing if you think of it like that. 
[11:42] <SteveA> it is "including"
[11:42] <sabdfl> ok, so they supplement them
[11:42] <SteveA> you're building up a synthetic page template (that you'll never see) from parts of other templates plus your own
[11:43] <SteveA> that whole template is then "executed" in terms of its tal:
[11:43] <SteveA> in the element where you say "metal:use-macro", I think the whole element disappears
[11:43] <SteveA> but, I may be mis-remembering
[11:44] <SteveA> basically, the whole element disappears, except where you have slots inside it
[11:44] <SteveA> yeah -- that must be so, because of how in the simple use of metal, you put use-macro in the html element of your template
[11:44] <sabdfl> que?
[11:44] <sabdfl> so basically, a use-macro in the html element wipes out the document?
[11:44] <SteveA> that nukes your html element, and in fact your whole template, except where you have said "metal:fill-slot"
[11:45] <SteveA> yeah
[11:45] <SteveA> use-macro in an element says "I want what the other template says for this element.  except where I fill its slots"
[11:45] <sabdfl> cant be
[11:45] <sabdfl> let me check
[11:48] <sabdfl> blow me down, seems true
[11:48] <sabdfl> can you have both fill-slot and define-slot elements inside a use-macro?
[11:48] <sabdfl> for layered templates?
[11:52] <SteveA> yeah
[11:52] <SteveA> it can get complex pretty quickly, though
[11:52] <SteveA> especially as the exact "include" nature of macros is a bit subtle
[11:55] <sabdfl> yeah, this default-addform is fun
[11:55] <sabdfl> is has a use-macro in the html
[11:55] <sabdfl> then it fill-slot's the "main" slot
[11:56] <sabdfl> inside that, it has both define-macro ("formbody" and "addform" etc) and define-slot elements
[11:56] <SteveA> maybe you can draw a "map" of it in dia?
[11:56] <SteveA> might help with maintenance
[11:57] <sabdfl> night
[11:57] <sabdfl> will try to write it up once i've got it working the way i want