This builds on top of @nvie's PR but uses runpy to allow running any module in the sys.path under statprof.
Make stop() fail if called when profiling is not on
Add some docstrings
Refactor some code into ProfileState methods
Format file paths
Refactor DisplayFormat a bit more
Run flake8 on the code as part of test suite
Use six to provide iteritems/itervalues
Clean up a bit
Make source compatible with Python 3 without 2to3
Prepare for PyPI release
Mark package as not zip_safe
Generate universal wheels
Add ability to run statprof as a module.
Expand the script's path first.
Make sure everything is still importable in the target script.
Use runpy, allows python -mstatprof -mmodule_name.
Python 3 compat: Use six.exec_ instead of execfile
Bump version to 0.2.0c2
I let myself merge your changes into https://pypi.python.org/pypi/statprof-smarkets
Test with Python 3.4
Set __name__ correctly when executing files
Open to this, but it seems to have bitrotted. Closing for now.
Sad that #16 and #17 got closed like this. Don't think anything bitrotted there in the commits. Too bad I don't use statprof anymore to justify making a clean PR myself...
@zyv Our fork is available on PyPI as statprof-smarkets if you ever need statprof with this feature.