~testdoc-dev/testdoc/trunk.git

« back to all changes in this revision

Viewing changes to testdoc/reflect.py

  • Committer: jml@canonical.com
  • Date: 2007-03-31 06:06:47 UTC
  • Revision ID: git-v1:8616dba4a3b0a3f8eb750e2cd2d558e8ab3be748
Add a setup.py file and accept filenames on the command line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
"""Collection of reflection tools lifted from Twisted 2.5."""
2
2
 
 
3
import imp
3
4
import inspect
4
5
import os
5
6
import sys
87
88
    if not os.path.exists(fn):
88
89
        raise ValueError("%r doesn't exist" % (fn,))
89
90
    try:
90
 
        ret = reflect.namedAny(reflect.filenameToModuleName(fn))
 
91
        ret = namedAny(filenameToModuleName(fn))
91
92
    except (ValueError, AttributeError):
92
93
        # Couldn't find module.  The file 'fn' is not in PYTHONPATH
93
94
        return _importFromFile(fn)