I've previously
blogged about twisted.python.modules, but it assumes you know about another API inside Twisted,
twisted.python.filepath. Unfortunately this module is rather under-documented and under-publicized, despite being extremely useful. Unlike a lot of Twisted, much of the code in twisted.python can be extracted and used by itself,
(
Read more... )
Comments 6
Reply
if '.svn' in dirs:
dirs.remove('.svn')
Maybe this could be as simple as a keyword argument to walk:
fp.walk(exclude=['.svn','evil_symlink2root'])
Reply
As far as getting into the stdlib - agitate on python-dev. I'll help you do any necessary coding if you can do the legwork to get everyone to agree that it's desirable (as opposed to one of the 30 "OO" filesystem wrappers that people have written for the stdlib, or nothing at all). I don't have the energy for that.
Reply
http://twistedmatrix.com/trac/attachment/ticket/3044/filepath.py.diff#preview
Reply
Reply
Not true, as far as I'm aware. I believe you're talking about the many "object oriented" path abstractions for Python. Twisted uses FilePath for two main requirements, neither of which is OO nicety: security in contexts like a web server, and polymorphism to zip files. Do any of the path libraries you're talking about implement either of these requirements?Frankly, suggesting that people could copy a few source files is the kiss of death, for the prospect of that code being re-used by other people.
This is exactly the strategy that the module being considered for inclusion in Python under PEP 355 uses.Twisted doesn't use good packaging technology
Python doesn't have any good packaging technology. distutils is sparsely documented and difficult to do anything with without touching internal implementation details; setuptools is a mine-field unless your sys.path is set up exactly like PJE's. Granted, Twisted's ( ... )
Reply
Leave a comment