Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Twisted's plugin system to use twisted.python.modules for cod…
…e discovery This fixes several bugs in the traversal and caching logic of the plugins system, and simplifies it by factoring the code such that the representation of the Python path and import system is now delegated entirely to an API designed to do it. The other major bug fixed here made plugin modules from a development and system installation of Twisted conflict, even if one path entry clearly "won" from the perspective of sys.path, PYTHONPATH, {{{__import__}}}, et. al. In addition to the main fix here, several new features were introduced into the {{{twisted.python.filepath}}}, {{{twisted.python.zippath}}} and {{{twisted.python.modules}}} modules. * twisted.python.filepath * New methods: {{{getStatusChangeTime}}}, {{{getModificationTime}}}, and {{{getAccessTime}}}, to access higher precision timestamps as floats. * New exception-handling behavior: {{{FilePath.children}}} will now raise {{{UnlistableError}}}, allowing users to catch non-fatal reasons why a directory might not be listable. More importantly this allows for ''portable'' error handling between UNIX and Windows. * {{{FilePath}}} instances are now usable as dictionary keys. * twisted.python.zippath * Acquired error-handling similar to {{{FilePath}}} * Acquired new methods for inspecting timestamps, both the old deprecated {{{get(m|c|a)time}}} form and the newer form. This should allow both older and newer code to work with {{{ZipPath}}} instances. The modification stamp is actually pulled from the zipfile metadata. * twisted.python.modules * Gratuitous Windows error-handling logic was removed and replaced with a simple {{{except UnlistableError}}} thanks to {{{FilePath}}}'s new features. Finally, test coverage was improved, and a few gratuitous pyflakes warnings and bits of trailing whitespace were eliminated. Fixes #1951 Author: glyph Reviewers: jerub, exarkun git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@19305 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
- Loading branch information
Showing
8 changed files
with
868 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.