Python Programming, news on the Voidspace Python Projects and all things techie.
I'm about to go home on this gorgeous sunny afternoon. That means I'm offline until Tuesday. (UK bank holiday).
A friend has lent me a Mac (an old G3) to test rest2web on. There is also someone new using my guestbook - hurrah ! See the link on the new example pipeline server by www.markup.co.uk.
Yep - it's actually now possible to check rest2web out of a subversion repository, thanks to the nice folks at www.python-hosting.com.
Have a wander over to : svn.rest2web.python-hosting.com/trunk
The version over there contains several new features, most of which are documented. I haven't released yet because the documentation isn't finished and a feature called indextree isn't fully working yet.
It does feature a nice improvement, which is a new keyword template-encoding in the restindex. This means that you don't need to specify an output encoding to match your template encoding, but can choose whatever output encoding you want. As usual, if you don't specify an encoding for your template, rest2web will guess for you.
The real homepage for rest2web is over here.
I'm wondering whether to add the next feature before doing the next release... hmmm....
Now on CD
I've just spotted an interesting little tidbit in the archives of the Education Special Interest Group, a Python email list.
Someone has posted instructions on how to build a Movable Python CD for use with VPython. He also reports a couple of problems with Movable Python. Notably using on a Windows 98 machine. It might be time to start looking at Movable Python again, and see if this can be resolved . Busy, busy, busy.
This is copied from : http://firstname.lastname@example.org/msg00704.html
How to Make a Movable Python CD with VPython, Numeric, and numarray:
- The computer which is to burn the CD should have Python and VPython installed.
- Download and unzip Movable Python Standard 0.4.6-2.4. The standard distribution comes with IPython, psyco, wxPython, IDLE, and SPE built in. Available at: http://sourceforge.net/project/showfiles.php?group_id=126756
- Next, go to C:\Python24\Lib\sitepackages\ and copy the folders numarray, Numeric, Visual, and the file Numeric.pth.
- Paste them into the Movable Python movpy\lib\ folder.
- Edit the syspaths.pth file located in movpy\lib\ to include the word Numeric.
- Burn the movpy folder onto a CD and you're done!
This is NOT a boot CD (like Knoppix). Windows must be up and running on the computer that is to execute Movable Python. To use Python on the CD, simply open the file idle.bat or spe.bat on the CD. It will take several seconds for either one to start.
Recent testing has shown that the CD will work on CITRIX XP workstations, but Vpython is too slow to be useful. In addition, I have NOT had success using the CD on the Win98 workstations. XP workstations are fine.
All thanks to a gentleman called Frank Noschese. Hmmm... I might add this to the documentation sometime.
Note: A solution for Windoze 98 that is likely to work is; to build Movable Python on a Windows 98 machine. Another advantage of doing this, is that you can tell PyDistFreeze to include Numeric, Numarray, and Visual, automatically. This requires the source distribution and playing with the config file.
|||Although it's likely to be an issue with VPython or one of the other libraries he uses. I did test Movable Python on windoze 98. I believe this is what they call DLL Hell....|
One Step Behind....
Here is the news.... this announcement comes just behind Daily Python-URL who announced it for me yesterday. They must monitor Sourceforge releases for Python packages.
Voidspace Python Guestbook 1.4.3 is now available. Find it at either :
This is a relatively minor update. It does have one important bugfix, as well as several new features, so it is a recommended upgrade. The new version will work with templates from 1.4.2 - but to take advantage of some of the new features you will need to update your templates as well.
As usual, please report any problems Most of the improvements were inspired by 'Marius Soutier' - thanks for the feedback.
The main Changes are :
- There is a new 'language' setting in the template - this allows you to set the 'locale' of the platform. This mainly affects the way dates are displayed. See the docs for how to use it.
- There is a new 'datestring' setting in the template. This allows you to configure the way dates of (new) entries are displayed. See the docs for how to use it.
- All 'logic'  has been moved out of the templates.
- The ObscenityCheck function has been improved. It is now much less likely to score a 'False positive'.
- Changed the position of entrytable when displaying it at the top. This does chaneg the order that template components are displayed in - so beware.
- Bugfix - cgi escaping of the name etc - even if we are using htmldata for comments. (HTML in the name was passing through)
The full changelog is :
2005/05/23 Version 1.4.3 Added a setting to change the locale (language) in guest_template.py Added a setting to change the date formatting in guest_template.py uses strftime format - 'datestring' Time of entries now saved as numbers (so changes to 'datestring' can affect all entries saved as numbers) Removed strftime from pageheader2 - uses **time** and **version** A better ObscenityCheck function Thanks to Marius Soutier for inspiring the above changes. Changed position of entrytable when displaying at the top. Bugfix - cgi escaping name etc - even if we are using htmldata for comments. Moved other logic out of template - now use **htmltags** Moved versionstring out of templates. Remove UTF8 BOM from the guestentries.txt file if necessary.
There is also my suggestion for Version 2 of the guestbook. In order to add admin features like edit and delete posts, I could integrate guestbook with logintools. In which case it would make sense to put the templates in a text config file - and even provide a web interface to change them. this would make it a (bit) harder to install, but probably easier to use.... Hmm....
In other news, I recently discovered that the windows installer package of Pythonutils was broken . Thankfully someone reported it to me, but it's been up for a while and about 100 people have downloaded it. Hopefully they all realised that as Pythonutils is a pure python module, they can use the normal distribution and didn't need the windoze installer.
Another user has reported a bug in listquote, including a bugfix. In applying the fix, I've fixed too much and simplified it's error handling. It now raises an exception (SyntaxError) rather than returning an error code. This changes the behaviour of ConfigObj so I don't know what to do. I'll probably have to change it back and just put in the simple bugfix for the moment.
I'm now much happier about using regular expressions and have used them to simplify various aspects of listquote. I have 'conceptually' worked out most of the implementation details for ConfigObj 4, which will allow nested levels in config files. Because it will use regular expressions (where reasonable) there ought to be less code for more power. I'd love to get cracking on it, but I really need to get rest2web stable first.
rest2web is coming along nicely. I'd just made the next set of changes when I started to add some more complex features. I've already sorted encoding (you are no longer forced to choose an output encoding that matches the encoding of your template), and am now making much more of the index data available to all pages - so you can have quite complex sidebars built automatically if you want.
I've had a user request that I modify it to be useful for 'internationalizing' websites. This change will allow for several named values in templates. At the moment the only content values are <% body %> and <% title %>. By allowing several named values, it makes it easier to have alternative translations for different parts of the page. This is a slight diversion for rest2web, but should broaden the usefulness of the project.
I now have to decide whether to release what I've done so far. Lots of changes since 0.1.0, most of which work fully and are documented - or wait until I've finished this set of changes and can document them all. As usual coding is more fun than documenting.
Visit rest2web here.
approx is my CGI proxy and set of scripts. This is useful for unrestricted browsing of the internet, in a censored environment. James Marshall has just released the long awaited update to his cgiproxy, which is the 'de facto standard' as far as CGI proxies are concerned. That means it must be time for me to update mine
The main advantage approx has over cgiproxy  is that it can work with a little client proxy . This allows for totally transparent browsing for the user. I'm also adding content encryption, content zipping, and URL obfuscation. Now that I've got a bit of experience at writing Proxy servers (by hacking HTTPSimpleServer), it's time to have another go. I'm hoping that I can use TLSLite to get the client proxy working with https:// URLs.
approx will soon have it's own Sourceforge page too. I've decided that all my projects that have any 'longevity' I'll get Sourceforge pages for. I ought to learn how to use Freshmeat too. Hopefully releaseforge will evolve to handle both at the same time.
You can see approx on the CGI Homepage.
Firedrop is the blog client I use. I've been working on lots of changes to it. These include making sure that it is compatible with the unicode version of wxPython, getting it to accept command line arguments, etc. Thanks to the latest improvements in docutils, the support for reST is getting better too. The changes will all be available soon.
In the meantime - if you use FireSpell with Firedrop, and are a non-native English speaker, you may be interested in the alternative set of dictionaries available.
You can find these at : http://lingucomponent.openoffice.org/spell_dic.html
This needs to go in the myspell folder in your PyEnchant distribution. On windows this would typically be at C:\Python23\Lib\site-packages\enchant\myspell (or similar).
|||i.e. Python code.|
|||The zip was corrupted - which is weird because the original is fine and the one in my web backup is fine....|
|||Other than being written in Python, rather than Perl|
|||To which I've given the snappy name 'approxClientproxy'|
Lies, Damned Lies and...
Sourceforge have had a statistics bug for a long time now . At long last they've fixed it and rolled out the new statistics system.
The Movable Python Download Stats make encouraging reading. Apparently it's had over 1300 downloads. Even allowing for the different releases, and people downloading multiple versions , it's still encouraging. It's definitely the most successful of my various projects.
|||I think they've had the bug for over a year. They hadn't updated any project statistics since January.|
|||I use Movpy 2.4 at one of my jobs, and Movpy 2.2 for testing compatibility.|
|||rest2web, guestbook, and ConfigObj|
Today I was browsing through my Awstats report, which analyses the server logs and comes up with statistics on wesite use. I was checking my bandwidth use, referrers, errors, etc. Amongst the stats was an interesting figure - apparently over 36% of my visitors use Firefox. Wow !
Even my sitemeter tracking thingy registers over 20%. Only a quarter of my visitors come for the Python content, so I'm not an exclusively techie website.
This is good news for the Web !
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.