[04:02:59] [connected at Thu May 26 04:02:59 2005] [04:02:59] <> *** Looking up your hostname... [04:02:59] <> *** Checking ident [04:03:04] <> *** Found your hostname [04:03:32] <> *** No identd (auth) response [04:03:32] <> *** Your host is brown.freenode.net[brown.freenode.net/6667], running version dancer-ircd-1.0.35 [04:03:32] [I have joined #peak] [04:03:32] ** brown.freenode.net set the topic to DMs made easy(er) -- http://www.eby-sarna.com/pipermail/peak/2005-May/002296.html [07:56:21] ** hazmat has left IRC (No route to host) [08:52:36] ** debugger has joined us [09:18:39] ** debugger has left IRC () [11:59:45] ** sprout has joined us [12:00:50] sprout is now known as twl [12:45:46] twl is now known as sprout [15:27:15] ** whit has joined us [15:32:15] ** arg has left IRC (brown.freenode.net irc.freenode.net) [15:32:15] ** erikrose has left IRC (brown.freenode.net irc.freenode.net) [15:32:33] ** erikrose has joined us [15:32:33] ** arg has joined us [16:25:42] ** debugger has joined us [18:50:43] ** hazmat has joined us [19:17:47] ** cogumbreiro has joined us [19:17:53] lo all [19:25:42] hey cogumbreiro [19:26:05] cogumbreiro, I've tried kid, and got a question for you :) [19:27:12] cogumbreiro, how do you handle the layout of your site? are you using master templates, if so, how? [19:31:30] here's the reply: http://s1x.homelinux.net/node/77 [19:31:31] :D [19:31:52] i'm migrating all my "old" site to cheetah [19:32:27] no more encoding problems, maintenance got simpler and everyone is happy :P [19:32:52] cogumbreiro, ouch! [19:32:58] lol [19:33:02] u bet [19:33:20] humm, why maintenance got simpler? [19:33:41] because I had an overly complicated system for a mundane thing [19:34:06] i was trying to create the ultimate reusable component based system to handle save/load/edit/remove/create [19:34:26] crud :D [19:34:31] but it wasn't worth it... [19:34:33] :P [19:35:15] lemme known how you use cheetah :) [19:35:29] real life demands so many customizations that, at least my system, couldn't handle it. It could handle it but creating the schema was as big as doing the damn thing by hand [19:35:40] cheetah has a problem, the templates aren't thread safe, so whatchout! [19:35:56] thx for the tip [19:36:09] i have too look in cherry how it's being used [19:36:30] ian told me that one should should create a pool of templates. [19:36:34] first thing is to create the main template, then define a block, let's say "Content" [19:36:51] so you do: #block Conten [19:36:54] #end block [19:36:56] *Content [19:37:07] lemme show me mine :) [19:37:13] then in each page you want to use the template you do: [19:37:15] err s,me,you [19:37:20] #implements Content [19:37:22] go ahead [19:37:30] ah, thats like I'm doing it too :) [19:37:48] and the n you can define blocks for everything [19:37:55] I'm also using the #extends things. [19:38:02] one thing I've done to is to define the parse and quoteattr functions [19:38:31] #from xml.sax import saxutils [19:38:32] #set global $escape = $getattr($saxutils, "escape") [19:38:32] #set global $quoteattr = $getattr($saxutils, "quoteattr") [19:38:45] mainly to share template functions for using something like: $url.static('styles/rain.css' [19:39:25] don't forget cheetah will hapilly put unparsed < and > [19:39:45] I didn't do that, there is a way of making it always escape the html. [19:39:59] damn! i knew it [19:40:01] filters? [19:40:13] how do u use it? [19:40:21] I just started using cheetah today ^_^ [19:40:25] * debugger is looking :D [19:40:56] return templateClass(searchList=[data, self._extraTemplateFunctions], filter='WebSafe') [19:41:12] oh, templateClass is a ref to a cheetah template. [19:41:31] does it even handle attributes? [19:41:57] I knew it was a stupid filter :D I am just too lazy to dig it ;) actually there are very few examples :( [19:42:45] what do you mean attributes? like, ? [19:44:52] yes [19:45:00] i use quoteattr for that [19:46:30] if you play alot with get variables I've wrote two handy functions [19:47:50] one is urldecode (the oposite of urllib.urlencode) the other is, from a URL and a dict it generates a relative url plus the _new_ get variables you've defined in the dict (they are all encoded so that they are url safe) [19:48:11] it handles " --> " so you should be fine you you onle use quote atributes, that is, instead of using [19:48:47] altougth... he doesn't mention that one the docs *G* [19:49:06] where is that written? [19:49:25] i haven't seen any mention of #filters on the cheetah docs :( [19:49:42] oh sorry... after all, i'm lying! [19:49:45] one problem is having is that whenever i write httptools.redirect(".") IExplorer actually tries to fetch the page named ".", so obviously cherrypy says it doesn't exist :S [19:49:56] lol [19:49:57] take a look at src/Filters.py [19:50:01] ah [19:50:15] always the best docs in the world are the docs ^_^ [19:50:39] it seems we need to pass an extra argument, to the filter, a "also". [19:52:40] so next thing I need to work on is something that actually does a redirect(), or something like a basename(url).join("foo").join("..").join("bar") [19:52:47] like os.path [19:53:21] urlparse? [19:53:48] you can use the posixpath module to handle url paths ;) [19:54:19] urlparse can't do it [19:54:21] posixpath? [19:54:49] yes, posix paths are like URL paths :) [19:56:02] >>> p.join("http://foo.com/bar", "..") [19:56:02] 'http://foo.com/bar/..' [19:56:39] what do you want to do? [19:56:50] emulate the os.path.normpath? [19:56:54] thx, posixpath will do it [19:57:17] usually I just need redirect("."), which should go to basedir() [19:57:23] so posixpath will do it ;) thx [19:58:10] np :) [19:58:18] where do you place the ``#set global $escape = $getattr($saxutils, "escape")'' ? [19:58:38] you also have a base template, from where you inherith all the others from? [19:58:42] SiteTemplate [19:58:45] s,inherith,extend :D [19:58:50] yes [19:58:55] so it's in the base one [19:59:04] oh.. I'm also using that name! hehe [19:59:04] so that all ur "sub" templates can use it too [19:59:10] ^_^ [19:59:39] next project I want to do with Peak+cherrypy+cheetah is a online shop [19:59:43] *an [19:59:58] or something in that level, but open source of course [20:00:27] humm, so your webdesigner fried can grok cheetah templates? [20:00:53] he just needs to maintain the #block Content\n#end block [20:01:00] so I think he can handle it ;) [20:07:00] hehe [21:23:41] ** cogumbreiro has left us [21:27:56] ** whit has left IRC (Read error: 110 (Connection timed out)) [21:32:52] ** sprout has left IRC ("Snak 5.0 IRC For Mac - http://www.snak.com") [22:08:15] ** hazmat has left IRC ("This computer has gone to sleep") [22:22:23] ** debugger has left IRC ("Leaving") [23:35:18] ** hazmat has joined us