New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove the print staments in alembic.command #43
Comments
Changes by miniwark NA (@miniwark):
|
Michael Bayer (@zzzeek) wrote: this is true that the informational commands are oriented towards being run in a console. If you want to get the current version, do this:
I don't know how alembic.command could itself be changed without pushing the print statements and message formatting somewhere else. The command-line version of the tasks have to be somewhere, and that's what the "command" package is for. And I definitely wouldn't want to promote the API usage as, " to get the current version, run comand.current(), get the return value as a string, then use a regexp to pull out the number from the middle of the message". command.current is just not oriented towards API usage. so perhaps the issue here is even promoting alembic.command as public. |
Changes by Michael Bayer (@zzzeek):
|
miniwark NA (@miniwark) wrote: I was just in need of the revision number, i see now than this can simply be done by using directly
You then can probably close this one as "WontFix" bug. |
Changes by Michael Bayer (@zzzeek):
|
miniwark NA (@miniwark) wrote: Thanks for the good work ! |
Migrated issue, originally created by miniwark NA (@miniwark)
alembic.command use a few print commands to display command results. For example in current function.
If i try to use command.current in another script the version is always printed in the console.
Example script :
This will effectively get the requested version but also print the version with may not be wanted in another script.
suggestion : return a string instead instead of using print
The text was updated successfully, but these errors were encountered: