This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
console-script... to fix launching on Windows. Also this is now the officially "blessed" way to generated executables: https://packaging.python.org/guides/distributing-packages-using-setuptools/#scripts
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
""" | ||
pycallgraph | ||
This script is the command line interface to the pycallgraph Python library. | ||
See http://pycallgraph.slowchop.com/ for more information. | ||
""" | ||
|
||
|
||
def main(): | ||
import pycallgraph | ||
|
||
config = pycallgraph.Config() | ||
config.parse_args() | ||
config.strip_argv() | ||
|
||
globals()['__file__'] = config.command | ||
|
||
file_content = open(config.command).read() | ||
|
||
with pycallgraph.PyCallGraph(config=config): | ||
exec(file_content) | ||
|
||
|
||
if __name__ == '__main__': | ||
# Pep366 must always be the 1st thing to run. | ||
if not globals().get('__package__'): | ||
__package__ = "polyversion" # noqa: A001 F841 @ReservedAssignment | ||
|
||
main() |
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
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