From tchur at optushome.com.au Sat Oct 2 09:42:22 2004 From: tchur at optushome.com.au (Tim Churches) Date: 02 Oct 2004 09:42:22 +1000 Subject: [albatross-users] Twisted and Nevow In-Reply-To: <1077621715.2526.21.camel@debian> References: <20040224092509.DD7FB534DE@firewall.darkqueen.org> <1077621715.2526.21.camel@debian> Message-ID: <1096674142.1282.138.camel@emilio> See http://www.pollenation.net/journal/matt.php?p=38 Matt, does this mean you've abandoned Albatross? If so, any lessons to be learnt? -- 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 From sheila at thinkspot.net Mon Oct 11 11:46:31 2004 From: sheila at thinkspot.net (Sheila King) Date: Sun, 10 Oct 2004 18:46:31 -0700 Subject: [albatross-users] Help catching an exception... In-Reply-To: <1096484180.15746.52.camel@aslan> References: <1096484180.15746.52.camel@aslan> Message-ID: I want to thank everyone who replied to my inquiry. It had been quite a long time since I'd delved into the source code of app.py, and these types of suggestions were just what I needed to get me back on track. Thanks again, -- Sheila King http://www.thinkspot.net/sheila/ http://www.k12groups.org --On Wednesday, September 29, 2004 2:56 PM -0400 Neal Stephenson wrote: > HI, > > Not sure if this is right, but I override handle_exception in a > subclass of the Application that I use for all my apps. > > Neal > > > On Wed, 2004-09-29 at 14:12, Sheila King wrote: >> Hello, >> >> I'm using Albatross to develop an account management interface for the >> web hosting company that I work for. >> >> In the testing process, I have determined that certain type of request >> urls will cause Albatross to throw an exception, and I'm trying to catch >> that exception to redirect to a public error page of my choosing so that >> end users do not see the Python tracebacks. >> >> Mind you, it would be some odd circumstance that would even lead to this >> type of error, but I am hoping to cover as many error situations as I >> can. >> >> The problem is this: >> >> A correct URL for the application might look like this: >> >> http://example.net/cgi-dev/mgr.py/createlogin >> >> But suppose this URL is requested instead: >> http://example.net/cgi-dev/mgr.py/mgr.py/createlogin >> >> Then albatross gives the following traceback: >> ----- >> Template traceback (most recent call last): >> >> Traceback (most recent call last): >> File "albatross/app.py", line 279, in run >> self.load_page(ctx) >> File "albatross/randompage.py", line 29, in load_page >> self.load_page_module(ctx, page) >> File "albatross/app.py", line 435, in load_page_module >> raise ApplicationError('%s (in %s)' % (e, mod_dir)) >> ApplicationError: No module named createlogin (in ./pages/mgr/py) >> ----- >> >> >> In the __main__ function of the mgr.py file I tried adding >> a try/except to wrap the whole invocation of an albatross app >> (I know...bad programming...but...well...) >> >> Here is the except block I put on: >> >> except ApplicationError, e: >> Request = "http://www.Example.net/cgi-bin/mgr.py/errorpage" >> app = qaApp() >> ctx = qaAppContext(app) >> ctx.locals._errmssg = e >> app.run(qaRequest(Request)) >> >> Unfortunately, it appears to be having no effect, and I am still >> getting the identical traceback as before. >> >> I also tried changing the "except" statement to >> >> except albatross.ApplicationError, e >> >> and also tried adding an import statement at the top of the code >> >> from albatross.common import AlbatrossError >> >> and changing the except statement to: >> >> except AlbatrossError, e >> >> But again, no change in the traceback produced for that particular URL. >> >> >> I sure would appreciate any tips on how to catch this error and >> redirect to an error page of my choosing... >> >> Thank you, >> >> >> _______________________________________________ >> Albatross-users mailing list >> Albatross-users at object-craft.com.au >> https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users > -- > Neal Stephenson Phone: (416) 736-2100 x40211 > Manager, Development Services Fax: (416) 736-5830 > Communication and Network Services Steacie T103, 4700 Keele St. > York University Toronto, On., Canada M3J 1P3 > > > From andrewm at object-craft.com.au Mon Oct 18 22:14:30 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Mon, 18 Oct 2004 22:14:30 +1000 Subject: [albatross-users] Release 1.11 Message-ID: <20041018121430.6848D3C8E2@coffee.object-craft.com.au> I've posted a 1.11 release of Albatross on the web site: http://www.object-craft.com.au/projects/albatross/download.html Note that the only change between this and 1.11pre2 is the version number. I'm working on a 1.2, which will be based on albatross-1.2-dev-20040203. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From andrewm at object-craft.com.au Tue Oct 19 23:51:42 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Tue, 19 Oct 2004 23:51:42 +1000 Subject: [albatross-users] Albatross 1.20 released Message-ID: <20041019135142.0B2F23C24C@coffee.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 3000 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 160 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.1 There have been many improvements and bug fixes since release 1.1. The following page describes the changes in detail. http://www.object-craft.com.au/projects/albatross/albatross/rel-1.20.html Highlights include: * A new BranchingSessionContext application context class, that provides better syncronisation between browser state and application state when the application state is stored server-side. * Improved adapters for the different deployment modes (CGI, FastCGI, mod_python, standalone, etc). Application status codes (such as HTTP_INTERNAL_SERVER_ERROR) are now returned to the browser. * The page module loader in PageModuleMixin has been reimplemented so that it does not pollute sys.modules. Page modules are now loaded into a synthetic module's namespace, rather than the global module namespace. This will break code that defined classes in page modules and placed instances of those classes into the session. * Multi-instance response headers are now supported (so, for example, more than one Cookie can be set. The ResponseMixin.get_header() method now returns a list rather than a single string. ctx.req_equals(name) now checks for name.x if name is not found. This makes using image maps as buttons easier. * Under some circumstances, redirect_url() would redirect to incorrect or invalid URLs (for example, an https app would redirect to http) - the URI parsing has been refactored, and this bug has been fixed. Tests were also added for the refactored URI parsing. * Several cookie handling bugs were fixed. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From gnb at itga.com.au Tue Oct 26 16:57:40 2004 From: gnb at itga.com.au (Gregory Bond) Date: Tue, 26 Oct 2004 16:57:40 +1000 Subject: [albatross-users] Web-based SQL record editor? Message-ID: <417DF564.30207@itga.com.au> [A bit OT for the Albatross list, but maybe not.] I'm looking for something that will allow me to easily whip up simple web pages to edit/delete/add records to an SQL database. Ideally, it would know enough about Sybase system tables to extract DB schema etc itself without a whole heap o configuration. Ideally, in python to work with Albatross, but I'll look at other languages/toolkits. I can't imagine I'm the first person to ask about this, but an hour or two of googling/sourceforge searching only turned up MySQL admin tools. Maybe I just don't know what to ask for. From andrewm at object-craft.com.au Tue Oct 26 17:26:15 2004 From: andrewm at object-craft.com.au (Andrew McNamara) Date: Tue, 26 Oct 2004 17:26:15 +1000 Subject: [albatross-users] Web-based SQL record editor? In-Reply-To: <417DF564.30207@itga.com.au> References: <417DF564.30207@itga.com.au> Message-ID: <20041026072615.0FE8F3C79E@coffee.object-craft.com.au> >[A bit OT for the Albatross list, but maybe not.] > >I'm looking for something that will allow me to easily whip up simple >web pages to edit/delete/add records to an SQL database. Ideally, it >would know enough about Sybase system tables to extract DB schema etc >itself without a whole heap o configuration. Ideally, in python to work >with Albatross, but I'll look at other languages/toolkits. > >I can't imagine I'm the first person to ask about this, but an hour or >two of googling/sourceforge searching only turned up MySQL admin tools. >Maybe I just don't know what to ask for. That's because it's a big hard ugly problem in the skin of a trivial problem... 8-) I've looked at a whole bunch of "solutions" to this problem, as well as having written a few of my own (the most recent of which were done for clients) - none of them are entirely satisfactory. The "object-relational" adapters (of which there are several fairly complete Python examples) are not entirely suitable for use in Albatross apps - the primary problem being the object life cycle: typically they deserialise objects from the database and back again, but for an Albatross database object, you also want to be able to serialise the object in the session while you're working on it. The other problem you will trip over is type conversions. For quick and dirty web interfaces to database rows, the temptation is to expose the database-object directly in the form - this works... to a point. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ From neel at mediapulse.com Tue Oct 26 23:41:10 2004 From: neel at mediapulse.com (Michael C. Neel) Date: Tue, 26 Oct 2004 09:41:10 -0400 Subject: [albatross-users] Web-based SQL record editor? In-Reply-To: <417DF564.30207@itga.com.au> References: <417DF564.30207@itga.com.au> Message-ID: <1098798070.20552.5.camel@mike.mediapulse.com> On Tue, 2004-10-26 at 02:57, Gregory Bond wrote: > [A bit OT for the Albatross list, but maybe not.] > > I'm looking for something that will allow me to easily whip up simple > web pages to edit/delete/add records to an SQL database. Ideally, it > would know enough about Sybase system tables to extract DB schema etc > itself without a whole heap o configuration. Ideally, in python to work > with Albatross, but I'll look at other languages/toolkits. > > I can't imagine I'm the first person to ask about this, but an hour or > two of googling/sourceforge searching only turned up MySQL admin tools. > Maybe I just don't know what to ask for. It's going to be harder, since you are looking for a tool to a closed source database (sybase --> ms sql?). If you can run either MySQL or Postgres, the sf.net projects PHPMyAdmin and PHPPgAdmin are very well written and robust (and very similar to each other). There also maybe a port of either of these to Sysbase. Usally closed source databases include a gui managment tool (though maybe not web enabled), so there probably isn't alot of draw to rewrite one. I'm sure there would be a few commercial packages for what you are looking for however. Mike From daryl at learnhouston.com Tue Oct 26 23:51:30 2004 From: daryl at learnhouston.com (Daryl L. L. Houston) Date: Tue, 26 Oct 2004 09:51:30 -0400 Subject: [albatross-users] Web-based SQL record editor? In-Reply-To: <1098798070.20552.5.camel@mike.mediapulse.com> References: <417DF564.30207@itga.com.au> <1098798070.20552.5.camel@mike.mediapulse.com> Message-ID: <417E5662.2000008@learnhouston.com> On Tue, 2004-10-26 at 02:57, Gregory Bond wrote: >>[A bit OT for the Albatross list, but maybe not.] >> >>I'm looking for something that will allow me to easily whip up simple >>web pages to edit/delete/add records to an SQL database. Ideally, it >>would know enough about Sybase system tables to extract DB schema etc >>itself without a whole heap o configuration. Ideally, in python to work >>with Albatross, but I'll look at other languages/toolkits. >> >>I can't imagine I'm the first person to ask about this, but an hour or >>two of googling/sourceforge searching only turned up MySQL admin tools. >>Maybe I just don't know what to ask for. >> >> FWIW, PHP's got pretty good support for sybase, though processing error output can be a real pain. I don't know of any toolkits specifically for doing what you want, though I'm sure there are plenty of abstraction layers that would make the actual data manipulation piece fairly transparent. I'm on board with Mike's suggestion that you consider switching to mysql or postgres. Newer versions of mysql using InnoDB tables support much of what's supported by sybase/mssql, and I hear postgres is very robust, though I've never used it in production and have found its differences from standard SQL and its management to be sort of foreign. If you can't make the switch, you might consider looking at sqsh.org, where you'll find CLI utility for manipulating sybase databases. It supports scripting that perhaps you could tap into through a Web interface (though it's not a task I'd want to undertake) to build the tool you need. Probably easier just to use PHP. D