Re: Property In Python

2006-04-21 Thread B Mahoney
I started with the "How-To Guide for Descriptors" by Raymond Hettinger http://users.rcn.com/python/download/Descriptor.htm It is one of several docs on the "New-style Classes" page at python.org http://www.python.org/doc/newstyle/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Should we still be learning this?

2006-02-18 Thread B Mahoney
I was initally annoyed that "Dive into Python" has the UserDict, but it was so easy to discover it was deprecated http://docs.python.org/lib/module-UserDict.html (althought the term 'deprecated' is not specifically used), that anyone on the ball (the OP seemed to know) would not based their next bi

Re: Ant (with Python extensions) good replacement for distutils?

2005-12-07 Thread B Mahoney
>>No way. Ant sucks. Big-time. I actually enhance it with embedded jython >>to get at least _some_ flexibility. >>Diez Any pointers to this enhancement? -- http://mail.python.org/mailman/listinfo/python-list

Re: Detect character encoding

2005-12-04 Thread B Mahoney
You may want to look at some Python Cookbook recipes, such as http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52257 "Auto-detect XML encoding" by Paul Prescod -- http://mail.python.org/mailman/listinfo/python-list

Re: Can a function access its own name?

2005-11-19 Thread B Mahoney
Decorate any function with @aboutme(), which will print the function name each time the function is called. All the 'hello' stuff is in the aboutme() decorator code. There is no code in the decorated functions themselves doing anything to telling us the function name. # The decorator def aboutme

Re: Python-based Document Management System?

2005-11-10 Thread B Mahoney
If you search for CONTENT management system, there is Plone: A user-friendly and powerful open source Content Management ... http://plone.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Invoking Python from Python

2005-11-09 Thread B Mahoney
I also think something along the lines of execfile() may serve the original poster. There was a thread last month about compile() and exec() with a concise example from Fredrik Lundh. Google "Changing an AST" in this group. With dynamically generated code I prefer the separate compile() step so

Re: Understanding the arguments for SubElement factory in ElementTree

2005-10-29 Thread B Mahoney
Your SubElement call is lacking the attrib argument, but you can't set text, anyway. The elementtree source makes it clear, you can only set element attrib attributes with SubElement def SubElement(parent, tag, attrib={}, **extra): attrib = attrib.copy() attrib.update(extra) element =

Re: Expat - how to UseForeignDTD

2005-10-20 Thread B Mahoney
I needed to set Entity Parsing, such as parser.SetParamEntityParsing( expat.XML_PARAM_ENTITY_PARSING_ALWAYS ) -- http://mail.python.org/mailman/listinfo/python-list

Expat - how to UseForeignDTD

2005-10-19 Thread B Mahoney
I have a simple Kid template document: http://www.w3.org/1999/xhtml"; xmlns:py="http://purl.org/kid/ns#"; > ... (snip) This runs as expected but now I would like to load a DTD without tampering with this xml file In the expat parser __init__ after setting other handlers for parser, I h

Re: Well written open source Python apps

2005-10-14 Thread B Mahoney
The paper on BitPim http://bitpim.sourceforge.net/papers/baypiggies/ lists and describes programs and ideas used for the project. Some of it is just bullet-points, but everything seems to be well chosen. I've swiped a lot of these ideas. -- http://mail.python.org/mailman/listinfo/python-list

Re: A 'find' utility that continues through zipped directory structure?

2005-09-27 Thread B Mahoney
An effbot utility? I'll try that. Thank you -- http://mail.python.org/mailman/listinfo/python-list

A 'find' utility that continues through zipped directory structure?

2005-09-26 Thread B Mahoney
Is there a Python 'find' -like utility that will continue the file search through any zippped directory structure on the find path? -- http://mail.python.org/mailman/listinfo/python-list