[ANN] includer, proxycleaner and pyhtonutils updates

Voidspace mike at pcblokes.com
Fri Aug 20 13:43:01 CEST 2004


Several new scripts and module updates over at pythonutils.
Visit http://www.voidspace.org.uk/atlantibots/pythonutils.html


*NEW* includer.py        Version 1.0.0

Adds an INCLUDE command to python scripts for including other modules 
into them. Lots of nifty features including recursive include, incdir 
command, will remove relevant import statements and anything under the 
'if __name__ ==...' line from included scripts etc....

Useful for distributing modules with several dependencies as a single 
file. The features mean that it's possible to test a module using normal 
import statements (of the type from module import....). When you run 
includer.py, the INCLUDE command causes your included script (minus the 
test code under a 'if __name__ ==...' line) to be added in *and* the 
import statements are removed.

Using ##INCLUDE is the equivalent of 'from module import *' - avoiding 
namespace pollution is up to you.

python includer.py infilename outfilename
Easy hey !


*NEW*         proxycleaner.py        Version 1.0.0
*NEW*         approxClientproxy.py    Version 0.1.0
*UPDATED*        approx.py            Version 0.4.0

approx.py is a cgiproxy for use by those in restricted internet 
environments. (Work, internet cafes, colleges, libraries, restrictive 
regimes etc). It is still at beta stage but functional. Cookie handling 
with ClientCookie now works although support for multiple users and 
cookie management will be added. Authentication and POST methods are the 
next issues to work on. DEBUG mode added.

proxycleaner.py will 'clean' webpages that have been fetched through 
approx or the James Marshall perl cgiproxy. Both these scripts modify 
URLs a pages are fetched through them - this script undoes the modification.

approxClientproxy.py is a client script that works in conjunction with 
approx.py - it runs on your machine. Instead of having approx modify 
pages you can point your browser at approxClientproxy which handles the 
communication between itself and approx. Things like javascript, which 
approx can't modify, work through aPc which transparently mangles *all* 
access to go through approx... At the moment it's a crude hack of 
TCPwatch by the Zope corp.. but it works fine and will only improve. 
Allows transparent unrestricted http access in a restricted environment.



*UPDATE*        ConfigObj            Version 3.2.0

Removed the charmap 'function' that eliminated unicode errors by 
stamping on unicode. Unicode problems will now raise an exception. If 
this causes you problems let me know (with examples if possible) and 
I'll work on the unicode issues.
The test for list type entries is not an 'isinstance' test but a 
'hasattr' test (append is the attribute tested for). This isn't 
ubiquitous though.
Added the 'stringify' keyword - including changes to the listquote 
module for this (which is also now a bit faster).
fullconfigobj.py is now built using includer.py
Uses a newer version of caseless than the previous distribution.
Changed license text.



*UPDATE*        listquote        Version 1.1.0

Added handling for non-string elements in elem_quote (optional).
Replaced some old += with lists and ''.join() for speed improvements...
Using basestring and hasattr('__getitem__') tests instead of 
isinstance(list) and str in a couple of places.
Changed license text.
Made the tests useful.



*NEW*            http_test.py    Version 1.2.0

Now at http://www.voidspace.org.uk/atlantibots/recipebook.html (was 
previously just online in the Python Cookbook)
A CGI script that will fetch a URL and display all server headers, saved 
cookies, the first part of the content (as raw HTML) *and* all the CGI 
environment variables. Some authentication code as well. Very useful for 
debugging in various situation or as an illustration of several aspects 
of basic CGI.


# Copyright Michael Foord
# Free to use, modify and relicense.
# No warranty express or implied for the accuracy, fitness to purpose or 
otherwise for this code....
# Use at your own risk !!!

# E-mail michael AT foord DOT me DOT uk
# Maintained at www.voidspace.org.uk/atlantibots/pythonutils.html




-- 

http://www.Voidspace.org.uk 
The Place where headspace meets cyberspace. Online resource site - covering science, technology, computing, cyberpunk, psychology, spirituality, fiction and more. 

---
http://www.Voidspace.org.uk/atlantibots/pythonutils.html
Python utilities, modules and apps.
Including Nanagram, Dirwatcher and more.
---
http://www.fuchsiashockz.co.uk   
http://groups.yahoo.com/group/void-shockz
---

Everyone has talent. What is rare is the courage to follow talent
 to the dark place where it leads. -Erica Jong
Ambition is a poor excuse for not having sense enough to be lazy.
         -Milan Kundera





More information about the Python-announce-list mailing list