From andrewm at object-craft.com.au Tue Feb 3 11:11:27 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Tue, 03 Feb 2004 11:11:27 +1100 Subject: [albatross-users] need help: file upload example? In-Reply-To: Message from "Carl Higashionna" of "Wed, 28 Jan 2004 14:44:39 -0800." References: Message-ID: <20040203001127.8E2863C0DD@coffee.object-craft.com.au> >>http://www.object-craft.com.au/projects/albatross/albatross/tag-input-file.html >> >>It's at the bottom of the page, there by my request ages ago > >Thank you so much for the quick reply! I guess I didn't really search the >documentation as well as I had thought. This is exactly what I was looking >for! This is probably one of the worst aspects of the documentation - finding the bit you need. If in doubt, post to the list (as you have done). I'm at somewhat of a loss to know how to fix it - suggestions (of any sort) gratefully received (patches even more gratefully received!). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From andrewm at object-craft.com.au Tue Feb 3 11:25:11 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Tue, 03 Feb 2004 11:25:11 +1100 Subject: [albatross-users] Albatross development preview 1.2-dev-20040203 Message-ID: <20040203002511.206913C0DD@coffee.object-craft.com.au> I've just put development snapshot 20040203 on the website. The only change is to the request status handling (although the request objects were refactored and doco changed): http://www.object-craft.com.au/projects/albatross/download/albatross-1.2-dev-20040203.tar.gz 2004-01-15 16:31 andrewm * albatross/apacheapp.py, albatross/app.py, albatross/cgiapp.py, albatross/httpdapp.py, albatross/request.py, doc/albatross.tex, doc/mixins.tex, test/misc/pagemodule.py: Created new RequestBase class containing RequestField and RequestStatus classes, changed apacheapp, cgiapp, fcgiapp and httpdapp over to use the new base. Added new return_code() method to Request objects. Fixed mod_python (apacheapp) status handling (always return apache.OK). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From sh at hob.cx Tue Feb 17 04:24:23 2004 From: sh at hob.cx (Sean Holdsworth) Date: Mon, 16 Feb 2004 17:24:23 +0000 Subject: [albatross-users] Equivalent of PHP include Message-ID: First question to the list, and probably a really dumb one to boot... I can't seem to find a simple equivalent to the PHP include directive. I want to be able to insert the contents of a specified URL at some point in a template, rather like a server side include. This is easy to do using 'al-include' for a file but doesn't seem to work for a URL. I kludged things by making a copy of the remote data in a local file and using 'al-include'. I've also toyed with writing a macro to do this for a general URL but it's such a simple thing to want to do I think I'm missing something. Any clues appreciated. From andrewm at object-craft.com.au Tue Feb 17 14:25:44 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Tue, 17 Feb 2004 14:25:44 +1100 Subject: [albatross-users] Equivalent of PHP include In-Reply-To: Message from Sean Holdsworth of "Mon, 16 Feb 2004 17:24:23 -0000." References: Message-ID: <20040217032545.018723C201@coffee.object-craft.com.au> >First question to the list, and probably a really dumb one to boot... > >I can't seem to find a simple equivalent to the PHP include directive. >I want to be able to insert the contents of a specified URL at some >point in a template, rather like a server side include. This is easy to >do using 'al-include' for a file but doesn't seem to work for a URL. I >kludged things by making a copy of the remote data in a local file and >using 'al-include'. I've also toyed with writing a macro to do this for >a general URL but it's such a simple thing to want to do I think I'm >missing something. Any clues appreciated. You're not missing something - Albatross doesn't do this. I wonder what PHP is doing? It's not a trivial exercise to include the content of another page without breaking the rules of HTML - strictly speaking, it should be stripping off the enclosing , , etc elements (and even this might not be enough). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From tchur at optushome.com.au Tue Feb 17 14:44:51 2004 From: tchur at optushome.com.au (Tim Churches) Date: Tue, 17 Feb 2004 14:44:51 +1100 Subject: [albatross-users] Equivalent of PHP include Message-ID: <200402170345.i1H3j0525850@mail018.syd.optusnet.com.au> An embedded and charset-unspecified text was scrubbed... Name: not available URL: From neel at mediapulse.com Wed Feb 18 00:47:17 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Tue, 17 Feb 2004 08:47:17 -0500 Subject: [albatross-users] Equivalent of PHP include Message-ID: I've grabbed XML documents before with albatross. Not sure a tag would help, since it would be rare to include a document un-parsed inside of a page, but it would be a simple tag. The method I used was: # page module from urllib import urlopen def page_process(ctx): ... pagedata = urlopen("http://www.somesite.com/xml/news.rss") ... doing stuff to pagedata ... ctx.locals._pageresult = pagedata (Actually I parse pagedata inro a list of ocjects to al-for over). I suppose you could do: and get output very similar to PHP. remember, python is batteries included =p Mike > -----Original Message----- > From: Tim Churches [mailto:tchur at optushome.com.au] > Sent: Monday, February 16, 2004 10:45 PM > To: Andrew McNamara > Cc: Sean Holdsworth; albatross-users @ object-craft . com . au > Subject: Re: Re: [albatross-users] Equivalent of PHP include > > > Andrew McNamara wrote: > > > > >First question to the list, and probably a really dumb one to > > boot... > > > > > >I can't seem to find a simple equivalent to the PHP include > > directive. > > >I want to be able to insert the contents of a specified > URL at some > > >point in a template, rather like a server side include. > This is easy > > to > > >do using 'al-include' for a file but doesn't seem to work > for a URL. > > I > > >kludged things by making a copy of the remote data in a local file > > and > > >using 'al-include'. I've also toyed with writing a macro to do this > > for > > >a general URL but it's such a simple thing to want to do I > think I'm > > > > >missing something. Any clues appreciated. > > > > You're not missing something - Albatross doesn't do this. > > > > I wonder what PHP is doing? It's not a trivial exercise to include > > the > > content of another page without breaking the rules of HTML > - strictly > > speaking, it should be stripping off the enclosing , , > > etc elements (and even this might not be enough). > > You're assuming that the referenced URL points to a complete > HTML page. The > URL may point to just a snippet of dynamically generated > HTML, or to a GIF or > PNG graphic, also possibly dynamically generated by a Web > service elsewhere. > > Tim C > _______________________________________________ > Albatross-users mailing list > Albatross-users at object-craft.com.au > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albat ross-users From tchur at optushome.com.au Wed Feb 18 05:32:26 2004 From: tchur at optushome.com.au (Tim Churches) Date: 18 Feb 2004 05:32:26 +1100 Subject: [albatross-users] Equivalent of PHP include In-Reply-To: <200402170345.i1H3j0525850@mail018.syd.optusnet.com.au> References: <200402170345.i1H3j0525850@mail018.syd.optusnet.com.au> Message-ID: <1077042746.1181.38.camel@emilio> On Tue, 2004-02-17 at 14:44, Tim Churches wrote: > You're assuming that the referenced URL points to a complete HTML page. The > URL may point to just a snippet of dynamically generated HTML, or to a GIF or > PNG graphic, also possibly dynamically generated by a Web service elsewhere. Of course, I meant to say "...to an IMG tag which points to a GIF or PNG graphic...". -- Tim C PGP/GnuPG Key 1024D/EAF993D0 available from keyservers everywhere or at http://members.optushome.com.au/tchur/pubkey.asc Key fingerprint = 8C22 BF76 33BA B3B5 1D5B EB37 7891 46A9 EAF9 93D0 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From fabbe at paniq.net Thu Feb 19 09:34:51 2004 From: fabbe at paniq.net (Fabian Fagerholm) Date: Thu, 19 Feb 2004 00:34:51 +0200 Subject: [albatross-users] Announcement: Albatross in Debian Message-ID: <1077143691.2529.33.camel@kernel> Hello everyone, I'm very happy to announce that Albatross has finally made its way into Debian unstable. As I speak, Debian mirrors around the globe are updating and you should be able to apt-get the package in no more than a few hours. Python 2.2 and 2.3 versions are provided, with 2.2 being the default. Installation Please refer to the APT documentation on how to add the neccessary lines for Debian unstable to your sources.list file. Then, you can apt-get install the following: python-albatross -- the current default version (choose this if unsure) python2.2-albatross -- the version for python 2.2 python2.3-albatross -- the version for python 2.3 The packages contains the latest stable version of Albatross (1.10). I'm preparing to release a newer version as soon as a new stable version is released. Reporting Bugs Please use the Debian Bug Tracking System to report bugs in these packages. If the bug is in Albatross itself rather than in my packaging, then consider reporting the issue to Object Craft as well. Known Bugs I know that there are some issues with the packages that may be inconvenient for some people. They don't affect the functionality of albatross. Please don't report these, they will be fixed in an upcoming release, or I have decided not to support those features at the moment. Feel free to discuss them publicly on the mailing list or in private email to me. * There is no python 2.1 version. I don't intend to supply one unless there is demand for it. (And then, the only argument that I buy would be that you have an existing albatross application that uses some feature unique to python 2.1.) * There is no documentation package. This is because a known bug in the dia diagram drawing program prevents generation of the diagrams in the documentation. The bug has recently been fixed, but it will take some time before a new, fixed version of dia will be available. * You will always get the session server and standalone application server, and you can enable a system-wide session server by editing the defaults file in /etc/defaults/albatross. I recently merged the separate session and application server packaged back into the main package because they are so small. A future version of the packaging may see a different kind of split. * The test suite is not run at build-time. This will require some rather large changes to the test suite to support both python 2.2 and 2.3. While it would certainly be nice to run the tests automatically at build time, I do run them manually and make sure they pass before releasing a package. I hope you will find the Debian packages useful, and I welcome bug reports, feedback and patches warmly. Finally, thanks to the Object Craft people for making Albatross! Cheers, -- Fabian Fagerholm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From neel at mediapulse.com Thu Feb 19 09:52:39 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Wed, 18 Feb 2004 17:52:39 -0500 Subject: [albatross-users] Announcement: Albatross in Debian Message-ID: > I'm very happy to announce that Albatross has finally made > its way into > Debian unstable. > The packages contains the latest stable version of Albatross > (1.10). I'm > preparing to release a newer version as soon as a new stable > version is > released. Anyone else see the ironry here? =p On a serious note, good job for making this happen! Thanks, Mike From fabbe at paniq.net Thu Feb 19 22:22:33 2004 From: fabbe at paniq.net (Fabian Fagerholm) Date: 19 Feb 2004 13:22:33 +0200 Subject: [albatross-users] Announcement: Albatross in Debian In-Reply-To: References: Message-ID: <1077189753.17878.13.camel@supertankar-11.cs.helsinki.fi> On Thu, 2004-02-19 at 00:52, Michael C. Neel wrote: > > I'm very happy to announce that Albatross has finally made > > its way into > > Debian unstable. > > > The packages contains the latest stable version of Albatross > > (1.10). I'm > > preparing to release a newer version as soon as a new stable > > version is > > released. > > Anyone else see the ironry here? =p It was late. That's my only defense :) Anyway, just a quick note for those who are not familiar with the Debian release process: new and updated packages always enter "unstable" first. At regular intervals, they are automatically moved to "testing" if they satisfy some quality requirements. Finally, the packages in "testing" will be frozen at some point and become the next "stable" version. So being in Debian unstable is not neccessarily an indicator of the quality of Albatross! As a side note, perhaps Andrew and Dave could comment on the time-frame of making a new stable release? > On a serious note, good job for making this happen! Thanks, I'm currently preparing a new version to address some minor issues with the current package (mostly cosmetic). Cheers, -- Fabian Fagerholm From tchur at optushome.com.au Thu Feb 19 23:17:37 2004 From: tchur at optushome.com.au (Tim Churches) Date: 19 Feb 2004 23:17:37 +1100 Subject: [albatross-users] Announcement: Albatross in Debian In-Reply-To: <1077189753.17878.13.camel@supertankar-11.cs.helsinki.fi> References: <1077189753.17878.13.camel@supertankar-11.cs.helsinki.fi> Message-ID: <1077193057.1835.39.camel@emilio> On Thu, 2004-02-19 at 22:22, Fabian Fagerholm wrote: > On Thu, 2004-02-19 at 00:52, Michael C. Neel wrote: > > > I'm very happy to announce that Albatross has finally made > > > its way into > > > Debian unstable. > > > > > The packages contains the latest stable version of Albatross > > > (1.10). I'm > > > preparing to release a newer version as soon as a new stable > > > version is > > > released. > > > > Anyone else see the ironry here? =p > > It was late. That's my only defense :) I'm sure that Michael didn't intend any criticism of you, Fabian. More of a friendly dig at someone else for being so, err, dilatory with the update preparation process. But Dave has an excuse: he's been busy practicing with his Samba school - I'm told he looks great in spandex and sequins (pot calls kettle black). And Andrew has been flat out helping to save the world from chook germs. True! -- Tim C PGP/GnuPG Key 1024D/EAF993D0 available from keyservers everywhere or at http://members.optushome.com.au/tchur/pubkey.asc Key fingerprint = 8C22 BF76 33BA B3B5 1D5B EB37 7891 46A9 EAF9 93D0 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From fabbe at paniq.net Thu Feb 19 23:58:30 2004 From: fabbe at paniq.net (Fabian Fagerholm) Date: 19 Feb 2004 14:58:30 +0200 Subject: [albatross-users] Announcement: Albatross in Debian In-Reply-To: <1077193057.1835.39.camel@emilio> References: <1077189753.17878.13.camel@supertankar-11.cs.helsinki.fi> <1077193057.1835.39.camel@emilio> Message-ID: <1077195502.1144.21.camel@raakinsaari.cs.helsinki.fi> On Thu, 2004-02-19 at 14:17, Tim Churches wrote: > On Thu, 2004-02-19 at 22:22, Fabian Fagerholm wrote: > > On Thu, 2004-02-19 at 00:52, Michael C. Neel wrote: > > > Anyone else see the ironry here? =p > > > > It was late. That's my only defense :) > > I'm sure that Michael didn't intend any criticism of you, Fabian. No, no, I was just continuing the joke by deliberatly slightly misinterpreting Michael's statement :) > More of a friendly dig at someone else for being so, err, dilatory > with the update preparation process. Well, I guess there'll be a release sooner or later. Considering I took nearly a year just to get this package into Debian, I probably shouldn't be making any suggestions ;) Cheers, -- Fabian Fagerholm From neel at mediapulse.com Fri Feb 20 02:50:28 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Thu, 19 Feb 2004 10:50:28 -0500 Subject: [albatross-users] Apache 2 Filters Message-ID: Apache 2 adds in the concept of filters, in which you can alter content from a handler before it is sent to the client. An example would be taking the output of a perl cgi script and formatting it with albatross. To make this work, I've written a quick apacheapp Filter class, which works just like a request class. Filters are limited in what they can do, so there is a lot of pass statements. In pratice, this would work just like a Request class, ie. app.run(Filter(filter)) - filters are not passed the request object, but a filter object. There should be anything in here to change, but it is a first cut, so apply with caution. It is intended to be placed in the apacheapp.py file with the Request class for mod_python. Mike class FilterRequest(RequestFields): def __init__(self, filter): self.__req = filter.req self.__filter = filter RequestFields.__init__(self, util.FieldStorage(self.__req)) self.__status = 200 def get_uri(self): return self.__req.uri def get_path_info(self): return self.__req.path_info def get_servername(self): try: return self.__req.hostname # mod_python 3 except AttributeError: return self.__req.connection.server.server_hostname # mod_python 2 def get_header(self, name): if self.__req.headers_in.has_key(name): return self.__req.headers_in[name] def write_header(self, name, value): pass def end_headers(self): pass def redirect(self, loc): pass def write_content(self, data): self.__filter.write(data) def set_status(self, status): self.__status = status def status(self): if self.__status == 200: return 0 return self.__status From neel at mediapulse.com Sat Feb 21 03:21:55 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Fri, 20 Feb 2004 11:21:55 -0500 Subject: [albatross-users] Auto list bug/issue... Message-ID: I've come across a strang which is in 1.11+, maybe prior versions as well but I didin't check them. Normally, if you try to have several form fields defined with the same name, you either need to use the "list" argument on the tags, or make the list in the page object/module. This is very nice, because albatross doesn't pull an perl like bs of thinking for you, and letting some bug creep into production because it never caused a problem when testing. However, if you name several fields the same name, but they are different types, you can get a field that will sometimes be a list, sometime a string. To show this, here is a simple template that will show the problem: Select1 Select2 Select3 Select4 Select5
Radio1
Radio2


selbox: if you just submit, selbox is a string og the select box choice. If you also select a radio, selbox is a list of the select box choice and the radio choice. If you change either of the radio buttons to checkboxes you will get the (excpected) traceback error that selbox is not defined as a list. Normally I would dig into the source to find out what's going on, but since I'm pressed for time I thought I'd just send this now and if need be I can dig deeper later. Mike From andrewm at object-craft.com.au Mon Feb 23 11:26:12 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Mon, 23 Feb 2004 11:26:12 +1100 Subject: [albatross-users] Announcement: Albatross in Debian In-Reply-To: Message from Fabian Fagerholm of "Thu, 19 Feb 2004 00:34:51 +0200." <1077143691.2529.33.camel@kernel> References: <1077143691.2529.33.camel@kernel> Message-ID: <20040223002612.1719A3CA79@coffee.object-craft.com.au> >I'm very happy to announce that Albatross has finally made its way into >Debian unstable. As I speak, Debian mirrors around the globe are >updating and you should be able to apt-get the package in no more than a >few hours. Thanks! This is great! I briefly looked into what was involved in producing a debian package, but was scared off, so I really appreciate your work on this. >The packages contains the latest stable version of Albatross (1.10). I'm >preparing to release a newer version as soon as a new stable version is >released. Poke poke... 8-) > * There is no python 2.1 version. I don't intend to supply one > unless there is demand for it. (And then, the only argument that > I buy would be that you have an existing albatross application > that uses some feature unique to python 2.1.) I tend to agree - 2.1 seems to have been bypassed - I think the people who were stuck with old applications stayed with 1.5.2, then jumped directly to 2.2. 2.2 is more stable than 2.1 without breaking too much, and I think 2.3 will prove to more stable again. > * There is no documentation package. This is because a known bug > in the dia diagram drawing program prevents generation of the > diagrams in the documentation. The bug has recently been fixed, > but it will take some time before a new, fixed version of dia > will be available. Dia. Sigh. > * You will always get the session server and standalone > application server, and you can enable a system-wide session > server by editing the defaults file in /etc/defaults/albatross. > I recently merged the separate session and application server > packaged back into the main package because they are so small. A > future version of the packaging may see a different kind of > split. Yes, I tend to agree. > * The test suite is not run at build-time. This will require some > rather large changes to the test suite to support both python > 2.2 and 2.3. While it would certainly be nice to run the tests > automatically at build time, I do run them manually and make > sure they pass before releasing a package. This is a hard choice (it should only be the doc tests that fail) - there may be ways of solving it, but they won't be pretty. I'm a little reluctant to make the test harness more complicated because I worry that bugs will creep in. BTW, I think I updated the doc tests to 2.3 output in the latest snapshots. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From korg at darkqueen.org Tue Feb 24 20:25:09 2004 From: korg at darkqueen.org (Cameron Blackwood) Date: Tue, 24 Feb 2004 20:25:09 +1100 Subject: [albatross-users] al-input type="image" with variable src Message-ID: <20040224092509.DD7FB534DE@firewall.darkqueen.org> Hi everyone! its been ages since Ive had time to play with albatross, but im at it again.... and sadly my albatross brainspace has rusted shut. :( Im trying to make an array of graphic buttons, each clickable. (I dont care about the x,y coords of the click, I just want an The trouble is that the buttons src="" isnt constant, but rather needs to be dynamically generated. ^^^^^^^^ My brain is stalling on how to make the src="" looked up in the context. I have a feeling that Ill be slapping my forhead once i find out, but currently it scapes me. (See, I am actually _really_ rusty). I guess I could wrap a whole lot of 's in 's, but id really rather not. Is it possible to send a variable src= to an al-input? Or am i missing some other better way to do this. (Ive played with albatross before, but that was months and months ago and its all escaped, so sorry if im brainfarting on something obvious). 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 ---------- Science and religion are in full accord but science and faith are in complete discord. From matt at pollenation.net Tue Feb 24 22:21:56 2004 From: matt at pollenation.net (Matt Goodall) Date: Tue, 24 Feb 2004 11:21:56 +0000 Subject: [albatross-users] al-input type="image" with variable src In-Reply-To: <20040224092509.DD7FB534DE@firewall.darkqueen.org> References: <20040224092509.DD7FB534DE@firewall.darkqueen.org> Message-ID: <1077621715.2526.21.camel@debian> On Tue, 2004-02-24 at 09:25, Cameron Blackwood wrote: [snip] > Im trying to make an array of graphic buttons, each clickable. > (I dont care about the x,y coords of the click, I just want an > > The trouble is that the buttons src="" isnt constant, but rather needs > to be dynamically generated. > > > > > ^^^^^^^^ > > > My brain is stalling on how to make the src="" looked up in the > context. I have a feeling that Ill be slapping my forhead once i find > out, but currently it scapes me. (See, I am actually _really_ rusty). Hmm, al-input does not have a srcexpr attribute so it's not going to be as nice as it could be. However, something like this (untested) should work: " name="button-at" value="3,4" /> I assume foo is some function you have made available in the context. Alternatively, you could write a custom tag that understands a srcexpr attribute. There's a custom tag example in the wiki and albatross.tags is fairly straightforward. > > I guess I could wrap a whole lot of 's in 's, but id > really rather not. That would be quite different anyway - it would not submit the form. Cheers, Matt -- Matt Goodall, Pollenation Internet Ltd w: http://www.pollenation.net e: matt at pollenation.net Any views expressed are my own and do not necessarily reflect the views of my employer. From neel at mediapulse.com Wed Feb 25 00:26:34 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Tue, 24 Feb 2004 08:26:34 -0500 Subject: [albatross-users] al-input type="image" with variable src Message-ID: > Hmm, al-input does not have a srcexpr attribute so it's not > going to be > as nice as it could be. However, something like this (untested) should > work: > > type="image" > src="" > name="button-at" > value="3,4" /> > This will work, but you'll need to use ?');"> Mike From andrewm at object-craft.com.au Wed Feb 25 09:34:18 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Wed, 25 Feb 2004 09:34:18 +1100 Subject: [albatross-users] al-input type="image" with variable src In-Reply-To: Message from "Michael C. Neel" of "Tue, 24 Feb 2004 08:26:34 CDT." References: Message-ID: <20040224223418.8BBC53C206@coffee.object-craft.com.au> >> > type="image" >> src="" >> name="button-at" >> value="3,4" /> > >This will work, but you'll need to use albatross doesn't do nested tags inside of tag args. You'll loose the >form recorded hook, but it's really not needed for an image or submit. However, if you've mixed and on the same page, the submitted form will have a hidden __albform__ field - this will cause the fields to be suppressed (this is a simple security measure to prevent users spoofing fields). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From andrewm at object-craft.com.au Wed Feb 25 09:38:15 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Wed, 25 Feb 2004 09:38:15 +1100 Subject: [albatross-users] al-input type="image" with variable src In-Reply-To: Message from "Cameron Blackwood" of "Tue, 24 Feb 2004 20:25:09 +1100." <20040224092509.DD7FB534DE@firewall.darkqueen.org> References: <20040224092509.DD7FB534DE@firewall.darkqueen.org> Message-ID: <20040224223815.30E7F3C206@coffee.object-craft.com.au> >Im trying to make an array of graphic buttons, each clickable. >(I dont care about the x,y coords of the click, I just want an > >The trouble is that the buttons src="" isnt constant, but rather needs >to be dynamically generated. > > > > > ^^^^^^^^ This is something that albatross currently doesn't do, and it's been annoying many of us for some time. The solution is to extend Albatross to provide a mechanism to evaluate any attribute, so you could do something like: Unfortunately, that doesn't help you. It doesn't help me, either - I ran into exactly the same problem yesterday. Note that you can't nest albatross tags (so Matt's suggestion won't work, unfortunately). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From korg at darkqueen.org Wed Feb 25 10:44:49 2004 From: korg at darkqueen.org (Cameron Blackwood) Date: Wed, 25 Feb 2004 10:44:49 +1100 Subject: [albatross-users] al-input type="image" with variable src In-Reply-To: Your message of "Wed, 25 Feb 2004 09:38:15 +1100." <20040224223815.30E7F3C206@coffee.object-craft.com.au> Message-ID: <20040224234449.5D4E2534DF@firewall.darkqueen.org> Andrew McNamara writes: | | | This is something that albatross currently doesn't do, and it's been | annoying many of us for some time. The solution is to extend Albatross | to provide a mechanism to evaluate any attribute, so you could do | something like: | | srcexpr="..." anyone? or maybe it should be expr="..." * That matches * expr="" doesnt seem to be used for type="image" (according to the docs) ?? | | Unfortunately, that doesn't help you. It doesn't help me, either - | I ran into exactly the same problem yesterday. I admit that I tend to do warped things with cgi's, but I was going to be surprised if noone has hit this before ;). Im glad its not just me :) | | Note that you can't nest albatross tags (so Matt's suggestion won't work, | unfortunately). *nod* I tried that road in my previous albatrossing :) so I didnt bother trying it this time. ;) I did nest an but that just seemed messy. I tried "_." but then I remembered that was a zope thing, or atleast from somehere weird inside my rotting brain. So I ended up with: and albatross code to do: if ctx.get_value('newpos'): p=ctx.get_value('newpos') if p[0]=='(' and p[-1]==')': sp=string.split(p[1:-1],',') if len(sp)==2: x=string.atoi(sp[0]) y=string.atoi(sp[1]) ctx.locals.design.view_move(x,y) ctx.locals.msg='Moved view by %s,%s to %s
\n'%(x,y,ctx.locals.desig n.pos) Which isnt very safe, input wise, but its just a hack until I get something else worked out (or im brave enough to try adding srcexpr to albatross :) Actually, that does raise another question, im on albatross-1.10.tar.gz if I was going to try to add srcexpr, then which version of the code would it be best to do that to? -- / `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 ---------- This life is a test. It is only a test. Had this been an actual life, you would have received further instructions as to what to do and where to go. From neel at mediapulse.com Thu Feb 26 00:28:13 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Wed, 25 Feb 2004 08:28:13 -0500 Subject: [albatross-users] al-input type="image" with variable src Message-ID: > Andrew McNamara writes: > | > | > | This is something that albatross currently doesn't do, > and it's been > | annoying many of us for some time. The solution is to > extend Albatross > | to provide a mechanism to evaluate any attribute, so you could do > | something like: > | > | > > srcexpr="..." anyone? > > or maybe it should be expr="..." > > * That matches > * expr="" doesnt seem to be used for type="image" > (according to the docs) I'd opt for argexpr="'''src="food(%d,%d)"''' % (3,4)" so it would be generic enough to use for any weird arg you may need to write, as cusomt onclicks are common for me. Unless the parsse can be written in such a way that an al- pre fix is picked up like Andrew write. Though al- there might be confusing, I'd go with either: anything ending in expr or (my preference) anything leading with an underscore: _src="'foo(%d,&d)' % (3,4)" Mike From gabriel.cooper at mediapulse.com Thu Feb 26 02:42:31 2004 From: gabriel.cooper at mediapulse.com (Gabriel Cooper) Date: Wed, 25 Feb 2004 10:42:31 -0500 Subject: [albatross-users] al-input type="image" with variable src In-Reply-To: References: Message-ID: <403CC267.9020601@mediapulse.com> Michael C. Neel wrote: >I'd opt for argexpr="'''src="food(%d,%d)"''' % (3,4)" > Right-o, especially as this syntax is neither confusing to look at nor tedious to write. ;) >[...] > > _src="'foo(%d,&d)' % (3,4)" > > Nah, much too complex. -- __________________________________ *gabriel.cooper*@mediapulse.com internet developer 865.675.4455 x32 800.380.4514 www.mediapulse.com __________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From gnb at itga.com.au Fri Feb 27 17:30:33 2004 From: gnb at itga.com.au (Gregory Bond) Date: Fri, 27 Feb 2004 17:30:33 +1100 Subject: [albatross-users] Need some hints on: filling in a grid Message-ID: <200402270630.RAA24919@lightning.itga.com.au> I have an application where the user needs to fill in some entries on a grid. Typical size might be 20 rows by 5 columns, and maybe 20% of the squares would need to be entered. (If it helps, the entries should all be integers > 0). I'm struggling to find a natural way to handle this in Albatross. My first cut did something like this: etc This has 3 problems, more or less, as it stands: - Finding out which cells are entered is awkward: for r in range(rows): for c in range(cols): v = getattr(ctx.locals, 'r%dc%d' % (r, c)) if v: # Do stuff # may need to be "v is not None" depending on blanks etc - If I discover an error in the page_process() (i.e. mis-typed cell contents), then redisplaying the page without navigating to a new one blanks all the cells. This is a surprise..... and a pain if if forces a bunch of re-typing. It seems the "fill in the default value from ctx.locals" is not working for al-input when nameexpr is used instead of name? - (this is a web problem more than an Albatross problem...) When typing in a cell, the browser keeps "helpfully" suggesting possible completions in little tool-tip-like boxes. This is a HUGE PITA. Any clues or ideas? From neel at mediapulse.com Sat Feb 28 01:45:58 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Fri, 27 Feb 2004 09:45:58 -0500 Subject: [albatross-users] Need some hints on: filling in a grid In-Reply-To: <200402270630.RAA24919@lightning.itga.com.au> Message-ID: <000201c3fd40$697c1660$0200a8c0@CLAPTON> Aliases to the rescue! I'm going off of the general idea here, you'll have to adapt it, but say it's a 3x3 grid. If we can number each box 1-9 and assume a setup like: 123 456 789 The first we setup a box class, with an albatross alias: class Box(object): def __init__(self, position): self.postition = position self.value = '' def albatross_alias(self): # this must be unique # in a pinch, you can do some id() and time() trickery to make up # a unique value return self.position ... Then in our page module populate a list ... ctx.locals.boxes = [] for i in range(1,10): ctx.locals.boxes.append(Box(i)) ... Then in the template ... ... And back in the page module on submit ... for box in ctx.locals.boxes: do_something(box.value) Mike > -----Original Message----- > From: albatross-users-admin at object-craft.com.au > [mailto:albatross-users-admin at object-craft.com.au] On Behalf > Of Gregory Bond > Sent: Friday, February 27, 2004 1:31 AM > To: albatross-users at object-craft.com.au > Subject: [albatross-users] Need some hints on: filling in a grid > > > I have an application where the user needs to fill in some > entries on a grid. > Typical size might be 20 rows by 5 columns, and maybe 20% of > the squares would > need to be entered. (If it helps, the entries should all be > integers > 0). > > I'm struggling to find a natural way to handle this in Albatross. > > My first cut did something like this: > > > > > > > > etc > > This has 3 problems, more or less, as it stands: > > - Finding out which cells are entered is awkward: > for r in range(rows): > for c in range(cols): > v = getattr(ctx.locals, 'r%dc%d' % (r, c)) > if v: > # Do stuff > # may need to be "v is not None" depending on blanks etc > > - If I discover an error in the page_process() (i.e. > mis-typed cell contents), > then redisplaying the page without navigating to a new one > blanks all the > cells. This is a surprise..... and a pain if if forces a > bunch of re-typing. > It seems the "fill in the default value from ctx.locals" is > not working for > al-input when nameexpr is used instead of name? > > - (this is a web problem more than an Albatross problem...) > When typing in a > cell, the browser keeps "helpfully" suggesting possible > completions in little > tool-tip-like boxes. This is a HUGE PITA. > > Any clues or ideas? > > > > _______________________________________________ > Albatross-users mailing list > Albatross-users at object-craft.com.au > https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albat ross-users From fabbe at paniq.net Sat Feb 28 22:00:01 2004 From: fabbe at paniq.net (Fabian Fagerholm) Date: Sat, 28 Feb 2004 13:00:01 +0200 Subject: [albatross-users] Announcement: Albatross in Debian In-Reply-To: <20040223002612.1719A3CA79@coffee.object-craft.com.au> References: <1077143691.2529.33.camel@kernel> <20040223002612.1719A3CA79@coffee.object-craft.com.au> Message-ID: <1077966001.1286.20.camel@kernel> On Mon, 2004-02-23 at 02:26, Andrew McNamara wrote: > I briefly looked into what was involved in producing a debian package, > but was scared off, so I really appreciate your work on this. It's not that hard actually, you just have to take a million things into account... :) > I tend to agree - 2.1 seems to have been bypassed - I think the people who > were stuck with old applications stayed with 1.5.2, then jumped directly to > 2.2. 2.2 is more stable than 2.1 without breaking too much, and I think > 2.3 will prove to more stable again. There's an upcoming version of the package which fixes some issues. That version will default to python 2.3 since it's the next default version in Debian. > Dia. Sigh. I believe the next release of Dia will have addressed the issues you've had with it. The downside is that your diagrams will have to be adjusted -- and I've already promised to do it for you as soon as I can start building the docs. > This is a hard choice (it should only be the doc tests that fail) - > there may be ways of solving it, but they won't be pretty. I'm a little > reluctant to make the test harness more complicated because I worry that > bugs will creep in. Let's revisit this when I start running the build-time tests automatically. Cheers, -- Fabian Fagerholm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: