From andrewm at object-craft.com.au Fri Oct 7 10:52:02 2005 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Fri, 07 Oct 2005 10:52:02 +1000 Subject: [albatross-users] al-tree In-Reply-To: <20050922101239.GE25942@chronix.treibsand.com> References: <20050922101239.GE25942@chronix.treibsand.com> Message-ID: <20051007005202.2EA4F79C0E2@longblack.object-craft.com.au> >is it possible to start a tree at level 1? So that the >root node is open and not displayed? You might be able to special-case this in the template to suppress the markup for the root node - something like (untested): ... -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From korg at darkqueen.org Tue Oct 18 15:27:21 2005 From: korg at darkqueen.org (Cameron Blackwood) Date: Tue, 18 Oct 2005 15:27:21 +1000 Subject: [albatross-users] al-for / ListIterator question... In-Reply-To: Your message of "Mon, 29 Aug 2005 10:13:40 +1000." Message-ID: <20051018052721.D20D5540DC@firewall.darkqueen.org> Hi, Im using the albatross templater to generate C like code (actually, its real usable C code, but thats beside the point) something that i need some advice on. I have a list of functions with inputs and outputs and im trying to generate code that does something like: ----------------------------- CALL_FUNCTION_( # input1 , input2 , input3 , ... , inputN (NOCOMMA) , # if inputs and outputs then , to seperate , # output1 , output2 , output3 , ... , outputN (NOCOMMA) , ) ----------------------------- to generate: CALL_FUNCTION_foo( in1, in2, in3 , out1, out2 ) But, for seperating arguments, the: , is ugly. I guess what im wanting is a oarg.has_next() or oarg.is_last() or oarg.is_final(). The ways that I can think of to do it are: * abuse pagesize: combined with: , * write my own tag: that might get around the need for the too, especially if combined with... * put the 'is_last()' check into the actual objects Hmm. Advice welcome. :-) cheers, cam PS: I posted here about using albatross in the pyweek games contest.. sadly I got to distracted with pygame/graphics issues to get very far. Oh well, next one is in feb ;) -- / `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 ---------- "I'd crawl over an acre of 'Visual This++' and 'Integrated Development That' to get to gcc, Emacs, and gdb. Thank you." (By Vance Petree, Virginia Power) From fred at polgardy.com Wed Oct 19 00:29:53 2005 From: fred at polgardy.com (Frederick Polgardy Jr) Date: Tue, 18 Oct 2005 09:29:53 -0500 Subject: [albatross-users] al-for / ListIterator question... In-Reply-To: <20051018052721.D20D5540DC@firewall.darkqueen.org> References: <20051018052721.D20D5540DC@firewall.darkqueen.org> Message-ID: <200510180929.53438.fred@polgardy.com> I've done a bit of code-generation (in python, not in albatross), and what I usually do for separated lists is create some variable (called 'sep' or some such) initially assigned to the null string, and set it to a comma at the end of the loop: sep = '' for item in someList: print sep+item sep = ', ' for item in nextList: print sep+item sep = ', ' Doesn't even matter how many lists you're iterating through. The logic should be easy enough to translate into albatross code. HTH, Fred On Tuesday 18 October 2005 00:27, Cameron Blackwood wrote: > Hi, > > Im using the albatross templater to generate C like code (actually, > its real usable C code, but thats beside the point) > something that i need some advice on. > > I have a list of functions with inputs and outputs and im trying to > generate code that does something like: > > > ----------------------------- > > > > CALL_FUNCTION_( > # input1 , input2 , input3 , ... , inputN (NOCOMMA) > > > > , > > > # if inputs and outputs then , to seperate > > > , > > > > # output1 , output2 , output3 , ... , outputN (NOCOMMA) > > > > , > > ) > > > ----------------------------- > > to generate: > > CALL_FUNCTION_foo( > in1, in2, in3 > , > out1, out2 > ) > > > > > But, for seperating arguments, the: > > , > > is ugly. I guess what im wanting is a oarg.has_next() or > oarg.is_last() or oarg.is_final(). > > > The ways that I can think of to do it are: > * abuse pagesize: > > combined with: > , > > * write my own tag: > that might get around the need for the expr="a=oarg.value()"> too, especially if combined with... > > * put the 'is_last()' check into the actual objects > > > Hmm. Advice welcome. :-) > > > cheers, > cam > > PS: I posted here about using albatross in the pyweek games contest.. > sadly I got to distracted with pygame/graphics issues to get very far. > Oh well, next one is in feb ;) > > > -- > / `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 ---------- > "I'd crawl over an acre of 'Visual This++' and 'Integrated Development > That' to get to gcc, Emacs, and gdb. Thank you." > (By Vance Petree, Virginia Power) > _______________________________________________ > Albatross-users mailing list > Albatross-users at object-craft.com.au > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users From korg at darkqueen.org Wed Oct 19 23:00:19 2005 From: korg at darkqueen.org (Cameron Blackwood) Date: Wed, 19 Oct 2005 23:00:19 +1000 Subject: [albatross-users] Re: Albatross-users Digest, Vol 6, Issue 2 In-Reply-To: Your message of "Wed, 19 Oct 2005 12:00:03 +1000." <20051019020003.B90113B5E0@mail.object-craft.com.au> Message-ID: <20051019130019.4B6E8540DC@firewall.darkqueen.org> Frederick Polgardy Jr wrote: | | sep = '' | for item in someList: | print sep+item | sep = ', ' | for item in nextList: | print sep+item | sep = ', ' Very nice solution.... But I ended up putting an is_last variable in each object so I can do this: , Which is still ugly but, I think, readable :) | | HTH, | Fred 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 ---------- I just got my PRINCE bumper sticker ... But now I can't remember WHO he is ... From admin at ccj-online.co.uk Fri Oct 28 00:07:11 2005 From: admin at ccj-online.co.uk (John Abel) Date: Thu, 27 Oct 2005 15:07:11 +0100 Subject: [albatross-users] help! Message-ID: Hi! I'm hoping someone can point me in the right direction. I have a dictionary containing paths, and a description for each. I have assigned each to locals like so: simpleCtx.locals.foundBooks = foundBooks simpleCtx.locals.bookLinks = foundBooks.keys() I've then iterated on the list with this: Picture Will Go There The odd thing, is the list loops twice, and then exits. If I run the cgi from the command line, it processes the entire list, and displays them all ( as per below ). I'm running on OSX 10.4.2, using Apple's Apache. I've tried Python2.3 and Python2.4.2, with the same results. Any pointers would be much appreciated. Regards J Content-Type: text/html Library - Main Page

Main Page


Picture Will Go There MySQL 4.1 Reference Manual
Picture Will Go There Albatross Manual
Picture Will Go There The Networking CD Bookshelf
Picture Will Go There The Networking CD Bookshelf
Picture Will Go There The Perl CD Bookshelf, v4.0
Picture Will Go There The Unix CD Bookshelf, v3.0
Picture Will Go There The Unix CD Bookshelf, v3.0
From gabriel.cooper at mediapulse.com Fri Oct 28 00:30:32 2005 From: gabriel.cooper at mediapulse.com (Gabriel Cooper) Date: Thu, 27 Oct 2005 10:30:32 -0400 Subject: [albatross-users] help! In-Reply-To: References: Message-ID: <4360E488.8010906@mediapulse.com> John Abel wrote: > Hi! > > I'm hoping someone can point me in the right direction. I have a > dictionary containing paths, and a description for each. I have > assigned each to locals like so: > > simpleCtx.locals.foundBooks = foundBooks > simpleCtx.locals.bookLinks = foundBooks.keys() > > I've then iterated on the list with this: > > > > Picture Will Go There > value expr="foundBooks[ book.value() ]"> > > > > The odd thing, is the list loops twice, and then exits. If I run the > cgi from the command line, it processes the entire list, and displays > them all ( as per below ). The code looks fine to me. I'd suggest printing out bookLinks and foundBooks in tags just before the for loop to make sure it was what you thought it was. Perhaps it was modified somewhere. This idea is reinforced by the fact that the code itself works in a controlled environment. Hope this helps. Gabriel. From admin at ccj-online.co.uk Fri Oct 28 01:12:41 2005 From: admin at ccj-online.co.uk (John Abel) Date: Thu, 27 Oct 2005 16:12:41 +0100 Subject: [albatross-users] help! In-Reply-To: <4360E488.8010906@mediapulse.com> References: <4360E488.8010906@mediapulse.com> Message-ID: On 27 Oct 2005, at 15:30, Gabriel Cooper wrote: > > The code looks fine to me. I'd suggest printing out bookLinks and > foundBooks in tags just before the for loop to make sure > it was what you thought it was. Perhaps it was modified somewhere. > This idea is reinforced by the fact that the code itself works in a > controlled environment. > > Hope this helps. > > Gabriel. > According to the command line, bookLinks contains: ['BooksOnline/perl4/index.htm', 'BooksOnline/networking/ index.htm', 'BooksOnline/unix3/index.htm', 'BooksOnline/albatross/index.html', 'BooksOnline/MySQL/ index.html', 'BooksOnline/unix3/index.html', 'BooksOnline/networking/index.html'] According to the web browser, it contains: ['BooksOnline/MySQL/index.html', 'BooksOnline/albatross/index.html'] foundBooks shows a similar discrepency, command line is: {'BooksOnline/perl4/index.htm': 'The Perl CD Bookshelf, v4.0', 'BooksOnline/networking/index.htm': 'The Networking CD Bookshelf', 'BooksOnline/unix3/index.htm': 'The Unix CD Bookshelf, v3.0', 'BooksOnline/albatross/ index.html': 'Albatross Manual', 'BooksOnline/MySQL/ index.html': 'MySQL 4.1 Reference Manual', 'BooksOnline/unix3/index.html': 'The Unix CD Bookshelf, v3.0', 'BooksOnline/networking/index.html': 'The Networking CD Bookshelf'} whereas the browser shows: {'BooksOnline/MySQL/index.html': 'MySQL 4.1 Reference Manual', 'BooksOnline/albatross/index.html': 'Albatross Manual'} The output is consistent, in that it is always the same items that get displayed. I've tried viewing the page in Safari, and Camino, with no joy. Regards J From fred at polgardy.com Fri Oct 28 03:55:04 2005 From: fred at polgardy.com (Frederick Polgardy) Date: Thu, 27 Oct 2005 12:55:04 -0500 Subject: [albatross-users] help! In-Reply-To: References: Message-ID: <43611478.1010908@polgardy.com> Do you modify locals.bookLinks or locals.foundBooks anywhere else in your code? It's really hard to tell what's going on from what we're seeing here. Can you post a small but complete demo that illustrates the problem? John Abel wrote: > Hi! > > I'm hoping someone can point me in the right direction. I have a > dictionary containing paths, and a description for each. I have > assigned each to locals like so: > > simpleCtx.locals.foundBooks = foundBooks > simpleCtx.locals.bookLinks = foundBooks.keys() > > I've then iterated on the list with this: > > > > Picture Will Go There > value expr="foundBooks[ book.value() ]"> > > > > The odd thing, is the list loops twice, and then exits. If I run the > cgi from the command line, it processes the entire list, and displays > them all ( as per below ). > > I'm running on OSX 10.4.2, using Apple's Apache. I've tried > Python2.3 and Python2.4.2, with the same results. > > Any pointers would be much appreciated. > > Regards > > J > > Content-Type: text/html > > > > Library - Main Page > > >

Main Page

>
> cellpadding="0" cellspacing="0"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Picture Will Go There > MySQL 4.1 Reference Manual >
Picture Will Go There > Albatross Manual >
Picture Will Go There > The Networking CD Bookshelf >
Picture Will Go There > The Networking CD Bookshelf >
Picture Will Go There > The Perl CD Bookshelf, v4.0 >
Picture Will Go There > The Unix CD Bookshelf, v3.0 >
Picture Will Go There > The Unix CD Bookshelf, v3.0 >
> > > > _______________________________________________ > Albatross-users mailing list > Albatross-users at object-craft.com.au > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users > From gabriel.cooper at mediapulse.com Fri Oct 28 04:10:05 2005 From: gabriel.cooper at mediapulse.com (Gabriel Cooper) Date: Thu, 27 Oct 2005 14:10:05 -0400 Subject: [albatross-users] help! In-Reply-To: References: <4360E488.8010906@mediapulse.com> Message-ID: <436117FD.70906@mediapulse.com> > According to the command line, bookLinks contains: > > ['BooksOnline/perl4/index.htm', 'BooksOnline/networking/ > index.htm', 'BooksOnline/unix3/index.htm', > 'BooksOnline/albatross/index.html', 'BooksOnline/MySQL/ > index.html', 'BooksOnline/unix3/index.html', > 'BooksOnline/networking/index.html'] > > According to the web browser, it contains: > > ['BooksOnline/MySQL/index.html', 'BooksOnline/albatross/index.html'] > > foundBooks shows a similar discrepency Great, that narrows it down. Just follow through your code looking for places you might be writing to foundBooks. Somewhere along the way you're blowing records away. That's about all the use I can be without seeing more code. From admin at ccj-online.co.uk Fri Oct 28 04:21:59 2005 From: admin at ccj-online.co.uk (John Abel) Date: Thu, 27 Oct 2005 19:21:59 +0100 Subject: [albatross-users] help! In-Reply-To: <43611478.1010908@polgardy.com> References: <43611478.1010908@polgardy.com> Message-ID: No problem, here's the cgi, and the templates. The code is fairly explanatory. I have a function, which takes a directory listing, and looks in the sub-directories for index.html files. If an index page is found, it then returns the contents of , along with the path of the index file. My directory structure looks like: Sites - cgi-bin - - libLibrary - BooksOnline - - albatross - - MySQL - - Python-Docs-2.4.2 I appreciate all the help, guys! -------------- next part -------------- A non-text attachment was scrubbed... Name: library.cgi Type: application/octet-stream Size: 2179 bytes Desc: not available URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20051027/02ab50ec/attachment.obj> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20051027/02ab50ec/attachment.html> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.object-craft.com.au/pipermail/albatross-users/attachments/20051027/02ab50ec/attachment-0001.html> -------------- next part -------------- On 27 Oct 2005, at 18:55, Frederick Polgardy wrote: > Do you modify locals.bookLinks or locals.foundBooks anywhere else > in your code? It's really hard to tell what's going on from what > we're seeing here. Can you post a small but complete demo that > illustrates the problem? > > John Abel wrote: > > >> Hi! >> >> I'm hoping someone can point me in the right direction. I have a >> dictionary containing paths, and a description for each. I have >> assigned each to locals like so: >> >> simpleCtx.locals.foundBooks = foundBooks >> simpleCtx.locals.bookLinks = foundBooks.keys() >> >> I've then iterated on the list with this: >> >> <al-for iter="book" expr="bookLinks"> >> <tr> >> <td style="width: 15%;">Picture Will Go There</ >> td> >> <td><a href='<al-value expr="book.value >> ()">'><al- value expr="foundBooks[ book.value() ]"></a></td> >> </tr> >> </al-for> >> >> The odd thing, is the list loops twice, and then exits. If I run >> the cgi from the command line, it processes the entire list, and >> displays them all ( as per below ). >> >> I'm running on OSX 10.4.2, using Apple's Apache. I've tried >> Python2.3 and Python2.4.2, with the same results. >> >> Any pointers would be much appreciated. >> >> Regards >> >> J >> >> Content-Type: text/html >> >> <html> >> <head> >> <title>Library - Main Page >> >> >>

Main Page

>>
>> > cellpadding="0" cellspacing="0"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
Picture Will Go There> td> >> >> MySQL 4.1 Reference Manual >>
Picture Will Go There> td> >> >> Albatross Manual >>
Picture Will Go There> td> >> >> The Networking CD Bookshelf >>
Picture Will Go There> td> >> >> The Networking CD Bookshelf >>
Picture Will Go There> td> >> >> The Perl CD Bookshelf, v4.0 >>
Picture Will Go There> td> >> >> The Unix CD Bookshelf, v3.0 >>
Picture Will Go There> td> >> >> The Unix CD Bookshelf, v3.0 >>
>> >> >> >> _______________________________________________ >> Albatross-users mailing list >> Albatross-users at object-craft.com.au >> https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross- >> users >> >> > >