Python Programming, news on the Voidspace Python Projects and all things techie.
Down, Down, Down.....
Well, Voidspace is back up after an eighteen hour outage. I did wonder if it would come back at all ! The website for the host was also down. They are an ultra budget host and their technical support is frankly rubbish.
On the other hand this is only about the second or third outage that I'm aware of in almost a year, and they have Python 2.3.4 installed. As I've been with them almost a year I have to decide whether to stay with them, or move elsewhere. If a job I'm working on comes through, I might be able to get a Python-hosting.com account. It's looking good
Ironically, this outage happened on the day that I get mentioned twice in Daily-URL. *sigh*.
I've just got Sourceforge projects setup and configured for rest2web and the guestbook. I still need to edit the documentation to include the sourceforge logo etc. I was very lucky with the guestbook project. I actually got guestbook as my project name - it was in use, but abandoned; so I've taken it over.
I've been using releaseforge to do the actual releases. It's written in Python, but because it uses the QT library, you need to use a binary package on windows . releaseforge makes new releases about 100 times easier than through the sourceforge web interface.
|||The QT library is commercial for windows, but license holders (like Phil Schwartz) are allowed to distribute binary packages.|
The Snake is Still Serving
A few weeks ago I blogged about a simple server with SSI I'd hacked together. Well...... I've hacked it around some more.
What I needed was a server that ignored requests that weren't in the localhost domain. It would also be nice if I could have it serve files from my 'FTP Changes' folder - but if the file isn't found there check my 'FTP Mirror' folder. This means I can keep a single folder of edits for upload, and have my server check there first.
So I've hacked CGIHTTPServerWithSSI to do both of these. The easiest way to achieve the first objective was to have the server run as a proxy server. You tell your browser to fetch everything through localhost:9080. When run in this way CGIHTTPServerWithSSI checks if the request is for a URL in the localhost domain. If it isn't it drops the request, if it is it serves it itself.
The second objective is achieved by specifying an alternative location to check.
It's nice that writing a proxy server is so simple (in principle anyway - a heavier duty solution might be harder work). The only difference is that you get the whole URL as the path when the server is being used as a proxy. In terms of the CGIHTTPServer code , this means that if self.path starts with http:  then we know we are running as a proxy...We can then use urlparse.urlsplit to separate the actual path from the domain.
You can download version 0.3.0 from the recipebook.
|||On which this is based.|
A Sad Day
It's a bit sad, but I wasn't able to resolve the fluid layout with IE problems on Voidspace. The new design looked fine so long as you had a full sized window, but anything smaller than a 1024x768 resolution with full screen window, and the sidebar would start to overlap the contents. This is basically because IE ignores the min-width CSS properties .
A table layout, along with CSS for styles, is the hybrid approach that Jeffrey Zeldmann recommends in Designing with Web Standards - as part of an XHTML 1.0 Transitional design.
I've actually used the table trick from Dive into Accesibility by Mark Pilgrim. It puts the body of the page before the sidebar in the source. This means that textual browsers don't have to go through the sidebar every time in order to get to the actual contents.....
|||The site behaved nicely on Firefox. I know the reference I supplied talks more about max-width, and that in theory the width property behaves like min-width for IE... except it didn't work. The trouble was I had two elements (sidebar and page body) that I wanted to both have a minimum width and yet have a total width of 90% of the window size.... unless the window was too small. Simple hey ! The thing is, with a table it just works.|
The Halls of Science, Technology, Computers, and Stuff
The first section of my website rendered with rest2web is now online !
rest2web in the Wild
Finally, the long awaited (ahem) release of rest2web. It's an early release - lot's more features still to be added - but it all works. Hurrah
For those who haven't been religiously reading this blog over the last few weeks, here's the lowdown :
rest2web is a tool for autogenerating websites. It allows you to store your contents in reST format, and generate pages and indexes from templates. It uses a simple but flexible templating system and generates index pages and navigation links.
This means that adding new pages is as easy as dropping a text file into the right folder. rest2web will handle adding the link to the index page and creating the new page from a template and the contents. Removing a page is as easy as deleting a single file, and have rest2web automatically rebuild the indexes.
The download includes the rest2web code, and docs and a test site. The test site serves as a simple illustration of how rest2web builds pages and indexes.
For full details see any of the following pages :
The next features to add will be auto sitemap generation and a bigger change (under the hood) to make the index data available to every page in a section. This will allow pages to have sidebars with links, rather than just a single index page.
I'm already building part of the Voidspace website with rest2web, over the next few months it will take over....
So far tested on Lunix and Windoze, if anyone tries it on the Mac I'd like to hear...
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.