From andrewm at object-craft.com.au Mon May 2 10:37:21 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Mon, 02 May 2005 10:37:21 +1000 Subject: [albatross-users] pickle problem In-Reply-To: <20050429151532.GD3466@odin.wolfheart.ro> References: <20050429151532.GD3466@odin.wolfheart.ro> Message-ID: <20050502003721.962777940D9@longblack.object-craft.com.au> >ApplicationError: locals "user": Can't pickle : it's not the same object as Base.User > > >Any idea what the problem is? user of type Base.User is kept in the >session. This happens sometimes and sometimes it works ok. You might do better asking on python-list at python.org - this error is coming out of cPickle, rather than Albatross (albatross has simply caught the error and re-raised it to add more diagnostics). If I had to guess, I would say that the pickler is unable to identify the code object associated with that class. When you pickle an instance of a class, only the instance attributes and a reference (the module and class name) to the class are saved. You could try renaming your "User" class or the "Base" module temporarily - this will tell you if the pickler is stumbling across the wrong module. If you're playing tricks with the class definition at run-time, this will also confound the pickler, I think (eg, metaclasses), or maybe changing the instance's class at run-time. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From andrewm at object-craft.com.au Mon May 2 13:10:10 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Mon, 02 May 2005 13:10:10 +1000 Subject: [albatross-users] pickle problem In-Reply-To: <20050502003721.962777940D9@longblack.object-craft.com.au> References: <20050429151532.GD3466@odin.wolfheart.ro> <20050502003721.962777940D9@longblack.object-craft.com.au> Message-ID: <20050502031010.519ED7940D9@longblack.object-craft.com.au> >You might do better asking on python-list at python.org - this error is >coming out of cPickle, rather than Albatross (albatross has simply caught >the error and re-raised it to add more diagnostics). > >If I had to guess, I would say that the pickler is unable to identify >the code object associated with that class. When you pickle an instance >of a class, only the instance attributes and a reference (the module >and class name) to the class are saved. Looking at the pickle source code, this error is raised when the object can't be found by name in sys.modules. In other words (and simplified slightly): obj != getattr(sys.modules[obj.__module__], obj.__name__) So, I guess that means either: * the object lies about it's name or module, * the object has been obscured by a later binding with the same name, or, * the module has been obscured by something playing tricks with sys.modules. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From djc at object-craft.com.au Mon May 2 14:38:40 2005 From: djc at object-craft.com.au (Dave Cole) Date: Mon, 02 May 2005 14:38:40 +1000 Subject: [albatross-users] pickle problem In-Reply-To: <20050502003721.962777940D9@longblack.object-craft.com.au> References: <20050429151532.GD3466@odin.wolfheart.ro> <20050502003721.962777940D9@longblack.object-craft.com.au> Message-ID: <4275AED0.9080309@object-craft.com.au> Andrew McNamara wrote: >>ApplicationError: locals "user": Can't pickle : it's not the same object as Base.User >> >> >>Any idea what the problem is? user of type Base.User is kept in the >>session. This happens sometimes and sometimes it works ok. > > > You might do better asking on python-list at python.org - this error is > coming out of cPickle, rather than Albatross (albatross has simply caught > the error and re-raised it to add more diagnostics). > > If I had to guess, I would say that the pickler is unable to identify > the code object associated with that class. When you pickle an instance > of a class, only the instance attributes and a reference (the module > and class name) to the class are saved. > > You could try renaming your "User" class or the "Base" module temporarily - > this will tell you if the pickler is stumbling across the wrong module. > > If you're playing tricks with the class definition at run-time, this will > also confound the pickler, I think (eg, metaclasses), or maybe changing the > instance's class at run-time. Another way to make it happen bit me a long time ago. If you reload a module then try to pickle an object created by the old module before it was reloaded, then the pickle will fail. I reported this as a Python bug, but Guido said that he does not consider it to be a bug. http://sourceforge.net/tracker/index.php?func=detail&aid=451547&group_id=5470&atid=105470 - Dave djc at echidna:~$ python Python 2.3.4 (#2, Jan 5 2005, 08:24:51) [GCC 3.3.5 (Debian 1:3.3.5-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pickle, copy >>> o = copy._EmptyClass() >>> pickle.dumps(o, 1) '(ccopy\n_EmptyClass\nq\x00oq\x01}q\x02b.' >>> reload(copy) >>> pickle.dumps(o, 1) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/pickle.py", line 1386, in dumps Pickler(file, protocol, bin).dump(obj) File "/usr/lib/python2.3/pickle.py", line 231, in dump self.save(obj) File "/usr/lib/python2.3/pickle.py", line 293, in save f(self, obj) # Call unbound method with explicit self File "/usr/lib/python2.3/pickle.py", line 721, in save_inst save(cls) File "/usr/lib/python2.3/pickle.py", line 293, in save f(self, obj) # Call unbound method with explicit self File "/usr/lib/python2.3/pickle.py", line 765, in save_global raise PicklingError( pickle.PicklingError: Can't pickle : it's not the same object as copy._EmptyClass >>> -- http://www.object-craft.com.au From andrewm at object-craft.com.au Mon May 2 15:25:08 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Mon, 02 May 2005 15:25:08 +1000 Subject: [albatross-users] pickle problem In-Reply-To: <4275AED0.9080309@object-craft.com.au> References: <20050429151532.GD3466@odin.wolfheart.ro> <20050502003721.962777940D9@longblack.object-craft.com.au> <4275AED0.9080309@object-craft.com.au> Message-ID: <20050502052508.676FF7940D9@longblack.object-craft.com.au> >> If you're playing tricks with the class definition at run-time, this will >> also confound the pickler, I think (eg, metaclasses), or maybe changing the >> instance's class at run-time. > >Another way to make it happen bit me a long time ago. > >If you reload a module then try to pickle an object created by the old >module before it was reloaded, then the pickle will fail. Yes, this is one facet of what I had in mind when I said "changing the instance's class at run-time". Sorry for not expressing it more clearly. >I reported this as a Python bug, but Guido said that he does not >consider it to be a bug. > >http://sourceforge.net/tracker/index.php?func=detail&aid=451547&group_id=5470&atid=105470 The reload() documentation says: If a module instantiates instances of a class, reloading the module that defines the class does not affect the method definitions of the instances -- they continue to use the old class definition. The same is true for derived classes. Unfortunately, you only look at this after wasting a day finding your pickle bug! I'm sure if someone submitted a patch to the pickle doco... -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From andrewm at object-craft.com.au Thu May 5 12:51:23 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Thu, 05 May 2005 12:51:23 +1000 Subject: [albatross-users] XML and Albatross templates? Message-ID: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> As people are probably aware, some aspects of Albatross templating prevent XML validation of the source - specifically the tag: ... ... There's no way to balance that (normally empty tags would be written , but that doesn't reflect what's happening here). One option is to deprecate (or , at least), favouring an inline version of - for example: abc def ghi This is quite a bit more verbose, but many of the cases where would formerly have been used are now better written using the "anytag" structure. "Anytag" (which appears in the development prerelease [1]) allows any tag to be prefixed with "al-". When that is done, attributes can selectively be the product of a python expression. For example: ....
Note that this also means that albatross tags within html tags are no longer necessary. So this horrible contruct should be a thing of the past: This is now written: Thoughts on the al-else thing? Why is XML validation important? At some point we may wish to switch to an XML-based parser (rather than the current regexp-based parser) - correct XML structure would make this easier. [1] http://www.object-craft.com.au/projects/albatross/download/albatross-1.30-dev-20050301.tar.gz -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From gnb at itga.com.au Thu May 5 13:04:16 2005 From: gnb at itga.com.au (Gregory Bond) Date: Thu, 05 May 2005 13:04:16 +1000 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> Message-ID: <42798D30.1070304@itga.com.au> Andrew McNamara wrote: >Thoughts on the al-else thing? Why is XML validation important? > Hmm... like the Anytag stuff a lot, would save a lot of ugly hackery. The al-else... will take a little bit bit of conversion, but _WELL_ worth the effort, beacuse it should mean the Emacs html mode with do the &@%$*# indentation right! From fred at polgardy.com Thu May 5 13:28:59 2005 From: fred at polgardy.com (Frederick Polgardy Jr) Date: Wed, 4 May 2005 22:28:59 -0500 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> Message-ID: <200505042229.00254.fred@polgardy.com> On Wednesday 04 May 2005 21:51, Andrew McNamara wrote: > As people are probably aware, some aspects of Albatross templating > prevent XML validation of the source - specifically the tag: > > ... ... > > There's no way to balance that (normally empty tags would be > written , but that doesn't reflect what's happening here). I forget how it goes off the top of my head, but investigate the Jakarta Struts logic tag library. I know there is an if/then/else type tag structure, and I'm relatively certain it's valid XML. The "anytag" scheme looks sweet, count me in. From andrewm at object-craft.com.au Thu May 5 14:03:31 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Thu, 05 May 2005 14:03:31 +1000 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <200505042229.00254.fred@polgardy.com> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> <200505042229.00254.fred@polgardy.com> Message-ID: <20050505040332.0EA367940F0@longblack.object-craft.com.au> >I forget how it goes off the top of my head, but investigate the Jakarta >Struts logic tag library. I know there is an if/then/else type tag >structure, and I'm relatively certain it's valid XML. This sort of thing? At least one of the above conditions is true. All of Above conditions are false I suspect something like the following is closer to the spirit of the current Albatross code: abc def ghi jkl But I don't see that as any sort of improvement over the suggestion. And the parser currently only has the concept of empty or containing elements - this would require (for backward compatability) support for containing elements with optional close tag (as HTML has). >The "anytag" scheme looks sweet, count me in. It's there now in the dev snapshot - feedback, gotchyas, etc gratefully received. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From andrewm at object-craft.com.au Thu May 5 14:07:30 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Thu, 05 May 2005 14:07:30 +1000 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <42798D30.1070304@itga.com.au> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> <42798D30.1070304@itga.com.au> Message-ID: <20050505040730.171B17940F0@longblack.object-craft.com.au> >The al-else... will take a little bit bit of conversion, At least for the medium-term, al-else would be retained - it would only need to be dropped if we moved to an xml parser. >but _WELL_ worth the effort, beacuse it should mean the Emacs html mode >with do the &@%$*# indentation right! Very true. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From gabriel.cooper at mediapulse.com Fri May 6 00:27:38 2005 From: gabriel.cooper at mediapulse.com (Gabriel Cooper) Date: Thu, 05 May 2005 10:27:38 -0400 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> Message-ID: <427A2D5A.2040906@mediapulse.com> Andrew McNamara wrote: >Note that this also means that albatross tags within html tags are no >longer necessary. So this horrible contruct should be a thing of the past: > > > >This is now written: > > > > We implemented the al-xxx attribute change in Snakeskin a several months ago and really love it. Since then we've discussed making the "anytag" tag several times, our only roadblocks having been setting aside the time to do it! Once that's implemented it will completely change what template code looks like. /Much/ cleaner code, etc. Definitely implement this change! :) Gabriel Cooper. From miguel at yorku.ca Fri May 6 00:28:43 2005 From: miguel at yorku.ca (Miguel Marques) Date: Thu, 05 May 2005 10:28:43 -0400 (EDT) Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <20050505040332.0EA367940F0@longblack.object-craft.com.au> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> <200505042229.00254.fred@polgardy.com> <20050505040332.0EA367940F0@longblack.object-craft.com.au> Message-ID: <20050505.102843.112610619.miguel@yorku.ca> Greetings... On Thu, 05 May 2005 14:03:31 +1000, Andrew McNamara wrote: > I suspect something like the following is closer to the spirit of the > current Albatross code: > > > abc > > def > > > ghi > > > jkl > > > > But I don't see that as any sort of improvement over the I think the improvement is that it makes it much clearer that it's a if/elif/else construct than the al-lookup one does. I often have web designers without a lot of programming experience build/edit pages and I think the above would be preferable. IMHO. Miguel C. Miguel Marques, Assistant Manager, Software Systems Developer Development Services, Computing & Network Services York University, Toronto, Ontario, Canada e-mail: miguel at yorku.ca, voice: (416)736-2100x22684 From fred at polgardy.com Fri May 6 00:38:31 2005 From: fred at polgardy.com (Frederick Polgardy) Date: Thu, 05 May 2005 09:38:31 -0500 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <20050505.102843.112610619.miguel@yorku.ca> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> <200505042229.00254.fred@polgardy.com> <20050505040332.0EA367940F0@longblack.object-craft.com.au> <20050505.102843.112610619.miguel@yorku.ca> Message-ID: <427A2FE7.10905@polgardy.com> Agreed. In fact, I've always avoided the lookup scheme, because I haven't had the time to grok exactly how it works and what it buys you (maybe I've just not seen any really good examples). My only objection to the suggestion quoted below is that the al-if is at a different level of nesting than the other elements. The only thing I could come up with off the top of my head would be something structurally more like: But I'm not sold on it, and any change like that is bound to break existing stuff. Miguel Marques wrote: >Greetings... >On Thu, 05 May 2005 14:03:31 +1000, Andrew McNamara wrote: > > >>I suspect something like the following is closer to the spirit of the >>current Albatross code: >> >> >> abc >> >> def >> >> >> ghi >> >> >> jkl >> >> >> >>But I don't see that as any sort of improvement over the >> >> >I think the improvement is that it makes it much clearer that it's a >if/elif/else construct than the al-lookup one does. >I often have web designers without a lot >of programming experience build/edit pages and I think the above would >be preferable. >IMHO. > > Miguel > From andrewm at object-craft.com.au Mon May 9 16:42:25 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Mon, 09 May 2005 16:42:25 +1000 Subject: [albatross-users] XML and Albatross templates? In-Reply-To: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> References: <20050505025123.F2CA27940F0@longblack.object-craft.com.au> Message-ID: <20050509064225.674757940F0@longblack.object-craft.com.au> >Note that this also means that albatross tags within html tags are no >longer necessary. So this horrible contruct should be a thing of the past: > > > >This is now written: > > I've just checked the implementation, and my example isn't correct. It should read (note the changed attribute name): In this case, the attribute is evaluated, and the result substitued, eg: There is a second notation for boolean attributes: which will evaluate the expression and emit the attribute if result is true: -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From korg at darkqueen.org Fri May 13 12:54:12 2005 From: korg at darkqueen.org (Cameron Blackwood) Date: Fri, 13 May 2005 12:54:12 +1000 Subject: [albatross-users] Back into albatross... again... :) Message-ID: <20050513025412.9B50A5269A@firewall.darkqueen.org> Hi, I tend to drift into and out of albatross coding, and Im currently on the way 'back in' :) and I have a few statements and some questions... :) Hate though I do to sound like Troy McClure, but you might remember me from such classic albatros discussions such as 'needing expr="foo(x,y)" in '. :) :) After a big pause in alb development, Im back :) and Ive forgotten everything that I previously learnt. :( So, excuse the length and amount of rambling in this post... and feel free to comment or ignore as you see fit... 'header' applications. ---------------------- I have this weird idea that I was thinking of, but Ive hit a problem. Lets say Im dreaming of a number of 'game' applications with a single user/login/tracking stage. So the flow of use would be: 1 login page 2 user's page - choice to join or start a game from a list of different ones (eg, tic tak toe, chess, go etc) - list of currently 'running' games (eg, turn 3 of chess game 'fred vrs jane', ttt turn 2 of 'jane vrs -computer-', turn 8 of chess 'jane vrs netfoo' ) 3 user selects a game and goes and plays for a while - input is passed to the correct 'game instance' and the view pages marked up as need using the templates for that specific game type. 4 user drops back to 2 and logs out or plays another Assuming the game state is stored in some other server/db and albatross is just a front end that requests data and marks up the 'view', then I can see two ways to do this: 1) make an uber app with all the possible app pages loaded in with a truck load of s.register_page( 'GameN_pageM', 'GameN_pageM.html') + all inside albatross (all games are just albatross pages) - all pages must be loaded at the start :-/ (hard to modify on the fly) - (Im assuming) performace would suck if it was an apache cgi (given that it would have to create page instances for every game for every request, which is wastefull if you have 20 games with 10 pages each) Hmm. looks like I need to look at al-http 2) have some kind of 'farmer' which takes the request and delivers it to the specific game on the fly. - specific games wouldnt be albatross apps (atleast I cant think of any easy way to do it?) + lean 'albatross' application on front + more 'dynamic' (in that a specific game can have trouble or be added or removed without changing the pages that the albatross application knows about) I like the idea of having the flexability to add/remove new apps as I go without needing to take the front end down (#2), but I cant see any nice way to pass the user info on from the front end 'game header' to an specific albatross 'game' sub-application. (Except maybe to have the front end store the auth info in a cookie and then url redirect the user to the game when they select it, which seems kinda wrong to me for some reason.) (Although I guess if you stored them in a cookie and then url-redirected to a specific game URL then the game could unpack the cookie and store the values in its session context, thus only needing to check it once.) Having written this out, Im thinking that the #1 idea seems to be the better way to go as it keeps it keeps all the 'games' as simple collections of albatross pages (although I guess Id have to keep all the templates in the same directory, as you have to pass a template directory to the albatross application constructor (I havnt tried setting the s.register_page('gameM.pageN','gameM/pageN.html')). Hmmm. Opinions welcome.... as is mocking laughter. :) (Ive mostly just hacked up smaller cgi-apps, never thought of something this 'big'.) Dynamic images for al-input? ---------------------------- The reason that I asked my (Feb last year) question about with variable image generation is that I wanted to do something like this: where create_map_image(ox,oy) talks to the game and generates the image of the map at the offset ox,oy dynamically. You obviously have scroll buttons to change ox and oy ;). Previously I used url hackery to do this, ie, src="create_map_image/54/34" would draw the map at ox=54 oy=53, but that just seems 'wrong'. :) Any ideas how to do this? or should I look at hacking src/expr/srcexpr on al-input for images? (Which I think is probably the Right Thing To Do(tm) :) I was thinking about using a: http://www.object-craft.com.au/projects/albatross/wiki/Macro_20Expand 1 Expanding Albatross Macros in custom tags and I think that page could do with an example of the _dtml_ that uses the tags that it just defined. :) Albatross learning curve.... & wrappers --------------------------------------- Actually its not that bad, :) I picked it up again pretty quickly. Ive ended up making a wrapper for albatross because there are some things that I keep doing all the time and albatross doesnt help me with (or maybe I dont know how to do them neatly). Im wondering if anyone else has 'wrapped' the more unfriendly parts of albatross or does everyone just use it raw? If anyone else has any 'wrapping' suggestions then please post 'em :). Ive only just started back into albatross, so there is probably some stuff that Im missing or that will need to be hacking in later, but number one is that this hides 'context' from the user, so the user just ends up with code like this: class Login( Albatross_wrapper.base_Page ): def work_on_enter(s): s.create_global('username') s.create_local('password') def work_process(s): login,username,passwd=s['login','username','password'] s.DEBUG('login [%s][%s]',username,passwd) if login and username=='admin' and passwd=='foo': s.goto('Game') elif s['quick:korg']: # quick loging for testing.. remove later s.DEBUG('quick login') s['username']='korg' s['password']='a.secret' s.goto('Game') elif s['nuke']: # nuke button? s.nuke() # remove session store class GameApp( Albatross_wrapper.base_App ): pass def main(): app=GameApp( 'toplevel.cgi', (Login,Game,Map) ) app.DEBUG('Logging locals %s',__name__) app.run_cgi( ) create_local and create_global create variables (duh!). (Locals are destroyed when you leave the page). You can __setitem__ (will barf if the variable doesnt exist (not sure if thats what I want just yet)). You can __getitem__ a variable or a list of variables. Yay! Easy unpacking without checking for ctx.local.myvariable then accessing it. Will return 'None' if the variable doesnt exist (again, unsure if thats what I want, but *shrugs*). The base_App works out template directories (by looking for Albatross_templates in your sys.path, which Im not happy with really as Id rather just pass full path names to the register_page() function, which I admit I havnt tried yet... and if that works, then I wont need to pass a template directory as I can just search for each page template as I register the page :). It also names the pages from their class names (ie above, Login is named as Login and uses a template that matches [Ll]ogin{.html|.dtml}. Id like the wrapper to be able to run as a number of different albatross servers types, but Im currently only using: from albatross import SimpleSessionFileApp as Albatross_Application from albatross import SessionFileAppContext as Albatross_Context I also want to make it better at being switched between apache cgi and al-httpd, but I havnt played with al-httpd so Ill do that when I come to it. (Eg, if you call it it runs al-http, if its called, it works as an apache cgi.) I also want to code up an ImagePage that generates page images (with the dynamic generation above) but I havnt got _that_ far back into it yet. ;) Oh and I just like to end by repeating what everyone already knows... that albatross rocks. :) cheers, cam -- / `Rev Dr' cam at darkqueen.org Roleplaying, virtual goth \ < http://darkqueen.org Poly, *nix, Python, C/C++, genetics, ATM > \ [+61 3] 9809 1523[h] skeptic, Evil GM(tm). Sysadmin for hire / ---------- Random Quote ---------- True happiness will be found only in true love. From miguel at yorku.ca Fri May 27 04:05:04 2005 From: miguel at yorku.ca (Miguel Marques) Date: Thu, 26 May 2005 14:05:04 -0400 (EDT) Subject: [albatross-users] Nested tags... Message-ID: <20050526.140504.71105915.miguel@yorku.ca> Greetings... I have the need to do something like the following: ')" whitespace/> Unfortunately only the enclosed al-value gets expanded. Is there a trick I'm not aware of to make this work or is it time for an alx-select tag? Thanks in advance for any help... Miguel C. Miguel Marques, Assistant Manager, Software Systems Developer Development Services, Computing & Network Services York University, Toronto, Ontario, Canada e-mail: miguel at yorku.ca, voice: (416)736-2100x22684 From gabriel.cooper at mediapulse.com Fri May 27 05:38:39 2005 From: gabriel.cooper at mediapulse.com (Gabriel Cooper) Date: Thu, 26 May 2005 15:38:39 -0400 Subject: [albatross-users] Nested tags... In-Reply-To: <20050526.140504.71105915.miguel@yorku.ca> References: <20050526.140504.71105915.miguel@yorku.ca> Message-ID: <429625BF.7020906@mediapulse.com> If they've released the changes that were talked about a few weeks back you should be able to download that and then do the following: If not you could use snakeskin (snakeskin-tools.sf.net) instead to do it like so: (note that I didn't check syntax on these....) but. eh... promoting snakeskin here seems horribly subversive so just go look for the development version of Albatross. ;) Gabriel. Miguel Marques wrote: >Greetings... > >I have the need to do something like the following: > >')" whitespace/> > >Unfortunately only the enclosed al-value gets expanded. >Is there a trick I'm not aware of to make this work or is it time for >an alx-select tag? >Thanks in advance for any help... > > Miguel > >C. Miguel Marques, Assistant Manager, Software Systems Developer >Development Services, Computing & Network Services >York University, Toronto, Ontario, Canada >e-mail: miguel at yorku.ca, voice: (416)736-2100x22684 >_______________________________________________ >Albatross-users mailing list >Albatross-users at object-craft.com.au >https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users > > > From andrewm at object-craft.com.au Fri May 27 09:27:50 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Fri, 27 May 2005 09:27:50 +1000 Subject: [albatross-users] Nested tags... In-Reply-To: <429625BF.7020906@mediapulse.com> References: <20050526.140504.71105915.miguel@yorku.ca> <429625BF.7020906@mediapulse.com> Message-ID: <20050526232750.581BE6F415E@longblack.object-craft.com.au> >If they've released the changes that were talked about a few weeks back >you should be able to download that and then do the following: > > Yes, the development snapshot has this functionality, and this is the way I would recommend getting the behaviour you want. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From miguel at yorku.ca Fri May 27 22:37:31 2005 From: miguel at yorku.ca (Miguel Marques) Date: Fri, 27 May 2005 08:37:31 -0400 (EDT) Subject: [albatross-users] Nested tags... In-Reply-To: <20050526232750.581BE6F415E@longblack.object-craft.com.au> References: <20050526.140504.71105915.miguel@yorku.ca> <429625BF.7020906@mediapulse.com> <20050526232750.581BE6F415E@longblack.object-craft.com.au> Message-ID: <20050527.083731.74730425.miguel@yorku.ca> Greetings... On Fri, 27 May 2005 09:27:50 +1000, Andrew McNamara wrote: > >If they've released the changes that were talked about a few weeks back > >you should be able to download that and then do the following: > > > > > > Yes, the development snapshot has this functionality, and this is the > way I would recommend getting the behaviour you want. > I have been hoping for a new release to come out because there's several changes in it that would greatly simplify code I'm writing. Including the one above. I am, however, a bit weary about using a development snapshot to deploy applications. Is it mostly stable at this point? Miguel C. Miguel Marques, Assistant Manager, Software Systems Developer Development Services, Computing & Network Services York University, Toronto, Ontario, Canada e-mail: miguel at yorku.ca, voice: (416)736-2100x22684 From tchur at optushome.com.au Sat May 28 00:11:45 2005 From: tchur at optushome.com.au (Tim Churches) Date: Sat, 28 May 2005 00:11:45 +1000 Subject: [albatross-users] Nested tags... In-Reply-To: <20050527.083731.74730425.miguel@yorku.ca> References: <20050526.140504.71105915.miguel@yorku.ca> <429625BF.7020906@mediapulse.com> <20050526232750.581BE6F415E@longblack.object-craft.com.au> <20050527.083731.74730425.miguel@yorku.ca> Message-ID: <42972AA1.7030307@optushome.com.au> Miguel Marques wrote: > Greetings... > On Fri, 27 May 2005 09:27:50 +1000, Andrew McNamara wrote: > >>>If they've released the changes that were talked about a few weeks back >>>you should be able to download that and then do the following: >>> >>> >> >>Yes, the development snapshot has this functionality, and this is the >>way I would recommend getting the behaviour you want. >> > > I have been hoping for a new release to come out because there's > several changes in it that would greatly simplify code I'm writing. > Including the one above. > I am, however, a bit weary about using a development snapshot to deploy > applications. Is it mostly stable at this point? Yes, it is fine for general use, but I do wish the OC guys would get around to renaming it, because you are not the only user who is wary of it. Tim C From andrewm at object-craft.com.au Tue May 31 17:40:50 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Tue, 31 May 2005 17:40:50 +1000 Subject: [albatross-users] Albatross 1.30 released Message-ID: <20050531074050.B44F57940DC@longblack.object-craft.com.au> OVERVIEW Albatross is a small toolkit for developing highly stateful web applications. The toolkit has been designed to take a lot of the pain out of constructing intranet applications although you can also use Albatross for deploying publicly accessed web applications. In slightly more than 4500 lines of Python (according to pycount) you get the following: * An extensible HTML templating system similar to DTML including tags for: - Conditional processing. - Macro definition and expansion. - Sequence iteration and pagination. - Tree browsing. - Lookup tables to translate Python values to arbitrary template text. * Application classes which offer the following features: - Optional server side or browser side sessions. - The ability to place Python code for each page in a dynamically loaded module, or to place all page processing code in a single mainline. * The ability to deploy applications as CGI, FastCGI, mod_python or a pure python HTTP server by changing less than 10 lines of code. The toolkit application functionality is defined by a collection of fine grained mixin classes. Nine different application types and six different execution contexts are prepackaged, you are able to define your own drop in replacements for any of the mixins to alter any aspect of the toolkit semantics. Application deployment is controlled by your choice of either cgi, FastCGI, mod_python, or BaseHTTPServer Request class. It should be possible to develop a Request class for Medusa or Twisted to allow applications to be deployed on those platforms with minimal changes. Albatross comes with over 170 pages of documentation. HTML, PDF and PostScript formatted documentation is available from the toolkit homepage. The toolkit homepage: http://www.object-craft.com.au/projects/albatross/ The Albatross mailing list subscription and archives: http://object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users CHANGES SINCE 1.20 * Any HTML tag can now be prefixed with "al-" allowing any attribute to be the result of python evaluation. For example: could produce and: could produce * Since macros and lookups are an application global resource, they can only be defined once per application, however this was not previously checked. Redefinition of macros or lookups will now result in an ApplicationError exception. * an in-line version of the tag has been introduced, which is expanded in place if the tag has an expr= attribute. * a new tag has been added to allow templates to assert that specific Albatross features are available, or templating scheme version number is high enough. * "Cache-Control: no-cache" is now set in addition to "Pragma: no-cache" - the former is defined for HTTP/1.1, the later for HTTP/1.0. * Simplified session cookie handling. BUGFIXES SINCE 1.20: * FastCGI apps were not being explicitly finalised, relying instead on their object destructor, with the result that writing application output (or errors) would be indefinitely deferred if object cycles existed. We now call "fcgi.Finish()" from the fcgiapp Request.return_code() method. * When handling exceptions, the traceback is now explicitly deleted from the local namespace to prevent cycles (otherwise the garbage collection of other objects in the local namespace will be delayed). * Two fixes to the tag: the albatross-specific "list" attribute was leaking into resulting markup, and the use of the "expr" attribute would result in invalid markup being emitted. * Thanks to Robert Fendt for picking this up: the Albatross-generated hidden field input element must not appear naked inside a form element for strict HTML conformance. The solution is to wrap the input elements in div. * BranchingSession sessions could not be "deleted" - the solution is to add a dummy "session" shared by all branches, which is deleted when one branch "logs out". -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/